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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC 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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@deref +; MODULE-SAME: (i32 [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[X_PRIV:%.*]] = alloca i32, align 4 +; MODULE-NEXT: store i32 [[TMP0]], i32* [[X_PRIV]], align 4 +; MODULE-NEXT: [[TMP2:%.*]] = load i32, i32* [[X_PRIV]], align 4 +; MODULE-NEXT: ret i32 [[TMP2]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@deref +; CGSCC-SAME: (i32 returned [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[X_PRIV:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: store i32 [[TMP0]], i32* [[X_PRIV]], align 4 +; CGSCC-NEXT: [[TMP2:%.*]] = load i32, i32* [[X_PRIV]], align 4 +; CGSCC-NEXT: ret i32 [[TMP0]] ; entry: %tmp2 = load i32, i32* %x, align 4 @@ -43,41 +27,23 @@ } 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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@f +; MODULE-SAME: (i32 [[X:%.*]]) #[[ATTR1:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[X_ADDR:%.*]] = alloca i32, align 4 +; MODULE-NEXT: store i32 [[X]], i32* [[X_ADDR]], align 4 +; MODULE-NEXT: [[TMP0:%.*]] = load i32, i32* [[X_ADDR]], align 4 +; MODULE-NEXT: [[TMP1:%.*]] = call i32 @deref(i32 [[TMP0]]) #[[ATTR2:[0-9]+]] +; MODULE-NEXT: ret i32 [[TMP1]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@f +; CGSCC-SAME: (i32 returned [[X:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[X_ADDR:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: store i32 [[X]], i32* [[X_ADDR]], align 4 +; CGSCC-NEXT: ret i32 [[X]] ; entry: %x_addr = alloca i32 @@ -86,13 +52,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 } +; MODULE: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } +; MODULE: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR2]] = { nofree nosync nounwind readonly willreturn } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: 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,39 +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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; PR2498 ; This test tries to convince CHECK about promoting the load from %A + 2, ; because there is a load of %A in the entry block define internal i32 @callee(i1 %C, i32* %A) { +; MODULE: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@callee +; MODULE-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[A_0:%.*]] = load i32, i32* [[A]], align 4 +; MODULE-NEXT: br label [[F:%.*]] +; MODULE: T: +; MODULE-NEXT: unreachable +; MODULE: F: +; MODULE-NEXT: [[A_2:%.*]] = getelementptr i32, i32* [[A]], i32 2 +; MODULE-NEXT: [[R:%.*]] = load i32, i32* [[A_2]], align 4 +; MODULE-NEXT: ret i32 [[R]] ; -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@callee -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: [[A_0:%.*]] = load i32, i32* [[A]], align 4 -; IS__TUNIT____-NEXT: br label [[F:%.*]] -; IS__TUNIT____: T: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: F: -; IS__TUNIT____-NEXT: [[A_2:%.*]] = getelementptr i32, i32* [[A]], i32 2 -; IS__TUNIT____-NEXT: [[R:%.*]] = load i32, i32* [[A_2]], align 4 -; IS__TUNIT____-NEXT: ret i32 [[R]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@callee -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[A_0:%.*]] = load i32, i32* [[A]], align 4 -; IS__CGSCC____-NEXT: br label [[F:%.*]] -; IS__CGSCC____: T: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: F: -; IS__CGSCC____-NEXT: [[A_2:%.*]] = getelementptr i32, i32* [[A]], i32 2 -; IS__CGSCC____-NEXT: [[R:%.*]] = load i32, i32* [[A_2]], align 4 -; IS__CGSCC____-NEXT: ret i32 [[R]] +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@callee +; CGSCC-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[A_0:%.*]] = load i32, i32* [[A]], align 4 +; CGSCC-NEXT: br label [[F:%.*]] +; CGSCC: T: +; CGSCC-NEXT: unreachable +; CGSCC: F: +; CGSCC-NEXT: [[A_2:%.*]] = getelementptr i32, i32* [[A]], i32 2 +; CGSCC-NEXT: [[R:%.*]] = load i32, i32* [[A_2]], align 4 +; CGSCC-NEXT: ret i32 [[R]] ; entry: ; Unconditonally load the element at %A @@ -51,26 +48,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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@foo +; MODULE-SAME: (i32* nocapture nofree readonly [[A:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[X:%.*]] = call i32 @callee(i32* nocapture nofree readonly align 4 [[A]]) #[[ATTR1:[0-9]+]] +; MODULE-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]] +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@foo +; CGSCC-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[X:%.*]] = call i32 @callee(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]]) #[[ATTR1:[0-9]+]] +; CGSCC-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 } +; MODULE: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; CGSCC: 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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC 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 +; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@hash +; CGSCC-SAME: () #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-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 +; MODULE: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@encode +; MODULE-SAME: (i32* nocapture nofree readnone [[M:%.*]], i32* nocapture nofree readnone [[TS:%.*]], i32* nocapture nofree readnone [[NEW:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@encode +; CGSCC-SAME: (i32* nocapture nofree readnone [[M:%.*]], i32* nocapture nofree readnone [[TS:%.*]], i32* nocapture nofree readnone [[NEW:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-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 } +; MODULE: attributes #[[ATTR0]] = { nofree noreturn nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; CGSCC: 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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC 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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@term_SharingList +; CGSCC-SAME: () #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br i1 false, label [[BB:%.*]], label [[BB5:%.*]] +; CGSCC: bb: +; CGSCC-NEXT: unreachable +; CGSCC: bb5: +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@term_Sharing +; MODULE-SAME: (i32* nocapture nofree readnone [[TERM:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: br i1 false, label [[BB_I:%.*]], label [[BB14:%.*]] +; MODULE: bb.i: +; MODULE-NEXT: unreachable +; MODULE: bb14: +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@term_Sharing +; CGSCC-SAME: (i32* nocapture nofree readnone [[TERM:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br i1 false, label [[BB_I:%.*]], label [[BB14:%.*]] +; CGSCC: bb.i: +; CGSCC-NEXT: unreachable +; CGSCC: bb14: +; CGSCC-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 } +; MODULE: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: 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,29 +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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; Test that we only promote arguments when the caller/callee have compatible ; function attrubtes. 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 +22,31 @@ } 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 -; -; 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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@no_promote +; MODULE-SAME: (<4 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1:[0-9]+]] { +; MODULE-NEXT: bb: +; MODULE-NEXT: [[TMP:%.*]] = alloca <4 x i64>, align 32 +; MODULE-NEXT: [[TMP2:%.*]] = alloca <4 x i64>, align 32 +; MODULE-NEXT: [[TMP3:%.*]] = bitcast <4 x i64>* [[TMP]] to i8* +; MODULE-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]+]] +; MODULE-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]+]] +; MODULE-NEXT: [[TMP4:%.*]] = load <4 x i64>, <4 x i64>* [[TMP2]], align 32 +; MODULE-NEXT: store <4 x i64> [[TMP4]], <4 x i64>* [[ARG]], align 2 +; MODULE-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 +; CGSCC: Function Attrs: argmemonly nofree nosync nounwind uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@no_promote +; CGSCC-SAME: (<4 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(32) [[ARG:%.*]]) #[[ATTR1:[0-9]+]] { +; CGSCC-NEXT: bb: +; CGSCC-NEXT: [[TMP:%.*]] = alloca <4 x i64>, align 32 +; CGSCC-NEXT: [[TMP2:%.*]] = alloca <4 x i64>, align 32 +; CGSCC-NEXT: [[TMP3:%.*]] = bitcast <4 x i64>* [[TMP]] to i8* +; CGSCC-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]+]] +; CGSCC-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]+]] +; CGSCC-NEXT: [[TMP4:%.*]] = load <4 x i64>, <4 x i64>* [[TMP2]], align 32 +; CGSCC-NEXT: store <4 x i64> [[TMP4]], <4 x i64>* [[ARG]], align 2 +; CGSCC-NEXT: ret void ; bb: %tmp = alloca <4 x i64>, align 32 @@ -96,33 +60,25 @@ } 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 +; MODULE: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@promote_avx2 +; MODULE-SAME: (<4 x i64>* noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[ARG:%.*]], <4 x i64> [[TMP0:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: bb: +; MODULE-NEXT: [[ARG1_PRIV:%.*]] = alloca <4 x i64>, align 32 +; MODULE-NEXT: store <4 x i64> [[TMP0]], <4 x i64>* [[ARG1_PRIV]], align 32 +; MODULE-NEXT: [[TMP:%.*]] = load <4 x i64>, <4 x i64>* [[ARG1_PRIV]], align 32 +; MODULE-NEXT: store <4 x i64> [[TMP]], <4 x i64>* [[ARG]], align 32 +; MODULE-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 -; -; 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 +; CGSCC: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@promote_avx2 +; CGSCC-SAME: (<4 x i64>* noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[ARG:%.*]], <4 x i64> [[TMP0:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: bb: +; CGSCC-NEXT: [[ARG1_PRIV:%.*]] = alloca <4 x i64>, align 32 +; CGSCC-NEXT: store <4 x i64> [[TMP0]], <4 x i64>* [[ARG1_PRIV]], align 32 +; CGSCC-NEXT: [[TMP:%.*]] = load <4 x i64>, <4 x i64>* [[ARG1_PRIV]], align 32 +; CGSCC-NEXT: store <4 x i64> [[TMP0]], <4 x i64>* [[ARG]], align 32 +; CGSCC-NEXT: ret void ; bb: %tmp = load <4 x i64>, <4 x i64>* %arg1 @@ -131,59 +87,33 @@ } 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 +; MODULE: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@promote +; MODULE-SAME: (<4 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: bb: +; MODULE-NEXT: [[TMP:%.*]] = alloca <4 x i64>, align 32 +; MODULE-NEXT: [[TMP2:%.*]] = alloca <4 x i64>, align 32 +; MODULE-NEXT: [[TMP3:%.*]] = bitcast <4 x i64>* [[TMP]] to i8* +; MODULE-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]] +; MODULE-NEXT: [[TMP0:%.*]] = load <4 x i64>, <4 x i64>* [[TMP]], align 32 +; MODULE-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]] +; MODULE-NEXT: [[TMP4:%.*]] = load <4 x i64>, <4 x i64>* [[TMP2]], align 32 +; MODULE-NEXT: store <4 x i64> [[TMP4]], <4 x i64>* [[ARG]], align 2 +; MODULE-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 +; CGSCC: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@promote +; CGSCC-SAME: (<4 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(32) [[ARG:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: bb: +; CGSCC-NEXT: [[TMP:%.*]] = alloca <4 x i64>, align 32 +; CGSCC-NEXT: [[TMP2:%.*]] = alloca <4 x i64>, align 32 +; CGSCC-NEXT: [[TMP3:%.*]] = bitcast <4 x i64>* [[TMP]] to i8* +; CGSCC-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]] +; CGSCC-NEXT: [[TMP0:%.*]] = load <4 x i64>, <4 x i64>* [[TMP]], align 32 +; CGSCC-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]] +; CGSCC-NEXT: [[TMP4:%.*]] = load <4 x i64>, <4 x i64>* [[TMP2]], align 32 +; CGSCC-NEXT: store <4 x i64> [[TMP4]], <4 x i64>* [[ARG]], align 2 +; CGSCC-NEXT: ret void ; bb: %tmp = alloca <4 x i64>, align 32 @@ -203,15 +133,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 } +; MODULE: attributes #[[ATTR0]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "target-features"="+avx2" } +; MODULE: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind uwtable willreturn } +; MODULE: attributes #[[ATTR2:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } +; MODULE: attributes #[[ATTR3]] = { willreturn writeonly } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "target-features"="+avx2" } +; CGSCC: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind uwtable willreturn } +; CGSCC: attributes #[[ATTR2:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } +; CGSCC: attributes #[[ATTR3]] = { willreturn writeonly } +; CGSCC: 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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; Test that we only promote arguments when the caller/callee have compatible ; function attrubtes. @@ -10,34 +8,25 @@ ; 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 +; MODULE: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512 +; MODULE-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: bb: +; MODULE-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 +; MODULE-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 +; MODULE-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 +; MODULE-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512 +; CGSCC-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: bb: +; CGSCC-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 +; CGSCC-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 +; CGSCC-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 +; CGSCC-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG]], align 64 +; CGSCC-NEXT: ret void ; bb: %tmp = load <8 x i64>, <8 x i64>* %arg1 @@ -46,60 +35,33 @@ } 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 +; MODULE: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@avx512_legal512_prefer512_call_avx512_legal512_prefer512 +; MODULE-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: bb: +; MODULE-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 +; MODULE-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 +; MODULE-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* +; MODULE-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]+]] +; MODULE-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 +; MODULE-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]+]] +; MODULE-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 +; MODULE-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@avx512_legal512_prefer512_call_avx512_legal512_prefer512 +; CGSCC-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: bb: +; CGSCC-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 +; CGSCC-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 +; CGSCC-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* +; CGSCC-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]+]] +; CGSCC-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 +; CGSCC-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]+]] +; CGSCC-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 +; CGSCC-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 +; CGSCC-NEXT: ret void ; bb: %tmp = alloca <8 x i64>, align 32 @@ -114,34 +76,25 @@ ; 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 +; MODULE: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256 +; MODULE-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR1:[0-9]+]] { +; MODULE-NEXT: bb: +; MODULE-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 +; MODULE-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 +; MODULE-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 +; MODULE-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256 +; CGSCC-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR1:[0-9]+]] { +; CGSCC-NEXT: bb: +; CGSCC-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 +; CGSCC-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 +; CGSCC-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 +; CGSCC-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG]], align 64 +; CGSCC-NEXT: ret void ; bb: %tmp = load <8 x i64>, <8 x i64>* %arg1 @@ -150,60 +103,33 @@ } 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 +; MODULE: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal512_prefer256 +; MODULE-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: bb: +; MODULE-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 +; MODULE-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 +; MODULE-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* +; MODULE-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]] +; MODULE-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 +; MODULE-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]] +; MODULE-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 +; MODULE-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal512_prefer256 +; CGSCC-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: bb: +; CGSCC-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 +; CGSCC-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 +; CGSCC-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* +; CGSCC-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]] +; CGSCC-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 +; CGSCC-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]] +; CGSCC-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 +; CGSCC-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 +; CGSCC-NEXT: ret void ; bb: %tmp = alloca <8 x i64>, align 32 @@ -218,34 +144,25 @@ ; 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 +; MODULE: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256 +; MODULE-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: bb: +; MODULE-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 +; MODULE-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 +; MODULE-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 +; MODULE-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256 +; CGSCC-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: bb: +; CGSCC-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 +; CGSCC-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 +; CGSCC-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 +; CGSCC-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG]], align 64 +; CGSCC-NEXT: ret void ; bb: %tmp = load <8 x i64>, <8 x i64>* %arg1 @@ -254,60 +171,33 @@ } 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 +; MODULE: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@avx512_legal512_prefer512_call_avx512_legal512_prefer256 +; MODULE-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: bb: +; MODULE-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 +; MODULE-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 +; MODULE-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* +; MODULE-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]] +; MODULE-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 +; MODULE-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]] +; MODULE-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 +; MODULE-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@avx512_legal512_prefer512_call_avx512_legal512_prefer256 +; CGSCC-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: bb: +; CGSCC-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 +; CGSCC-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 +; CGSCC-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* +; CGSCC-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]] +; CGSCC-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 +; CGSCC-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]] +; CGSCC-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 +; CGSCC-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 +; CGSCC-NEXT: ret void ; bb: %tmp = alloca <8 x i64>, align 32 @@ -322,34 +212,25 @@ ; 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 +; MODULE: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512 +; MODULE-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: bb: +; MODULE-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 +; MODULE-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 +; MODULE-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 +; MODULE-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512 +; CGSCC-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: bb: +; CGSCC-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 +; CGSCC-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 +; CGSCC-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 +; CGSCC-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG]], align 64 +; CGSCC-NEXT: ret void ; bb: %tmp = load <8 x i64>, <8 x i64>* %arg1 @@ -358,60 +239,33 @@ } 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 +; MODULE: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal512_prefer512 +; MODULE-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: bb: +; MODULE-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 +; MODULE-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 +; MODULE-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* +; MODULE-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]] +; MODULE-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 +; MODULE-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]] +; MODULE-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 +; MODULE-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal512_prefer512 +; CGSCC-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: bb: +; CGSCC-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 +; CGSCC-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 +; CGSCC-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* +; CGSCC-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]] +; CGSCC-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 +; CGSCC-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]] +; CGSCC-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 +; CGSCC-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 +; CGSCC-NEXT: ret void ; bb: %tmp = alloca <8 x i64>, align 32 @@ -426,22 +280,13 @@ ; 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 @@ -450,58 +295,31 @@ } 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 +; MODULE: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@avx512_legal256_prefer256_call_avx512_legal512_prefer256 +; MODULE-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR2:[0-9]+]] { +; MODULE-NEXT: bb: +; MODULE-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 +; MODULE-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 +; MODULE-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* +; MODULE-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]] +; MODULE-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]] +; MODULE-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 +; MODULE-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@avx512_legal256_prefer256_call_avx512_legal512_prefer256 +; CGSCC-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR2:[0-9]+]] { +; CGSCC-NEXT: bb: +; CGSCC-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 +; CGSCC-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 +; CGSCC-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* +; CGSCC-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]] +; CGSCC-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]] +; CGSCC-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 +; CGSCC-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 +; CGSCC-NEXT: ret void ; bb: %tmp = alloca <8 x i64>, align 32 @@ -516,22 +334,13 @@ ; 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 @@ -540,58 +349,31 @@ } 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 +; MODULE: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal256_prefer256 +; MODULE-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: bb: +; MODULE-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 +; MODULE-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 +; MODULE-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* +; MODULE-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]] +; MODULE-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]] +; MODULE-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 +; MODULE-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal256_prefer256 +; CGSCC-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: bb: +; CGSCC-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 +; CGSCC-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 +; CGSCC-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* +; CGSCC-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]] +; CGSCC-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]] +; CGSCC-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 +; CGSCC-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 +; CGSCC-NEXT: ret void ; bb: %tmp = alloca <8 x i64>, align 32 @@ -606,34 +388,25 @@ ; 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 +; MODULE: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256 +; MODULE-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR3:[0-9]+]] { +; MODULE-NEXT: bb: +; MODULE-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 +; MODULE-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 +; MODULE-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 +; MODULE-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256 +; CGSCC-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR3:[0-9]+]] { +; CGSCC-NEXT: bb: +; CGSCC-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 +; CGSCC-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 +; CGSCC-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 +; CGSCC-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG]], align 64 +; CGSCC-NEXT: ret void ; bb: %tmp = load <8 x i64>, <8 x i64>* %arg1 @@ -642,60 +415,33 @@ } 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 +; MODULE: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@avx2_legal256_prefer256_call_avx2_legal512_prefer256 +; MODULE-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { +; MODULE-NEXT: bb: +; MODULE-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 +; MODULE-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 +; MODULE-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* +; MODULE-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]] +; MODULE-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 +; MODULE-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]] +; MODULE-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 +; MODULE-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@avx2_legal256_prefer256_call_avx2_legal512_prefer256 +; CGSCC-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { +; CGSCC-NEXT: bb: +; CGSCC-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 +; CGSCC-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 +; CGSCC-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* +; CGSCC-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]] +; CGSCC-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 +; CGSCC-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]] +; CGSCC-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 +; CGSCC-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 +; CGSCC-NEXT: ret void ; bb: %tmp = alloca <8 x i64>, align 32 @@ -710,34 +456,25 @@ ; 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 +; MODULE: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256 +; MODULE-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR4]] { +; MODULE-NEXT: bb: +; MODULE-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 +; MODULE-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 +; MODULE-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 +; MODULE-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256 +; CGSCC-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: bb: +; CGSCC-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 +; CGSCC-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64 +; CGSCC-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64 +; CGSCC-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG]], align 64 +; CGSCC-NEXT: ret void ; bb: %tmp = load <8 x i64>, <8 x i64>* %arg1 @@ -746,60 +483,33 @@ } 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 +; MODULE: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@avx2_legal512_prefer256_call_avx2_legal256_prefer256 +; MODULE-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR3]] { +; MODULE-NEXT: bb: +; MODULE-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 +; MODULE-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 +; MODULE-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* +; MODULE-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]] +; MODULE-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 +; MODULE-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]] +; MODULE-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 +; MODULE-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@avx2_legal512_prefer256_call_avx2_legal256_prefer256 +; CGSCC-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR3]] { +; CGSCC-NEXT: bb: +; CGSCC-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 +; CGSCC-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 +; CGSCC-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8* +; CGSCC-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]] +; CGSCC-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64 +; CGSCC-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]] +; CGSCC-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64 +; CGSCC-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2 +; CGSCC-NEXT: ret void ; bb: %tmp = alloca <8 x i64>, align 32 @@ -822,21 +532,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 } +; MODULE: attributes #[[ATTR0]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="512" "prefer-vector-width"="512" "target-features"="+avx512vl" } +; MODULE: attributes #[[ATTR1]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx512vl" } +; MODULE: attributes #[[ATTR2]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx512vl" } +; MODULE: attributes #[[ATTR3]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx2" } +; MODULE: attributes #[[ATTR4]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx2" } +; MODULE: attributes #[[ATTR5:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } +; MODULE: attributes #[[ATTR6]] = { willreturn writeonly } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="512" "prefer-vector-width"="512" "target-features"="+avx512vl" } +; CGSCC: attributes #[[ATTR1]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx512vl" } +; CGSCC: attributes #[[ATTR2]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx512vl" } +; CGSCC: attributes #[[ATTR3]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx2" } +; CGSCC: attributes #[[ATTR4]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx2" } +; CGSCC: attributes #[[ATTR5:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } +; CGSCC: attributes #[[ATTR6]] = { willreturn writeonly } +; CGSCC: 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 @@ -3,11 +3,8 @@ ; calling convention is passed in a register. This test verifies that ; 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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32" target triple = "i386-pc-windows-msvc19.11.0" 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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC %T = type { i32, i32, i32, i32 } @G = constant %T { i32 0, i32 0, i32 17, i32 25 } @@ -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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test +; CGSCC-SAME: () #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@caller +; MODULE-SAME: () #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@caller +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: ret i32 42 ; entry: %v = call i32 @test(%T* @G) ret i32 %v } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: 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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC 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 -; -; 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 +; MODULE-LABEL: define {{[^@]+}}@f() { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[A:%.*]] = alloca i32, align 1 +; MODULE-NEXT: [[TMP0:%.*]] = load i32, i32* [[A]], align 1 +; MODULE-NEXT: call void @g(i32 [[TMP0]]) +; MODULE-NEXT: ret void +; +; CGSCC-LABEL: define {{[^@]+}}@f() { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: call void @g(i32 undef) +; CGSCC-NEXT: ret void ; entry: %a = alloca i32, align 1 @@ -30,26 +22,20 @@ } 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 +; MODULE-LABEL: define {{[^@]+}}@g +; MODULE-SAME: (i32 [[TMP0:%.*]]) { +; MODULE-NEXT: [[A_PRIV:%.*]] = alloca i32, align 4 +; MODULE-NEXT: store i32 [[TMP0]], i32* [[A_PRIV]], align 4 +; MODULE-NEXT: [[AA:%.*]] = load i32, i32* [[A_PRIV]], align 1 +; MODULE-NEXT: call void @z(i32 [[AA]]) +; MODULE-NEXT: ret void +; +; CGSCC-LABEL: define {{[^@]+}}@g +; CGSCC-SAME: (i32 [[TMP0:%.*]]) { +; CGSCC-NEXT: [[A_PRIV:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: [[AA:%.*]] = load i32, i32* [[A_PRIV]], align 4 +; CGSCC-NEXT: call void @z(i32 undef) +; CGSCC-NEXT: ret void ; %aa = load i32, i32* %a, align 1 call void @z(i32 %aa) @@ -61,68 +47,40 @@ ; 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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@test +; MODULE-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: [[Y_PRIV:%.*]] = alloca i64, align 8 +; MODULE-NEXT: store i64 [[TMP1]], i64* [[Y_PRIV]], align 4 +; MODULE-NEXT: [[X_PRIV:%.*]] = alloca i32, align 4 +; MODULE-NEXT: store i32 [[TMP0]], i32* [[X_PRIV]], align 4 +; MODULE-NEXT: [[A:%.*]] = load i32, i32* [[X_PRIV]], align 4 +; MODULE-NEXT: [[B:%.*]] = load i64, i64* [[Y_PRIV]], align 8 +; MODULE-NEXT: [[C:%.*]] = add i32 [[A]], 1 +; MODULE-NEXT: [[D:%.*]] = add i64 [[B]], 1 +; MODULE-NEXT: [[COND:%.*]] = icmp sgt i64 [[D]], -1 +; MODULE-NEXT: br i1 [[COND]], label [[RETURN1:%.*]], label [[RETURN2:%.*]] +; MODULE: Return1: +; MODULE-NEXT: ret i32 [[C]] +; MODULE: Return2: +; MODULE-NEXT: ret i32 [[A]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test +; CGSCC-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: [[Y_PRIV:%.*]] = alloca i64, align 8 +; CGSCC-NEXT: [[X_PRIV:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: store i32 2, i32* [[X_PRIV]], align 4 +; CGSCC-NEXT: [[A:%.*]] = load i32, i32* [[X_PRIV]], align 4 +; CGSCC-NEXT: [[B:%.*]] = load i64, i64* [[Y_PRIV]], align 8 +; CGSCC-NEXT: [[C:%.*]] = add i32 2, 1 +; CGSCC-NEXT: [[D:%.*]] = add i64 1, 1 +; CGSCC-NEXT: [[COND:%.*]] = icmp sgt i64 2, -1 +; CGSCC-NEXT: br i1 true, label [[RETURN1:%.*]], label [[RETURN2:%.*]] +; CGSCC: Return1: +; CGSCC-NEXT: ret i32 3 +; CGSCC: Return2: +; CGSCC-NEXT: ret i32 2 ; %A = load i32, i32* %X %B = load i64, i64* %Y @@ -137,41 +95,25 @@ } 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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@caller +; MODULE-SAME: (i32 [[TMP0:%.*]]) #[[ATTR1:[0-9]+]] { +; MODULE-NEXT: [[A_PRIV:%.*]] = alloca i32, align 4 +; MODULE-NEXT: store i32 [[TMP0]], i32* [[A_PRIV]], align 4 +; MODULE-NEXT: [[B:%.*]] = alloca i64, align 8 +; MODULE-NEXT: store i64 1, i64* [[B]], align 8 +; MODULE-NEXT: [[TMP2:%.*]] = load i32, i32* [[A_PRIV]], align 4 +; MODULE-NEXT: [[TMP3:%.*]] = load i64, i64* [[B]], align 8 +; MODULE-NEXT: [[C:%.*]] = call i32 @test(i32 [[TMP2]], i64 [[TMP3]]) #[[ATTR3:[0-9]+]] +; MODULE-NEXT: ret i32 [[C]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@caller +; CGSCC-SAME: (i32 [[TMP0:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[A_PRIV:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: [[TMP2:%.*]] = load i32, i32* [[A_PRIV]], align 4 +; CGSCC-NEXT: [[C:%.*]] = call i32 @test(i32 undef, i64 undef) #[[ATTR1:[0-9]+]], !range [[RNG0:![0-9]+]] +; CGSCC-NEXT: ret i32 [[C]] ; %B = alloca i64 store i64 1, i64* %B @@ -180,36 +122,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]] -; -; 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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone +; MODULE-LABEL: define {{[^@]+}}@callercaller +; MODULE-SAME: () #[[ATTR2:[0-9]+]] { +; MODULE-NEXT: [[B:%.*]] = alloca i32, align 4 +; MODULE-NEXT: store i32 2, i32* [[B]], align 4 +; MODULE-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4 +; MODULE-NEXT: [[X:%.*]] = call i32 @caller(i32 [[TMP1]]) #[[ATTR4:[0-9]+]] +; MODULE-NEXT: ret i32 [[X]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@callercaller +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: [[X:%.*]] = call i32 @caller(i32 undef) #[[ATTR2:[0-9]+]] +; CGSCC-NEXT: ret i32 [[X]] ; %B = alloca i32 store i32 2, i32* %B @@ -217,21 +143,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 } +; MODULE: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } +; MODULE: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn } +; MODULE: attributes #[[ATTR2]] = { nofree nosync nounwind readnone } +; MODULE: attributes #[[ATTR3]] = { nofree nosync nounwind readonly willreturn } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR1]] = { nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR2]] = { nounwind readnone willreturn } ;. -; IS__CGSCC_NPM: [[RNG0]] = !{i32 0, i32 4} +; CGSCC: [[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,45 +1,35 @@ ; 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 -; +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; FIXME: The GEP + BC + GEP solution we create is not great but correct. 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 +; MODULE-LABEL: define {{[^@]+}}@caller() { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[LEFT:%.*]] = alloca [3 x i32], align 4 +; MODULE-NEXT: [[ARRAYDECAY:%.*]] = getelementptr inbounds [3 x i32], [3 x i32]* [[LEFT]], i64 0, i64 0 +; MODULE-NEXT: [[TMP0:%.*]] = bitcast i32* [[ARRAYDECAY]] to [3 x i32]* +; MODULE-NEXT: [[DOTCAST:%.*]] = bitcast [3 x i32]* [[TMP0]] to i32* +; MODULE-NEXT: [[TMP1:%.*]] = load i32, i32* [[DOTCAST]], align 4 +; MODULE-NEXT: [[DOT0:%.*]] = getelementptr [3 x i32], [3 x i32]* [[TMP0]], i32 0 +; MODULE-NEXT: [[TMP2:%.*]] = bitcast [3 x i32]* [[DOT0]] to i8* +; MODULE-NEXT: [[DOT0_B4:%.*]] = getelementptr i8, i8* [[TMP2]], i32 4 +; MODULE-NEXT: [[DOT0_B4_CAST:%.*]] = bitcast i8* [[DOT0_B4]] to i32* +; MODULE-NEXT: [[TMP3:%.*]] = load i32, i32* [[DOT0_B4_CAST]], align 4 +; MODULE-NEXT: [[DOT01:%.*]] = getelementptr [3 x i32], [3 x i32]* [[TMP0]], i32 0 +; MODULE-NEXT: [[TMP4:%.*]] = bitcast [3 x i32]* [[DOT01]] to i8* +; MODULE-NEXT: [[DOT0_B8:%.*]] = getelementptr i8, i8* [[TMP4]], i32 8 +; MODULE-NEXT: [[DOT0_B8_CAST:%.*]] = bitcast i8* [[DOT0_B8]] to i32* +; MODULE-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOT0_B8_CAST]], align 4 +; MODULE-NEXT: call void @callee(i32 [[TMP1]], i32 [[TMP3]], i32 [[TMP5]]) +; MODULE-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 +; CGSCC-LABEL: define {{[^@]+}}@caller() { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: call void @callee(i32 undef, i32 undef, i32 undef) +; CGSCC-NEXT: ret void ; entry: %left = alloca [3 x i32], align 4 @@ -49,51 +39,45 @@ } 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 +; MODULE-LABEL: define {{[^@]+}}@callee +; MODULE-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]], i32 [[TMP2:%.*]]) { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[ARG_PRIV:%.*]] = alloca [3 x i32], align 4 +; MODULE-NEXT: [[ARG_PRIV_CAST:%.*]] = bitcast [3 x i32]* [[ARG_PRIV]] to i32* +; MODULE-NEXT: store i32 [[TMP0]], i32* [[ARG_PRIV_CAST]], align 4 +; MODULE-NEXT: [[ARG_PRIV_0:%.*]] = getelementptr [3 x i32], [3 x i32]* [[ARG_PRIV]], i32 0 +; MODULE-NEXT: [[TMP3:%.*]] = bitcast [3 x i32]* [[ARG_PRIV_0]] to i8* +; MODULE-NEXT: [[ARG_PRIV_0_B4:%.*]] = getelementptr i8, i8* [[TMP3]], i32 4 +; MODULE-NEXT: [[ARG_PRIV_0_B4_CAST:%.*]] = bitcast i8* [[ARG_PRIV_0_B4]] to i32* +; MODULE-NEXT: store i32 [[TMP1]], i32* [[ARG_PRIV_0_B4_CAST]], align 4 +; MODULE-NEXT: [[ARG_PRIV_01:%.*]] = getelementptr [3 x i32], [3 x i32]* [[ARG_PRIV]], i32 0 +; MODULE-NEXT: [[TMP4:%.*]] = bitcast [3 x i32]* [[ARG_PRIV_01]] to i8* +; MODULE-NEXT: [[ARG_PRIV_0_B8:%.*]] = getelementptr i8, i8* [[TMP4]], i32 8 +; MODULE-NEXT: [[ARG_PRIV_0_B8_CAST:%.*]] = bitcast i8* [[ARG_PRIV_0_B8]] to i32* +; MODULE-NEXT: store i32 [[TMP2]], i32* [[ARG_PRIV_0_B8_CAST]], align 4 +; MODULE-NEXT: [[TMP5:%.*]] = bitcast [3 x i32]* [[ARG_PRIV]] to i32* +; MODULE-NEXT: call void @use(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(12) [[TMP5]]) +; MODULE-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 +; CGSCC-LABEL: define {{[^@]+}}@callee +; CGSCC-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]], i32 [[TMP2:%.*]]) { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[ARG_PRIV:%.*]] = alloca [3 x i32], align 4 +; CGSCC-NEXT: [[ARG_PRIV_CAST:%.*]] = bitcast [3 x i32]* [[ARG_PRIV]] to i32* +; CGSCC-NEXT: store i32 undef, i32* [[ARG_PRIV_CAST]], align 4 +; CGSCC-NEXT: [[ARG_PRIV_0:%.*]] = getelementptr [3 x i32], [3 x i32]* [[ARG_PRIV]], i32 0 +; CGSCC-NEXT: [[TMP3:%.*]] = bitcast [3 x i32]* [[ARG_PRIV_0]] to i8* +; CGSCC-NEXT: [[ARG_PRIV_0_B4:%.*]] = getelementptr i8, i8* [[TMP3]], i32 4 +; CGSCC-NEXT: [[ARG_PRIV_0_B4_CAST:%.*]] = bitcast i8* [[ARG_PRIV_0_B4]] to i32* +; CGSCC-NEXT: store i32 undef, i32* [[ARG_PRIV_0_B4_CAST]], align 4 +; CGSCC-NEXT: [[ARG_PRIV_01:%.*]] = getelementptr [3 x i32], [3 x i32]* [[ARG_PRIV]], i32 0 +; CGSCC-NEXT: [[TMP4:%.*]] = bitcast [3 x i32]* [[ARG_PRIV_01]] to i8* +; CGSCC-NEXT: [[ARG_PRIV_0_B8:%.*]] = getelementptr i8, i8* [[TMP4]], i32 8 +; CGSCC-NEXT: [[ARG_PRIV_0_B8_CAST:%.*]] = bitcast i8* [[ARG_PRIV_0_B8]] to i32* +; CGSCC-NEXT: store i32 undef, i32* [[ARG_PRIV_0_B8_CAST]], align 4 +; CGSCC-NEXT: [[TMP5:%.*]] = bitcast [3 x i32]* [[ARG_PRIV]] to i32* +; CGSCC-NEXT: call void @use(i32* noalias nocapture noundef nonnull readonly align 4 dereferenceable(12) [[TMP5]]) +; CGSCC-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,78 +1,49 @@ ; 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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC %struct.ss = type { i32, i64 } ; Don't drop 'byval' on %X here. define internal i32 @f(%struct.ss* byval(%struct.ss) %b, i32* byval(i32) %X, i32 %i) nounwind { +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@f +; MODULE-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]], i32 [[TMP2:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[X_PRIV:%.*]] = alloca i32, align 4 +; MODULE-NEXT: store i32 [[TMP2]], i32* [[X_PRIV]], align 4 +; MODULE-NEXT: [[B_PRIV:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 +; MODULE-NEXT: [[B_PRIV_CAST:%.*]] = bitcast %struct.ss* [[B_PRIV]] to i32* +; MODULE-NEXT: store i32 [[TMP0]], i32* [[B_PRIV_CAST]], align 4 +; MODULE-NEXT: [[B_PRIV_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 1 +; MODULE-NEXT: store i64 [[TMP1]], i64* [[B_PRIV_0_1]], align 4 +; MODULE-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 0 +; MODULE-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 8 +; MODULE-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 +; MODULE-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 8 +; MODULE-NEXT: store i32 0, i32* [[X_PRIV]], align 4 +; MODULE-NEXT: [[L:%.*]] = load i32, i32* [[X_PRIV]], align 4 +; MODULE-NEXT: [[A:%.*]] = add i32 [[L]], [[TMP2]] +; MODULE-NEXT: ret i32 [[A]] ; -; 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]] -; -; 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]] +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@f +; CGSCC-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]], i32 [[TMP2:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[X_PRIV:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: store i32 [[TMP2]], i32* [[X_PRIV]], align 4 +; CGSCC-NEXT: [[B_PRIV:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 +; CGSCC-NEXT: [[B_PRIV_CAST:%.*]] = bitcast %struct.ss* [[B_PRIV]] to i32* +; CGSCC-NEXT: store i32 1, i32* [[B_PRIV_CAST]], align 8 +; CGSCC-NEXT: [[B_PRIV_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 1 +; CGSCC-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 0 +; CGSCC-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 8 +; CGSCC-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 +; CGSCC-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 8 +; CGSCC-NEXT: store i32 0, i32* [[X_PRIV]], align 4 +; CGSCC-NEXT: [[L:%.*]] = load i32, i32* [[X_PRIV]], align 4 +; CGSCC-NEXT: [[A:%.*]] = add i32 [[L]], [[TMP2]] +; CGSCC-NEXT: ret i32 [[A]] ; entry: @@ -89,55 +60,32 @@ ; Also make sure we don't drop the call zeroext attribute. define i32 @test(i32* %X) { +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@test +; MODULE-SAME: (i32* nocapture nofree readonly align 4 [[X:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 +; MODULE-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 +; MODULE-NEXT: store i32 1, i32* [[TMP1]], align 8 +; MODULE-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 +; MODULE-NEXT: [[S_CAST:%.*]] = bitcast %struct.ss* [[S]] to i32* +; MODULE-NEXT: [[TMP0:%.*]] = load i32, i32* [[S_CAST]], align 8 +; MODULE-NEXT: [[S_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 +; MODULE-NEXT: [[TMP1:%.*]] = load i64, i64* [[S_0_1]], align 8 +; MODULE-NEXT: [[TMP2:%.*]] = load i32, i32* [[X]], align 4 +; MODULE-NEXT: [[C:%.*]] = call i32 @f(i32 [[TMP0]], i64 [[TMP1]], i32 [[TMP2]]) #[[ATTR1:[0-9]+]] +; MODULE-NEXT: ret i32 [[C]] ; -; 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]] -; -; 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]] +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@test +; CGSCC-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR1:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 +; CGSCC-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 +; CGSCC-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 +; CGSCC-NEXT: [[TMP0:%.*]] = load i32, i32* [[X]], align 4 +; CGSCC-NEXT: [[C:%.*]] = call i32 @f(i32 undef, i64 undef, i32 [[TMP0]]) #[[ATTR2:[0-9]+]] +; CGSCC-NEXT: ret i32 [[C]] ; entry: %S = alloca %struct.ss @@ -151,13 +99,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 } +; MODULE: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind willreturn } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; CGSCC: 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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC 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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@test +; MODULE-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: [[Y_PRIV:%.*]] = alloca i32, align 4 +; MODULE-NEXT: store i32 [[TMP1]], i32* [[Y_PRIV]], align 4 +; MODULE-NEXT: [[X_PRIV:%.*]] = alloca i32, align 4 +; MODULE-NEXT: store i32 [[TMP0]], i32* [[X_PRIV]], align 4 +; MODULE-NEXT: [[A:%.*]] = load i32, i32* [[X_PRIV]], align 4 +; MODULE-NEXT: [[B:%.*]] = load i32, i32* [[Y_PRIV]], align 4 +; MODULE-NEXT: [[C:%.*]] = add i32 [[A]], [[B]] +; MODULE-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]] -; -; 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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test +; CGSCC-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: [[Y_PRIV:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: store i32 2, i32* [[Y_PRIV]], align 4 +; CGSCC-NEXT: [[X_PRIV:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: [[A:%.*]] = load i32, i32* [[X_PRIV]], align 4 +; CGSCC-NEXT: [[B:%.*]] = load i32, i32* [[Y_PRIV]], align 4 +; CGSCC-NEXT: [[C:%.*]] = add i32 1, 2 +; CGSCC-NEXT: ret i32 3 ; %A = load i32, i32* %X %B = load i32, i32* %Y @@ -52,41 +34,25 @@ } 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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@caller +; MODULE-SAME: (i32 [[TMP0:%.*]]) #[[ATTR1:[0-9]+]] { +; MODULE-NEXT: [[B_PRIV:%.*]] = alloca i32, align 4 +; MODULE-NEXT: store i32 [[TMP0]], i32* [[B_PRIV]], align 4 +; MODULE-NEXT: [[A:%.*]] = alloca i32, align 4 +; MODULE-NEXT: store i32 1, i32* [[A]], align 4 +; MODULE-NEXT: [[TMP2:%.*]] = load i32, i32* [[A]], align 4 +; MODULE-NEXT: [[TMP3:%.*]] = load i32, i32* [[B_PRIV]], align 4 +; MODULE-NEXT: [[C:%.*]] = call i32 @test(i32 [[TMP2]], i32 [[TMP3]]) #[[ATTR3:[0-9]+]] +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@caller +; CGSCC-SAME: (i32 [[TMP0:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[B_PRIV:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: [[TMP2:%.*]] = load i32, i32* [[B_PRIV]], align 4 +; CGSCC-NEXT: [[C:%.*]] = call i32 @test(i32 undef, i32 undef) #[[ATTR1:[0-9]+]] +; CGSCC-NEXT: ret i32 undef ; %A = alloca i32 store i32 1, i32* %A @@ -95,35 +61,19 @@ } 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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone +; MODULE-LABEL: define {{[^@]+}}@callercaller +; MODULE-SAME: () #[[ATTR2:[0-9]+]] { +; MODULE-NEXT: [[B:%.*]] = alloca i32, align 4 +; MODULE-NEXT: store i32 2, i32* [[B]], align 4 +; MODULE-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4 +; MODULE-NEXT: [[X:%.*]] = call i32 @caller(i32 [[TMP1]]) #[[ATTR4:[0-9]+]] +; MODULE-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: ret i32 3 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@callercaller +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: ret i32 3 ; %B = alloca i32 store i32 2, i32* %B @@ -132,18 +82,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 } +; MODULE: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } +; MODULE: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn } +; MODULE: attributes #[[ATTR2]] = { nofree nosync nounwind readnone } +; MODULE: attributes #[[ATTR3]] = { nofree nosync nounwind readonly willreturn } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: 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,42 @@ ; 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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC %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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@f +; MODULE-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]], i32 [[TMP2:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[X_PRIV:%.*]] = alloca i32, align 4 +; MODULE-NEXT: store i32 [[TMP2]], i32* [[X_PRIV]], align 4 +; MODULE-NEXT: [[B_PRIV:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 +; MODULE-NEXT: [[B_PRIV_CAST:%.*]] = bitcast %struct.ss* [[B_PRIV]] to i32* +; MODULE-NEXT: store i32 [[TMP0]], i32* [[B_PRIV_CAST]], align 4 +; MODULE-NEXT: [[B_PRIV_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 1 +; MODULE-NEXT: store i64 [[TMP1]], i64* [[B_PRIV_0_1]], align 4 +; MODULE-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 0 +; MODULE-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 8 +; MODULE-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 +; MODULE-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 8 +; MODULE-NEXT: store i32 0, i32* [[X_PRIV]], align 4 +; MODULE-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 -; -; 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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@f +; CGSCC-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]], i32 [[TMP2:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[X_PRIV:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: [[B_PRIV:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 +; CGSCC-NEXT: [[B_PRIV_CAST:%.*]] = bitcast %struct.ss* [[B_PRIV]] to i32* +; CGSCC-NEXT: store i32 1, i32* [[B_PRIV_CAST]], align 8 +; CGSCC-NEXT: [[B_PRIV_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 1 +; CGSCC-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 0 +; CGSCC-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 8 +; CGSCC-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 +; CGSCC-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 8 +; CGSCC-NEXT: ret void ; entry: %tmp = getelementptr %struct.ss, %struct.ss* %b, i32 0, i32 0 @@ -73,53 +49,30 @@ } define i32 @test(i32* %X) { +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@test +; MODULE-SAME: (i32* nocapture nofree readonly align 4 [[X:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 +; MODULE-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 +; MODULE-NEXT: store i32 1, i32* [[TMP1]], align 8 +; MODULE-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 +; MODULE-NEXT: [[S_CAST:%.*]] = bitcast %struct.ss* [[S]] to i32* +; MODULE-NEXT: [[TMP0:%.*]] = load i32, i32* [[S_CAST]], align 8 +; MODULE-NEXT: [[S_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 +; MODULE-NEXT: [[TMP1:%.*]] = load i64, i64* [[S_0_1]], align 8 +; MODULE-NEXT: [[TMP2:%.*]] = load i32, i32* [[X]], align 4 +; MODULE-NEXT: call void @f(i32 [[TMP0]], i64 [[TMP1]], i32 [[TMP2]]) #[[ATTR1:[0-9]+]] +; MODULE-NEXT: ret i32 0 ; -; 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 -; -; 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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test +; CGSCC-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 +; CGSCC-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 +; CGSCC-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 +; CGSCC-NEXT: ret i32 0 ; entry: %S = alloca %struct.ss @@ -131,11 +84,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 } +; MODULE: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind willreturn } +; MODULE: attributes #[[ATTR1]] = { nofree nosync nounwind willreturn } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: 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,62 +1,40 @@ ; 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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC 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" %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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@f +; MODULE-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[B_PRIV:%.*]] = alloca [[STRUCT_SS:%.*]], align 4 +; MODULE-NEXT: [[B_PRIV_CAST:%.*]] = bitcast %struct.ss* [[B_PRIV]] to i32* +; MODULE-NEXT: store i32 [[TMP0]], i32* [[B_PRIV_CAST]], align 4 +; MODULE-NEXT: [[B_PRIV_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 1 +; MODULE-NEXT: store i64 [[TMP1]], i64* [[B_PRIV_0_1]], align 4 +; MODULE-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 0 +; MODULE-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 8 +; MODULE-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 +; MODULE-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 8 +; MODULE-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]] -; -; 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]] +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@f +; CGSCC-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[B_PRIV:%.*]] = alloca [[STRUCT_SS:%.*]], align 4 +; CGSCC-NEXT: [[B_PRIV_CAST:%.*]] = bitcast %struct.ss* [[B_PRIV]] to i32* +; CGSCC-NEXT: store i32 1, i32* [[B_PRIV_CAST]], align 8 +; CGSCC-NEXT: [[B_PRIV_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 1 +; CGSCC-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 0 +; CGSCC-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 8 +; CGSCC-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 +; CGSCC-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 8 +; CGSCC-NEXT: ret i32 [[TMP1]] ; entry: %tmp = getelementptr %struct.ss, %struct.ss* %b, i32 0, i32 0 @@ -68,54 +46,34 @@ 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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@g +; MODULE-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[B_PRIV:%.*]] = alloca [[STRUCT_SS:%.*]], align 4 +; MODULE-NEXT: [[B_PRIV_CAST:%.*]] = bitcast %struct.ss* [[B_PRIV]] to i32* +; MODULE-NEXT: store i32 [[TMP0]], i32* [[B_PRIV_CAST]], align 4 +; MODULE-NEXT: [[B_PRIV_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 1 +; MODULE-NEXT: store i64 [[TMP1]], i64* [[B_PRIV_0_1]], align 4 +; MODULE-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 0 +; MODULE-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 32 +; MODULE-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 +; MODULE-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 32 +; MODULE-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]] +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@g +; CGSCC-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[B_PRIV:%.*]] = alloca [[STRUCT_SS:%.*]], align 4 +; CGSCC-NEXT: [[B_PRIV_CAST:%.*]] = bitcast %struct.ss* [[B_PRIV]] to i32* +; CGSCC-NEXT: store i32 1, i32* [[B_PRIV_CAST]], align 32 +; CGSCC-NEXT: [[B_PRIV_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 1 +; CGSCC-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 0 +; CGSCC-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 32 +; CGSCC-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1 +; CGSCC-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 32 +; CGSCC-NEXT: ret i32 [[TMP2]] ; entry: %tmp = getelementptr %struct.ss, %struct.ss* %b, i32 0, i32 0 @@ -127,64 +85,38 @@ 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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@main +; MODULE-SAME: () #[[ATTR1:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 4 +; MODULE-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 +; MODULE-NEXT: store i32 1, i32* [[TMP1]], align 8 +; MODULE-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 +; MODULE-NEXT: [[S_CAST:%.*]] = bitcast %struct.ss* [[S]] to i32* +; MODULE-NEXT: [[TMP0:%.*]] = load i32, i32* [[S_CAST]], align 8 +; MODULE-NEXT: [[S_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 +; MODULE-NEXT: [[TMP1:%.*]] = load i64, i64* [[S_0_1]], align 8 +; MODULE-NEXT: [[C0:%.*]] = call i32 @f(i32 [[TMP0]], i64 [[TMP1]]) #[[ATTR2:[0-9]+]] +; MODULE-NEXT: [[S_CAST1:%.*]] = bitcast %struct.ss* [[S]] to i32* +; MODULE-NEXT: [[TMP2:%.*]] = load i32, i32* [[S_CAST1]], align 32 +; MODULE-NEXT: [[S_0_12:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 +; MODULE-NEXT: [[TMP3:%.*]] = load i64, i64* [[S_0_12]], align 32 +; MODULE-NEXT: [[C1:%.*]] = call i32 @g(i32 [[TMP2]], i64 [[TMP3]]) #[[ATTR2]] +; MODULE-NEXT: [[A:%.*]] = add i32 [[C0]], [[C1]] +; MODULE-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]] -; -; 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]] +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@main +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 4 +; CGSCC-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 +; CGSCC-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 +; CGSCC-NEXT: [[C0:%.*]] = call i32 @f(i32 undef, i64 undef) #[[ATTR1:[0-9]+]] +; CGSCC-NEXT: [[C1:%.*]] = call i32 @g(i32 undef, i64 undef) #[[ATTR1]] +; CGSCC-NEXT: [[A:%.*]] = add i32 [[C0]], [[C1]] +; CGSCC-NEXT: ret i32 [[A]] ; entry: %S = alloca %struct.ss @@ -200,14 +132,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 } +; MODULE: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind willreturn } +; MODULE: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: 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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC @G1 = constant i32 0 @G2 = constant i32* @G1 @@ -12,12 +10,11 @@ ; CHECK: @[[G2:[a-zA-Z0-9_$"\\.-]+]] = constant i32* @G1 ;. 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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test +; CGSCC-SAME: () #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: ret i32 undef ; entry: %y = load i32*, i32** %x @@ -26,17 +23,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@caller +; MODULE-SAME: () #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@caller +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: ret i32 0 ; entry: %x = call i32 @test(i32** @G2) @@ -44,7 +41,7 @@ } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: 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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; 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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@callee +; MODULE-SAME: (i1 [[C:%.*]], i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; MODULE: T: +; MODULE-NEXT: ret i32 17 +; MODULE: F: +; MODULE-NEXT: [[X:%.*]] = load i32, i32* [[P]], align 4 +; MODULE-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]] +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@callee +; CGSCC-SAME: (i1 [[C:%.*]], i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; CGSCC: T: +; CGSCC-NEXT: ret i32 17 +; CGSCC: F: +; CGSCC-NEXT: [[X:%.*]] = load i32, i32* [[P]], align 4 +; CGSCC-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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@foo +; MODULE-SAME: (i1 [[C:%.*]], i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[X:%.*]] = call i32 @callee(i1 [[C]], i32* nocapture nofree readonly [[P]]) #[[ATTR1:[0-9]+]] +; MODULE-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]] +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@foo +; CGSCC-SAME: (i1 [[C:%.*]], i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[X:%.*]] = call i32 @callee(i1 [[C]], i32* nocapture nofree readonly [[P]]) #[[ATTR1:[0-9]+]] +; CGSCC-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 } +; MODULE: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; CGSCC: 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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC 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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@callee +; MODULE-SAME: (i32 [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: [[P_PRIV:%.*]] = alloca i32, align 4 +; MODULE-NEXT: store i32 [[TMP0]], i32* [[P_PRIV]], align 4 +; MODULE-NEXT: br label [[F:%.*]] +; MODULE: T: +; MODULE-NEXT: unreachable +; MODULE: F: +; MODULE-NEXT: [[X:%.*]] = load i32, i32* [[P_PRIV]], align 4 +; MODULE-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]] -; -; 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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@callee +; CGSCC-SAME: (i32 [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: [[P_PRIV:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: br label [[F:%.*]] +; CGSCC: T: +; CGSCC-NEXT: unreachable +; CGSCC: F: +; CGSCC-NEXT: [[X:%.*]] = load i32, i32* [[P_PRIV]], align 4 +; CGSCC-NEXT: ret i32 undef ; br i1 %C, label %T, label %F @@ -61,35 +39,19 @@ } 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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@foo +; MODULE-SAME: () #[[ATTR1:[0-9]+]] { +; MODULE-NEXT: [[A:%.*]] = alloca i32, align 4 +; MODULE-NEXT: store i32 17, i32* [[A]], align 4 +; MODULE-NEXT: [[TMP1:%.*]] = load i32, i32* [[A]], align 4 +; MODULE-NEXT: [[X:%.*]] = call i32 @callee(i32 [[TMP1]]) #[[ATTR2:[0-9]+]] +; MODULE-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]] -; -; 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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@foo +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: ret i32 17 ; %A = alloca i32 ; [#uses=2] store i32 17, i32* %A @@ -98,13 +60,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 } +; MODULE: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } +; MODULE: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR2]] = { nofree nosync nounwind readonly willreturn } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: 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,35 +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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC %S = type { %S* } ; 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 +; MODULE: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@zot +; MODULE-SAME: () #[[ATTR0:[0-9]+]] personality i32 (...)* @wibble { +; MODULE-NEXT: bb: +; MODULE-NEXT: call void @hoge() #[[ATTR1:[0-9]+]] +; MODULE-NEXT: unreachable +; MODULE: bb1: +; MODULE-NEXT: unreachable +; MODULE: bb2: +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@zot +; CGSCC-SAME: () #[[ATTR0:[0-9]+]] personality i32 (...)* @wibble { +; CGSCC-NEXT: bb: +; CGSCC-NEXT: call void @hoge() #[[ATTR2:[0-9]+]] +; CGSCC-NEXT: unreachable +; CGSCC: bb1: +; CGSCC-NEXT: unreachable +; CGSCC: bb2: +; CGSCC-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 +; MODULE: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@hoge +; MODULE-SAME: () #[[ATTR0]] { +; MODULE-NEXT: bb: +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@hoge +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: bb: +; CGSCC-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 +; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@spam +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: bb: +; CGSCC-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 +; CGSCC-LABEL: define {{[^@]+}}@eggs +; CGSCC-SAME: (i8* [[ARG:%.*]]) { +; CGSCC-NEXT: bb: +; CGSCC-NEXT: [[TMP:%.*]] = call zeroext i1 @barney() +; CGSCC-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@barney +; CGSCC-SAME: () #[[ATTR1:[0-9]+]] { +; CGSCC-NEXT: bb: +; CGSCC-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 +; MODULE: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test_inf_promote_caller +; MODULE-SAME: (i32 [[ARG:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: bb: +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test_inf_promote_caller +; CGSCC-SAME: (i32 [[ARG:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: bb: +; CGSCC-NEXT: [[TMP:%.*]] = alloca [[S:%.*]], align 8 +; CGSCC-NEXT: [[TMP1:%.*]] = alloca [[S]], align 8 +; CGSCC-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 +; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test_inf_promote_callee +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: bb: +; CGSCC-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 } +; MODULE: attributes #[[ATTR0]] = { nofree noreturn nosync nounwind readnone willreturn } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: 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,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 -; 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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC 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 +; MODULE-LABEL: define {{[^@]+}}@caller +; MODULE-SAME: (i32** nocapture nofree readonly [[Y:%.*]], %struct.pair* nocapture nofree readnone [[P:%.*]]) { +; MODULE-NEXT: call void @test(i32** nocapture nofree readonly align 8 [[Y]]), !dbg [[DBG4:![0-9]+]] +; MODULE-NEXT: call void @test_byval(), !dbg [[DBG5:![0-9]+]] +; MODULE-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 +; CGSCC-LABEL: define {{[^@]+}}@caller +; CGSCC-SAME: (i32** nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[Y:%.*]], %struct.pair* nocapture nofree readnone [[P:%.*]]) { +; CGSCC-NEXT: call void @test(i32** nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[Y]]), !dbg [[DBG4:![0-9]+]] +; CGSCC-NEXT: call void @test_byval(), !dbg [[DBG5:![0-9]+]] +; CGSCC-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,9 +1,7 @@ ; 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 -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,MODULE ; 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 +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" @@ -21,30 +19,22 @@ ; CHECK: @[[A:[a-zA-Z0-9_$"\\.-]+]] = internal global [[STRUCT_FOO:%.*]] { i32 1, i64 2 }, align 8 ;. define void @run() { +; MODULE: Function Attrs: nofree noreturn nosync nounwind readnone +; MODULE-LABEL: define {{[^@]+}}@run +; MODULE-SAME: () #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[A_CAST:%.*]] = bitcast %struct.Foo* @a to i32* +; MODULE-NEXT: [[TMP0:%.*]] = load i32, i32* [[A_CAST]], align 8 +; MODULE-NEXT: [[A_0_1:%.*]] = getelementptr [[STRUCT_FOO:%.*]], %struct.Foo* @a, i32 0, i32 1 +; MODULE-NEXT: [[TMP1:%.*]] = load i64, i64* [[A_0_1]], align 8 +; MODULE-NEXT: [[TMP2:%.*]] = call i64 @CaptureAStruct(i32 [[TMP0]], i64 [[TMP1]]) #[[ATTR0]] +; MODULE-NEXT: unreachable ; -; 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 -; -; 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 +; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@run +; CGSCC-SAME: () #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: unreachable ; entry: tail call i8 @UseLongDoubleUnsafely(%union.u* byval(%union.u) align 16 bitcast (%struct.s* @b to %union.u*)) @@ -55,11 +45,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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@UseLongDoubleUnsafely +; CGSCC-SAME: () #[[ATTR1:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: ret i8 undef ; entry: %bitcast = bitcast %union.u* %arg to %struct.s* @@ -69,10 +59,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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@UseLongDoubleSafely +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-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 +70,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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@AccessPaddingOfStruct +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-NEXT: ret i64 undef ; %p = bitcast %struct.Foo* %a to i64* %v = load i64, i64* %p @@ -91,58 +81,35 @@ } 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]] +; MODULE: Function Attrs: nofree noreturn nosync nounwind readnone +; MODULE-LABEL: define {{[^@]+}}@CaptureAStruct +; MODULE-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[A_PRIV:%.*]] = alloca [[STRUCT_FOO:%.*]], align 8 +; MODULE-NEXT: [[A_PRIV_CAST:%.*]] = bitcast %struct.Foo* [[A_PRIV]] to i32* +; MODULE-NEXT: store i32 [[TMP0]], i32* [[A_PRIV_CAST]], align 4 +; MODULE-NEXT: [[A_PRIV_0_1:%.*]] = getelementptr [[STRUCT_FOO]], %struct.Foo* [[A_PRIV]], i32 0, i32 1 +; MODULE-NEXT: store i64 [[TMP1]], i64* [[A_PRIV_0_1]], align 8 +; MODULE-NEXT: [[A_PTR:%.*]] = alloca %struct.Foo*, align 8 +; MODULE-NEXT: br label [[LOOP:%.*]] +; MODULE: loop: +; MODULE-NEXT: [[PHI:%.*]] = phi %struct.Foo* [ null, [[ENTRY:%.*]] ], [ [[A_PRIV]], [[LOOP]] ] +; MODULE-NEXT: [[TMP2:%.*]] = phi %struct.Foo* [ [[A_PRIV]], [[ENTRY]] ], [ [[TMP2]], [[LOOP]] ] +; MODULE-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]] +; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind readnone +; CGSCC-LABEL: define {{[^@]+}}@CaptureAStruct +; CGSCC-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR2:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[A_PRIV:%.*]] = alloca [[STRUCT_FOO:%.*]], align 8 +; CGSCC-NEXT: [[A_PRIV_CAST:%.*]] = bitcast %struct.Foo* [[A_PRIV]] to i32* +; CGSCC-NEXT: [[A_PRIV_0_1:%.*]] = getelementptr [[STRUCT_FOO]], %struct.Foo* [[A_PRIV]], i32 0, i32 1 +; CGSCC-NEXT: [[A_PTR:%.*]] = alloca %struct.Foo*, align 8 +; CGSCC-NEXT: br label [[LOOP:%.*]] +; CGSCC: loop: +; CGSCC-NEXT: [[PHI:%.*]] = phi %struct.Foo* [ null, [[ENTRY:%.*]] ], [ [[A_PRIV]], [[LOOP]] ] +; CGSCC-NEXT: [[TMP2:%.*]] = phi %struct.Foo* [ [[A_PRIV]], [[ENTRY]] ], [ [[TMP2]], [[LOOP]] ] +; CGSCC-NEXT: br label [[LOOP]] ; entry: %a_ptr = alloca %struct.Foo* @@ -156,9 +123,9 @@ br label %loop } ;. -; NOT_CGSCC_NPM: attributes #[[ATTR0:[0-9]+]] = { nofree noreturn nosync nounwind readnone } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: 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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC 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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@f +; MODULE-SAME: (%struct.ss* noalias nocapture nofree noundef nonnull inalloca([[STRUCT_SS:%.*]]) align 4 dereferenceable(8) [[S:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[F0:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 +; MODULE-NEXT: [[F1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 +; MODULE-NEXT: [[A:%.*]] = load i32, i32* [[F0]], align 4 +; MODULE-NEXT: [[B:%.*]] = load i32, i32* [[F1]], align 4 +; MODULE-NEXT: [[R:%.*]] = add i32 [[A]], [[B]] +; MODULE-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]] +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@f +; CGSCC-SAME: (%struct.ss* noalias nocapture nofree noundef nonnull inalloca([[STRUCT_SS:%.*]]) align 4 dereferenceable(8) [[S:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[F0:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 +; CGSCC-NEXT: [[F1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 +; CGSCC-NEXT: [[A:%.*]] = load i32, i32* [[F0]], align 4 +; CGSCC-NEXT: [[B:%.*]] = load i32, i32* [[F1]], align 4 +; CGSCC-NEXT: [[R:%.*]] = add i32 [[A]], [[B]] +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@main +; MODULE-SAME: () #[[ATTR1:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[S:%.*]] = alloca inalloca [[STRUCT_SS:%.*]], align 4 +; MODULE-NEXT: [[F0:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 +; MODULE-NEXT: [[F1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 +; MODULE-NEXT: store i32 1, i32* [[F0]], align 4 +; MODULE-NEXT: store i32 2, i32* [[F1]], align 4 +; MODULE-NEXT: [[R:%.*]] = call i32 @f(%struct.ss* noalias nocapture nofree noundef nonnull inalloca([[STRUCT_SS]]) align 4 dereferenceable(8) [[S]]) #[[ATTR2:[0-9]+]] +; MODULE-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]] +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@main +; CGSCC-SAME: () #[[ATTR1:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[S:%.*]] = alloca inalloca [[STRUCT_SS:%.*]], align 4 +; CGSCC-NEXT: [[F0:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 +; CGSCC-NEXT: [[F1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 +; CGSCC-NEXT: store i32 1, i32* [[F0]], align 4 +; CGSCC-NEXT: store i32 2, i32* [[F1]], align 4 +; CGSCC-NEXT: [[R:%.*]] = call i32 @f(%struct.ss* noalias nocapture nofree noundef nonnull inalloca([[STRUCT_SS]]) align 4 dereferenceable(8) [[S]]) #[[ATTR2:[0-9]+]] +; CGSCC-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@g +; 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]] { +; CGSCC-NEXT: entry: +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test +; MODULE-SAME: () #[[ATTR1]] { +; MODULE-NEXT: entry: +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-NEXT: entry: +; CGSCC-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 } +; MODULE: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } +; MODULE: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; CGSCC: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR2]] = { nounwind readonly willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/invalidation.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/invalidation.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/invalidation.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/invalidation.ll @@ -6,7 +6,6 @@ ; detect the instruction-level changes that will fail here. With improper ; invalidation this will crash in the second printer as it tries to reuse ; now-invalid demanded bits. -; ; RUN: opt < %s -passes='function(print),attributor,function(print)' -S | FileCheck %s @G = constant i32 0 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,27 @@ ; 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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC 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 +; CGSCC-LABEL: define {{[^@]+}}@dead() { +; CGSCC-NEXT: [[TMP1:%.*]] = call i32 @test(i32* noalias noundef align 4294967296 null) +; CGSCC-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 +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@test +; CGSCC-SAME: (i32* noalias nocapture nofree noundef writeonly align 4 [[X:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: br i1 true, label [[LIVE:%.*]], label [[DEAD:%.*]] +; CGSCC: live: +; CGSCC-NEXT: store i32 0, i32* [[X]], align 4 +; CGSCC-NEXT: ret i32 undef +; CGSCC: dead: +; CGSCC-NEXT: unreachable ; br i1 true, label %live, label %dead live: @@ -46,19 +34,12 @@ } define internal i32 @caller(i32* %B) { -; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@caller -; IS__CGSCC_OPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[A:%.*]] = alloca i32, align 4 -; IS__CGSCC_OPM-NEXT: [[C:%.*]] = call i32 @test(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR3:[0-9]+]] -; IS__CGSCC_OPM-NEXT: ret i32 undef -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@caller -; IS__CGSCC_NPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[A:%.*]] = alloca i32, align 4 -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = call i32 @test(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR2:[0-9]+]] -; IS__CGSCC_NPM-NEXT: ret i32 undef +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@caller +; CGSCC-SAME: () #[[ATTR1:[0-9]+]] { +; CGSCC-NEXT: [[A:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: [[C:%.*]] = call i32 @test(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR2:[0-9]+]] +; CGSCC-NEXT: ret i32 undef ; %A = alloca i32 store i32 1, i32* %A @@ -67,23 +48,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@callercaller +; MODULE-SAME: () #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: [[B:%.*]] = alloca i32, align 4 +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@callercaller +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-NEXT: [[B:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: ret i32 0 ; %B = alloca i32 store i32 2, i32* %B @@ -92,14 +67,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 } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; CGSCC: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: 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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC 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 +; CGSCC-LABEL: define {{[^@]+}}@dead() { +; CGSCC-NEXT: [[TMP1:%.*]] = call i32 @test(i32* noalias noundef align 4294967296 null) +; CGSCC-NEXT: ret void ; call i32 @test(i32* null, i32* null) ret void } define internal i32 @test(i32* %X, i32* %Y) { -; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test -; NOT_CGSCC_NPM-SAME: (i32* noalias nocapture nofree noundef writeonly align 4 [[X:%.*]]) #[[ATTR0:[0-9]+]] { -; NOT_CGSCC_NPM-NEXT: br i1 true, label [[LIVE:%.*]], label [[DEAD:%.*]] -; NOT_CGSCC_NPM: live: -; NOT_CGSCC_NPM-NEXT: store i32 0, i32* [[X]], align 4 -; NOT_CGSCC_NPM-NEXT: ret i32 undef -; NOT_CGSCC_NPM: dead: -; NOT_CGSCC_NPM-NEXT: unreachable +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@test +; MODULE-SAME: (i32* noalias nocapture nofree noundef writeonly align 4 [[X:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: br i1 true, label [[LIVE:%.*]], label [[DEAD:%.*]] +; MODULE: live: +; MODULE-NEXT: store i32 0, i32* [[X]], align 4 +; MODULE-NEXT: ret i32 undef +; MODULE: dead: +; MODULE-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 +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@test +; CGSCC-SAME: (i32* noalias nocapture nofree noundef writeonly align 4 [[X:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: br i1 true, label [[LIVE:%.*]], label [[DEAD:%.*]] +; CGSCC: live: +; CGSCC-NEXT: store i32 0, i32* [[X]], align 4 +; CGSCC-NEXT: ret i32 undef +; CGSCC: dead: +; CGSCC-NEXT: unreachable ; br i1 true, label %live, label %dead live: @@ -46,19 +44,19 @@ } define internal i32 @caller(i32* %B) { -; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@caller -; NOT_CGSCC_NPM-SAME: (i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR0]] { -; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = alloca i32, align 4 -; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = call i32 @test(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B]]) #[[ATTR2:[0-9]+]] -; NOT_CGSCC_NPM-NEXT: ret i32 undef +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@caller +; MODULE-SAME: (i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[A:%.*]] = alloca i32, align 4 +; MODULE-NEXT: [[C:%.*]] = call i32 @test(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B]]) #[[ATTR2:[0-9]+]] +; MODULE-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 +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@caller +; CGSCC-SAME: (i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[A:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: [[C:%.*]] = call i32 @test(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B]]) #[[ATTR2:[0-9]+]] +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@callercaller +; MODULE-SAME: () #[[ATTR1:[0-9]+]] { +; MODULE-NEXT: [[B:%.*]] = alloca i32, align 4 +; MODULE-NEXT: [[X:%.*]] = call i32 @caller(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B]]) #[[ATTR2]] +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@callercaller +; CGSCC-SAME: () #[[ATTR1:[0-9]+]] { +; CGSCC-NEXT: [[B:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: [[X:%.*]] = call i32 @caller(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B]]) #[[ATTR3:[0-9]+]] +; CGSCC-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 } +; MODULE: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; MODULE: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; CGSCC: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn writeonly } +; CGSCC: 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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; PR36543 ; Don't promote arguments of musttail callee @@ -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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@test +; MODULE-SAME: (%T* nocapture nofree readonly [[P:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: [[A_GEP:%.*]] = getelementptr [[T:%.*]], %T* [[P]], i64 0, i32 3 +; MODULE-NEXT: [[B_GEP:%.*]] = getelementptr [[T]], %T* [[P]], i64 0, i32 2 +; MODULE-NEXT: [[A:%.*]] = load i32, i32* [[A_GEP]], align 4 +; MODULE-NEXT: [[B:%.*]] = load i32, i32* [[B_GEP]], align 4 +; MODULE-NEXT: [[V:%.*]] = add i32 [[A]], [[B]] +; MODULE-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]] +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@test +; CGSCC-SAME: (%T* nocapture nofree readonly [[P:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: [[A_GEP:%.*]] = getelementptr [[T:%.*]], %T* [[P]], i64 0, i32 3 +; CGSCC-NEXT: [[B_GEP:%.*]] = getelementptr [[T]], %T* [[P]], i64 0, i32 2 +; CGSCC-NEXT: [[A:%.*]] = load i32, i32* [[A_GEP]], align 4 +; CGSCC-NEXT: [[B:%.*]] = load i32, i32* [[B_GEP]], align 4 +; CGSCC-NEXT: [[V:%.*]] = add i32 [[A]], [[B]] +; CGSCC-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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@caller +; MODULE-SAME: (%T* nocapture nofree readonly [[P:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[V:%.*]] = musttail call i32 @test(%T* nocapture nofree readonly [[P]]) #[[ATTR4:[0-9]+]] +; MODULE-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]] +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@caller +; CGSCC-SAME: (%T* nocapture nofree readonly [[P:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[V:%.*]] = musttail call i32 @test(%T* nocapture nofree readonly [[P]]) #[[ATTR4:[0-9]+]] +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@foo +; MODULE-SAME: (%T* nocapture nofree readnone [[P:%.*]], i32 [[V:%.*]]) #[[ATTR1:[0-9]+]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@foo +; CGSCC-SAME: (%T* nocapture nofree readnone [[P:%.*]], i32 [[V:%.*]]) #[[ATTR1:[0-9]+]] { +; CGSCC-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test2 +; CGSCC-SAME: (%T* noalias nocapture nofree readnone [[P:%.*]], i32 [[P2:%.*]]) #[[ATTR1]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@caller2 +; MODULE-SAME: (%T* nocapture nofree readnone [[G:%.*]]) #[[ATTR1]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@caller2 +; CGSCC-SAME: (%T* nocapture nofree readnone [[G:%.*]]) #[[ATTR1]] { +; CGSCC-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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@bar +; MODULE-SAME: (%T* nocapture nofree nonnull writeonly dereferenceable(4) [[P:%.*]], i32 [[V:%.*]]) #[[ATTR2:[0-9]+]] { +; MODULE-NEXT: [[I32PTR:%.*]] = getelementptr [[T:%.*]], %T* [[P]], i64 0, i32 0 +; MODULE-NEXT: store i32 [[V]], i32* [[I32PTR]], align 4 +; MODULE-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 +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@bar +; CGSCC-SAME: (%T* nocapture nofree nonnull writeonly dereferenceable(4) [[P:%.*]], i32 [[V:%.*]]) #[[ATTR2:[0-9]+]] { +; CGSCC-NEXT: [[I32PTR:%.*]] = getelementptr [[T:%.*]], %T* [[P]], i64 0, i32 0 +; CGSCC-NEXT: store i32 [[V]], i32* [[I32PTR]], align 4 +; CGSCC-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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@test2b +; MODULE-SAME: (%T* nocapture nofree readonly [[P:%.*]], i32 [[P2:%.*]]) #[[ATTR3:[0-9]+]] { +; MODULE-NEXT: [[A_GEP:%.*]] = getelementptr [[T:%.*]], %T* [[P]], i64 0, i32 3 +; MODULE-NEXT: [[B_GEP:%.*]] = getelementptr [[T]], %T* [[P]], i64 0, i32 2 +; MODULE-NEXT: [[A:%.*]] = load i32, i32* [[A_GEP]], align 4 +; MODULE-NEXT: [[B:%.*]] = load i32, i32* [[B_GEP]], align 4 +; MODULE-NEXT: [[V:%.*]] = add i32 [[A]], [[B]] +; MODULE-NEXT: [[CA:%.*]] = musttail call i32 @bar(%T* undef, i32 [[V]]) #[[ATTR5:[0-9]+]] +; MODULE-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]] +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@test2b +; CGSCC-SAME: (%T* nocapture nofree readonly [[P:%.*]], i32 [[P2:%.*]]) #[[ATTR3:[0-9]+]] { +; CGSCC-NEXT: [[A_GEP:%.*]] = getelementptr [[T:%.*]], %T* [[P]], i64 0, i32 3 +; CGSCC-NEXT: [[B_GEP:%.*]] = getelementptr [[T]], %T* [[P]], i64 0, i32 2 +; CGSCC-NEXT: [[A:%.*]] = load i32, i32* [[A_GEP]], align 4 +; CGSCC-NEXT: [[B:%.*]] = load i32, i32* [[B_GEP]], align 4 +; CGSCC-NEXT: [[V:%.*]] = add i32 [[A]], [[B]] +; CGSCC-NEXT: [[CA:%.*]] = musttail call i32 @bar(%T* undef, i32 [[V]]) #[[ATTR5:[0-9]+]] +; CGSCC-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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@caller2b +; MODULE-SAME: (%T* nocapture nofree readonly [[G:%.*]]) #[[ATTR3]] { +; MODULE-NEXT: [[V:%.*]] = call i32 @test2b(%T* nocapture nofree readonly [[G]], i32 undef) #[[ATTR6:[0-9]+]] +; MODULE-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 +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@caller2b +; CGSCC-SAME: (%T* nocapture nofree readonly [[G:%.*]]) #[[ATTR3]] { +; CGSCC-NEXT: [[V:%.*]] = call i32 @test2b(%T* nocapture nofree readonly [[G]], i32 undef) #[[ATTR6:[0-9]+]] +; CGSCC-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 } +; MODULE: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } +; MODULE: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR2]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; MODULE: attributes #[[ATTR3]] = { argmemonly nofree nosync nounwind willreturn } +; MODULE: attributes #[[ATTR4]] = { nofree nosync nounwind readonly willreturn } +; MODULE: attributes #[[ATTR5]] = { nofree nosync nounwind willreturn writeonly } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; CGSCC: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR2]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; CGSCC: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR4]] = { nosync nounwind readonly willreturn } +; CGSCC: attributes #[[ATTR5]] = { nounwind willreturn writeonly } +; CGSCC: 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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; 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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; ArgumentPromotion should preserve the default function address space ; from the data layout. 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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC target triple = "x86_64-pc-windows-msvc" define internal void @callee(i8*) { 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,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 -; 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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; PR 32917 @b = common local_unnamed_addr global i32 0, align 4 @@ -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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@fn2 +; MODULE-SAME: () local_unnamed_addr #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: [[TMP1:%.*]] = load i32, i32* @b, align 4 +; MODULE-NEXT: [[TMP2:%.*]] = sext i32 [[TMP1]] to i64 +; MODULE-NEXT: [[TMP3:%.*]] = inttoptr i64 [[TMP2]] to i32* +; MODULE-NEXT: call fastcc void @fn1(i32* nocapture nofree readonly align 4 [[TMP3]]) #[[ATTR0]] +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@fn2 +; CGSCC-SAME: () local_unnamed_addr #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: [[TMP1:%.*]] = load i32, i32* @b, align 4 +; CGSCC-NEXT: [[TMP2:%.*]] = sext i32 [[TMP1]] to i64 +; CGSCC-NEXT: [[TMP3:%.*]] = inttoptr i64 [[TMP2]] to i32* +; CGSCC-NEXT: call fastcc void @fn1(i32* nocapture nofree nonnull readonly align 4 [[TMP3]]) #[[ATTR1:[0-9]+]] +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@fn1 +; MODULE-SAME: (i32* nocapture nofree nonnull readonly align 4 [[TMP0:%.*]]) unnamed_addr #[[ATTR0]] { +; MODULE-NEXT: [[TMP2:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 -1 +; MODULE-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4 +; MODULE-NEXT: store i32 [[TMP3]], i32* @a, align 4 +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@fn1 +; CGSCC-SAME: (i32* nocapture nofree nonnull readonly align 4 [[TMP0:%.*]]) unnamed_addr #[[ATTR0]] { +; CGSCC-NEXT: [[TMP2:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 -1 +; CGSCC-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4 +; CGSCC-NEXT: store i32 [[TMP3]], i32* @a, align 4 +; CGSCC-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 } +; MODULE: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { nounwind willreturn } +; CGSCC: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR1]] = { nounwind willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll @@ -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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; Fix for PR33641. ArgumentPromotion removed the argument to bar but left the call to ; dbg.value which still used the removed argument. @@ -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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@foo +; MODULE-SAME: () #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: [[TMP:%.*]] = alloca void (i16*)*, align 8 +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@foo +; CGSCC-SAME: () #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: [[TMP:%.*]] = alloca void (i16*)*, align 8 +; CGSCC-NEXT: ret void ; %tmp = alloca %fun_t store %fun_t @bar, %fun_t* %tmp @@ -32,16 +30,11 @@ } 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 +; CGSCC: Function Attrs: nofree nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@bar +; CGSCC-SAME: (i16* nocapture nofree readnone [[P:%.*]]) #[[ATTR1:[0-9]+]] { +; CGSCC-NEXT: call void @llvm.dbg.value(metadata i16* [[P]], metadata [[META3:![0-9]+]], metadata !DIExpression()) #[[ATTR3:[0-9]+]], !dbg [[DBG5:![0-9]+]] +; CGSCC-NEXT: ret void ; call void @llvm.dbg.value(metadata %p_t %p, metadata !4, metadata !5), !dbg !6 ret void @@ -60,25 +53,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 } -;. -; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_OPM: attributes #[[ATTR1:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } +; MODULE: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR1:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR2:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR3]] = { readnone willreturn } +; CGSCC: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR2:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } +; CGSCC: attributes #[[ATTR3]] = { readnone willreturn } ;. -; 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} +; MODULE: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C, file: !1, isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug) +; MODULE: [[META1:![0-9]+]] = !DIFile(filename: "test.c", directory: "") +; MODULE: [[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) +; CGSCC: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C, file: !1, isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug) +; CGSCC: [[META1:![0-9]+]] = !DIFile(filename: "test.c", directory: "") +; CGSCC: [[META2:![0-9]+]] = !{i32 2, !"Debug Info Version", i32 3} +; CGSCC: [[META3]] = !DILocalVariable(name: "p", scope: !4) +; CGSCC: [[META4:![0-9]+]] = distinct !DISubprogram(name: "bar", scope: null, spFlags: DISPFlagDefinition, unit: !0) +; CGSCC: [[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,21 @@ ; 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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC 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 +; MODULE-LABEL: define {{[^@]+}}@caller() { +; MODULE-NEXT: [[X:%.*]] = alloca i32, align 4 +; MODULE-NEXT: store i32 42, i32* [[X]], align 4 +; MODULE-NEXT: [[TMP1:%.*]] = load i32, i32* [[X]], align 4 +; MODULE-NEXT: call void @promote_i32_ptr(i32 [[TMP1]]), !prof [[PROF0:![0-9]+]] +; MODULE-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 -; -; 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 +; CGSCC-LABEL: define {{[^@]+}}@caller() { +; CGSCC-NEXT: call void @promote_i32_ptr(i32 undef), !prof [[PROF0:![0-9]+]] +; CGSCC-NEXT: ret void ; %x = alloca i32 store i32 42, i32* %x @@ -32,26 +24,20 @@ } 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 +; MODULE-LABEL: define {{[^@]+}}@promote_i32_ptr +; MODULE-SAME: (i32 [[TMP0:%.*]]) { +; MODULE-NEXT: [[XP_PRIV:%.*]] = alloca i32, align 4 +; MODULE-NEXT: store i32 [[TMP0]], i32* [[XP_PRIV]], align 4 +; MODULE-NEXT: [[X:%.*]] = load i32, i32* [[XP_PRIV]], align 4 +; MODULE-NEXT: call void @use_i32(i32 [[X]]) +; MODULE-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 +; CGSCC-LABEL: define {{[^@]+}}@promote_i32_ptr +; CGSCC-SAME: (i32 [[TMP0:%.*]]) { +; CGSCC-NEXT: [[XP_PRIV:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: [[X:%.*]] = load i32, i32* [[XP_PRIV]], align 4 +; CGSCC-NEXT: call void @use_i32(i32 42) +; CGSCC-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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; PR17906 ; When we promote two arguments in a single function with different types, @@ -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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@fn +; MODULE-SAME: () #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[TMP0:%.*]] = load i32, i32* @g, align 4, !tbaa [[TBAA0:![0-9]+]] +; MODULE-NEXT: [[CONV1:%.*]] = trunc i32 [[TMP0]] to i8 +; MODULE-NEXT: store i8 [[CONV1]], i8* @d, align 1, !tbaa [[TBAA4:![0-9]+]] +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@fn +; CGSCC-SAME: () #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[TMP0:%.*]] = load i32, i32* @g, align 4, !tbaa [[TBAA0:![0-9]+]] +; CGSCC-NEXT: [[CONV1:%.*]] = trunc i32 [[TMP0]] to i8 +; CGSCC-NEXT: store i8 [[CONV1]], i8* @d, align 1, !tbaa [[TBAA4:![0-9]+]] +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@main +; MODULE-SAME: () #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[TMP0:%.*]] = load i32**, i32*** @e, align 8, !tbaa [[TBAA5:![0-9]+]] +; MODULE-NEXT: store i32* @g, i32** [[TMP0]], align 8, !tbaa [[TBAA5]] +; MODULE-NEXT: [[TMP1:%.*]] = load i32*, i32** @a, align 8, !tbaa [[TBAA5]] +; MODULE-NEXT: store i32 1, i32* [[TMP1]], align 4, !tbaa [[TBAA0]] +; MODULE-NEXT: call fastcc void @fn() #[[ATTR0]] +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@main +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[TMP0:%.*]] = load i32**, i32*** @e, align 8, !tbaa [[TBAA5:![0-9]+]] +; CGSCC-NEXT: store i32* @g, i32** [[TMP0]], align 8, !tbaa [[TBAA5]] +; CGSCC-NEXT: [[TMP1:%.*]] = load i32*, i32** @a, align 8, !tbaa [[TBAA5]] +; CGSCC-NEXT: store i32 1, i32* [[TMP1]], align 4, !tbaa [[TBAA0]] +; CGSCC-NEXT: call fastcc void @fn() #[[ATTR1:[0-9]+]] +; CGSCC-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 } +; MODULE: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { nounwind willreturn } +; CGSCC: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind willreturn } +; CGSCC: 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,57 +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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-windows-msvc" define internal void @add({i32, i32}* %this, i32* sret(i32) %r) { +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@add +; MODULE-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]+]] { +; MODULE-NEXT: [[AP:%.*]] = getelementptr { i32, i32 }, { i32, i32 }* [[THIS]], i32 0, i32 0 +; MODULE-NEXT: [[BP:%.*]] = getelementptr { i32, i32 }, { i32, i32 }* [[THIS]], i32 0, i32 1 +; MODULE-NEXT: [[A:%.*]] = load i32, i32* [[AP]], align 8 +; MODULE-NEXT: [[B:%.*]] = load i32, i32* [[BP]], align 4 +; MODULE-NEXT: [[AB:%.*]] = add i32 [[A]], [[B]] +; MODULE-NEXT: store i32 [[AB]], i32* [[R]], align 4 +; MODULE-NEXT: ret void ; -; 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 -; -; 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 +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@add +; CGSCC-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]+]] { +; CGSCC-NEXT: [[AP:%.*]] = getelementptr { i32, i32 }, { i32, i32 }* [[THIS]], i32 0, i32 0 +; CGSCC-NEXT: [[BP:%.*]] = getelementptr { i32, i32 }, { i32, i32 }* [[THIS]], i32 0, i32 1 +; CGSCC-NEXT: [[A:%.*]] = load i32, i32* [[AP]], align 8 +; CGSCC-NEXT: [[B:%.*]] = load i32, i32* [[BP]], align 4 +; CGSCC-NEXT: [[AB:%.*]] = add i32 [[A]], [[B]] +; CGSCC-NEXT: store i32 [[AB]], i32* [[R]], align 4 +; CGSCC-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 +38,21 @@ } 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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@f +; MODULE-SAME: () #[[ATTR1:[0-9]+]] { +; MODULE-NEXT: [[R:%.*]] = alloca i32, align 4 +; MODULE-NEXT: [[PAIR:%.*]] = alloca { i32, i32 }, align 8 +; MODULE-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]+]] +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@f +; CGSCC-SAME: () #[[ATTR1:[0-9]+]] { +; CGSCC-NEXT: [[R:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: [[PAIR:%.*]] = alloca { i32, i32 }, align 8 +; CGSCC-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]+]] +; CGSCC-NEXT: ret void ; %r = alloca i32 %pair = alloca {i32, i32} @@ -102,11 +61,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 } +; MODULE: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind willreturn } +; MODULE: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: 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,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 -; 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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; PR14710 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" @@ -12,68 +10,48 @@ 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 +; MODULE-LABEL: define {{[^@]+}}@bar +; MODULE-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]]) { +; MODULE-NEXT: [[DATA_PRIV:%.*]] = alloca [[PAIR:%.*]], align 8 +; MODULE-NEXT: [[DATA_PRIV_CAST:%.*]] = bitcast %pair* [[DATA_PRIV]] to i32* +; MODULE-NEXT: store i32 [[TMP0]], i32* [[DATA_PRIV_CAST]], align 4 +; MODULE-NEXT: [[DATA_PRIV_0_1:%.*]] = getelementptr [[PAIR]], %pair* [[DATA_PRIV]], i32 0, i32 1 +; MODULE-NEXT: store i32 [[TMP1]], i32* [[DATA_PRIV_0_1]], align 4 +; MODULE-NEXT: [[TMP3:%.*]] = call i8* @foo(%pair* nonnull dereferenceable(8) [[DATA_PRIV]]) +; MODULE-NEXT: ret void +; +; CGSCC-LABEL: define {{[^@]+}}@bar +; CGSCC-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]]) { +; CGSCC-NEXT: [[DATA_PRIV:%.*]] = alloca [[PAIR:%.*]], align 8 +; CGSCC-NEXT: [[DATA_PRIV_CAST:%.*]] = bitcast %pair* [[DATA_PRIV]] to i32* +; CGSCC-NEXT: store i32 [[TMP0]], i32* [[DATA_PRIV_CAST]], align 8 +; CGSCC-NEXT: [[DATA_PRIV_0_1:%.*]] = getelementptr [[PAIR]], %pair* [[DATA_PRIV]], i32 0, i32 1 +; CGSCC-NEXT: store i32 [[TMP1]], i32* [[DATA_PRIV_0_1]], align 4 +; CGSCC-NEXT: [[TMP3:%.*]] = call i8* @foo(%pair* noundef nonnull align 8 dereferenceable(8) [[DATA_PRIV]]) +; CGSCC-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 +; MODULE-LABEL: define {{[^@]+}}@zed +; MODULE-SAME: (%pair* noalias nocapture nonnull readonly byval([[PAIR:%.*]]) dereferenceable(8) [[DATA:%.*]]) { +; MODULE-NEXT: [[DATA_CAST:%.*]] = bitcast %pair* [[DATA]] to i32* +; MODULE-NEXT: [[TMP1:%.*]] = load i32, i32* [[DATA_CAST]], align 1 +; MODULE-NEXT: [[DATA_0_1:%.*]] = getelementptr [[PAIR]], %pair* [[DATA]], i32 0, i32 1 +; MODULE-NEXT: [[TMP2:%.*]] = load i32, i32* [[DATA_0_1]], align 1 +; MODULE-NEXT: call void @bar(i32 [[TMP1]], i32 [[TMP2]]) +; MODULE-NEXT: ret void +; +; CGSCC-LABEL: define {{[^@]+}}@zed +; CGSCC-SAME: (%pair* noalias nocapture nofree nonnull readonly byval([[PAIR:%.*]]) dereferenceable(8) [[DATA:%.*]]) { +; CGSCC-NEXT: [[DATA_CAST:%.*]] = bitcast %pair* [[DATA]] to i32* +; CGSCC-NEXT: [[TMP1:%.*]] = load i32, i32* [[DATA_CAST]], align 1 +; CGSCC-NEXT: [[DATA_0_1:%.*]] = getelementptr [[PAIR]], %pair* [[DATA]], i32 0, i32 1 +; CGSCC-NEXT: [[TMP2:%.*]] = load i32, i32* [[DATA_0_1]], align 1 +; CGSCC-NEXT: call void @bar(i32 [[TMP1]], i32 [[TMP2]]) +; CGSCC-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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; Unused arguments from variadic functions cannot be eliminated as that changes ; their classiciation according to the SysV amd64 ABI. Clang and other frontends 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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; Should not propagate the result of a weak function. ; PR2411 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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; Don't constant-propagate byval pointers, since they are not pointers! ; PR5038 @@ -14,55 +12,41 @@ ; 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 +; MODULE: Function Attrs: nounwind +; MODULE-LABEL: define {{[^@]+}}@vfu1 +; MODULE-SAME: (i8 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[U_PRIV:%.*]] = alloca [[STRUCT_MYSTR:%.*]], align 8 +; MODULE-NEXT: [[U_PRIV_CAST:%.*]] = bitcast %struct.MYstr* [[U_PRIV]] to i8* +; MODULE-NEXT: store i8 [[TMP0]], i8* [[U_PRIV_CAST]], align 1 +; MODULE-NEXT: [[U_PRIV_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 +; MODULE-NEXT: store i32 [[TMP1]], i32* [[U_PRIV_0_1]], align 4 +; MODULE-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 +; MODULE-NEXT: store i32 99, i32* [[TMP2]], align 4 +; MODULE-NEXT: [[TMP3:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 0 +; MODULE-NEXT: store i8 97, i8* [[TMP3]], align 8 +; MODULE-NEXT: [[L:%.*]] = load i8, i8* [[TMP3]], align 8 +; MODULE-NEXT: call void @use(i8 [[L]]) +; MODULE-NEXT: br label [[RETURN:%.*]] +; MODULE: return: +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nounwind +; CGSCC-LABEL: define {{[^@]+}}@vfu1 +; CGSCC-SAME: (i8 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[U_PRIV:%.*]] = alloca [[STRUCT_MYSTR:%.*]], align 8 +; CGSCC-NEXT: [[U_PRIV_CAST:%.*]] = bitcast %struct.MYstr* [[U_PRIV]] to i8* +; CGSCC-NEXT: store i8 [[TMP0]], i8* [[U_PRIV_CAST]], align 8 +; CGSCC-NEXT: [[U_PRIV_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 +; CGSCC-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 +; CGSCC-NEXT: [[TMP3:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 0 +; CGSCC-NEXT: store i8 97, i8* [[TMP3]], align 8 +; CGSCC-NEXT: [[L:%.*]] = load i8, i8* [[TMP3]], align 8 +; CGSCC-NEXT: call void @use(i8 [[L]]) +; CGSCC-NEXT: br label [[RETURN:%.*]] +; CGSCC: return: +; CGSCC-NEXT: ret void ; entry: %0 = getelementptr %struct.MYstr, %struct.MYstr* %u, i32 0, i32 1 ; [#uses=1] @@ -78,63 +62,39 @@ } 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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@vfu2 +; MODULE-SAME: (i8 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR1:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[U_PRIV:%.*]] = alloca [[STRUCT_MYSTR:%.*]], align 8 +; MODULE-NEXT: [[U_PRIV_CAST:%.*]] = bitcast %struct.MYstr* [[U_PRIV]] to i8* +; MODULE-NEXT: store i8 [[TMP0]], i8* [[U_PRIV_CAST]], align 1 +; MODULE-NEXT: [[U_PRIV_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 +; MODULE-NEXT: store i32 [[TMP1]], i32* [[U_PRIV_0_1]], align 4 +; MODULE-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 +; MODULE-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4 +; MODULE-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 0 +; MODULE-NEXT: [[TMP5:%.*]] = load i8, i8* [[TMP4]], align 8 +; MODULE-NEXT: [[TMP6:%.*]] = zext i8 [[TMP5]] to i32 +; MODULE-NEXT: [[TMP7:%.*]] = add i32 [[TMP6]], [[TMP3]] +; MODULE-NEXT: ret i32 [[TMP7]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@vfu2 +; CGSCC-SAME: (i8 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR1:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[U_PRIV:%.*]] = alloca [[STRUCT_MYSTR:%.*]], align 8 +; CGSCC-NEXT: [[U_PRIV_CAST:%.*]] = bitcast %struct.MYstr* [[U_PRIV]] to i8* +; CGSCC-NEXT: store i8 [[TMP0]], i8* [[U_PRIV_CAST]], align 8 +; CGSCC-NEXT: [[U_PRIV_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 +; CGSCC-NEXT: store i32 [[TMP1]], i32* [[U_PRIV_0_1]], align 4 +; CGSCC-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 +; CGSCC-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4 +; CGSCC-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 0 +; CGSCC-NEXT: [[TMP5:%.*]] = load i8, i8* [[TMP4]], align 8 +; CGSCC-NEXT: [[TMP6:%.*]] = zext i8 [[TMP0]] to i32 +; CGSCC-NEXT: [[TMP7:%.*]] = add i32 [[TMP6]], [[TMP1]] +; CGSCC-NEXT: ret i32 [[TMP7]] ; entry: %0 = getelementptr %struct.MYstr, %struct.MYstr* %u, i32 0, i32 1 ; [#uses=1] @@ -147,49 +107,33 @@ } 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]] +; MODULE: Function Attrs: nounwind +; MODULE-LABEL: define {{[^@]+}}@unions +; MODULE-SAME: () #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[MYSTR_CAST1:%.*]] = bitcast %struct.MYstr* @mystr to i8* +; MODULE-NEXT: [[TMP0:%.*]] = load i8, i8* [[MYSTR_CAST1]], align 8 +; MODULE-NEXT: [[MYSTR_0_12:%.*]] = getelementptr [[STRUCT_MYSTR:%.*]], %struct.MYstr* @mystr, i32 0, i32 1 +; MODULE-NEXT: [[TMP1:%.*]] = load i32, i32* [[MYSTR_0_12]], align 8 +; MODULE-NEXT: call void @vfu1(i8 [[TMP0]], i32 [[TMP1]]) #[[ATTR0]] +; MODULE-NEXT: [[MYSTR_CAST:%.*]] = bitcast %struct.MYstr* @mystr to i8* +; MODULE-NEXT: [[TMP2:%.*]] = load i8, i8* [[MYSTR_CAST]], align 8 +; MODULE-NEXT: [[MYSTR_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* @mystr, i32 0, i32 1 +; MODULE-NEXT: [[TMP3:%.*]] = load i32, i32* [[MYSTR_0_1]], align 8 +; MODULE-NEXT: [[RESULT:%.*]] = call i32 @vfu2(i8 [[TMP2]], i32 [[TMP3]]) #[[ATTR2:[0-9]+]] +; MODULE-NEXT: ret i32 [[RESULT]] +; +; CGSCC: Function Attrs: nounwind +; CGSCC-LABEL: define {{[^@]+}}@unions +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[TMP0:%.*]] = load i8, i8* getelementptr inbounds ([[STRUCT_MYSTR:%.*]], %struct.MYstr* @mystr, i32 0, i32 0), align 8 +; CGSCC-NEXT: call void @vfu1(i8 [[TMP0]], i32 undef) #[[ATTR0]] +; CGSCC-NEXT: [[TMP1:%.*]] = load i8, i8* getelementptr inbounds ([[STRUCT_MYSTR]], %struct.MYstr* @mystr, i32 0, i32 0), align 8 +; CGSCC-NEXT: [[MYSTR_0_12:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* @mystr, i32 0, i32 1 +; CGSCC-NEXT: [[TMP2:%.*]] = load i32, i32* [[MYSTR_0_12]], align 8 +; CGSCC-NEXT: [[RESULT:%.*]] = call i32 @vfu2(i8 [[TMP1]], i32 [[TMP2]]) #[[ATTR0]] +; CGSCC-NEXT: ret i32 [[RESULT]] ; entry: call void @vfu1(%struct.MYstr* byval(%struct.MYstr) align 4 @mystr) nounwind @@ -198,70 +142,42 @@ } 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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@vfu2_v2 +; MODULE-SAME: (i8 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[U_PRIV:%.*]] = alloca [[STRUCT_MYSTR:%.*]], align 8 +; MODULE-NEXT: [[U_PRIV_CAST:%.*]] = bitcast %struct.MYstr* [[U_PRIV]] to i8* +; MODULE-NEXT: store i8 [[TMP0]], i8* [[U_PRIV_CAST]], align 1 +; MODULE-NEXT: [[U_PRIV_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 +; MODULE-NEXT: store i32 [[TMP1]], i32* [[U_PRIV_0_1]], align 4 +; MODULE-NEXT: [[Z:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 +; MODULE-NEXT: store i32 99, i32* [[Z]], align 4 +; MODULE-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 +; MODULE-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4 +; MODULE-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 0 +; MODULE-NEXT: [[TMP5:%.*]] = load i8, i8* [[TMP4]], align 8 +; MODULE-NEXT: [[TMP6:%.*]] = zext i8 [[TMP5]] to i32 +; MODULE-NEXT: [[TMP7:%.*]] = add i32 [[TMP6]], [[TMP3]] +; MODULE-NEXT: ret i32 [[TMP7]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@vfu2_v2 +; CGSCC-SAME: (i8 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[U_PRIV:%.*]] = alloca [[STRUCT_MYSTR:%.*]], align 8 +; CGSCC-NEXT: [[U_PRIV_CAST:%.*]] = bitcast %struct.MYstr* [[U_PRIV]] to i8* +; CGSCC-NEXT: [[U_PRIV_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 +; CGSCC-NEXT: store i32 0, i32* [[U_PRIV_0_1]], align 4 +; CGSCC-NEXT: [[Z:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 +; CGSCC-NEXT: store i32 99, i32* [[Z]], align 4 +; CGSCC-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1 +; CGSCC-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4 +; CGSCC-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 0 +; CGSCC-NEXT: [[TMP5:%.*]] = load i8, i8* [[TMP4]], align 8 +; CGSCC-NEXT: [[TMP6:%.*]] = zext i8 0 to i32 +; CGSCC-NEXT: [[TMP7:%.*]] = add i32 0, [[TMP3]] +; CGSCC-NEXT: ret i32 [[TMP7]] ; entry: %z = getelementptr %struct.MYstr, %struct.MYstr* %u, i32 0, i32 1 @@ -276,45 +192,29 @@ } 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]] +; MODULE: Function Attrs: nounwind +; MODULE-LABEL: define {{[^@]+}}@unions_v2 +; MODULE-SAME: () #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[MYSTR_CAST1:%.*]] = bitcast %struct.MYstr* @mystr to i8* +; MODULE-NEXT: [[TMP0:%.*]] = load i8, i8* [[MYSTR_CAST1]], align 8 +; MODULE-NEXT: [[MYSTR_0_12:%.*]] = getelementptr [[STRUCT_MYSTR:%.*]], %struct.MYstr* @mystr, i32 0, i32 1 +; MODULE-NEXT: [[TMP1:%.*]] = load i32, i32* [[MYSTR_0_12]], align 8 +; MODULE-NEXT: call void @vfu1(i8 [[TMP0]], i32 [[TMP1]]) #[[ATTR0]] +; MODULE-NEXT: [[MYSTR_CAST:%.*]] = bitcast %struct.MYstr* @mystr to i8* +; MODULE-NEXT: [[TMP2:%.*]] = load i8, i8* [[MYSTR_CAST]], align 8 +; MODULE-NEXT: [[MYSTR_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* @mystr, i32 0, i32 1 +; MODULE-NEXT: [[TMP3:%.*]] = load i32, i32* [[MYSTR_0_1]], align 8 +; MODULE-NEXT: [[RESULT:%.*]] = call i32 @vfu2_v2(i8 [[TMP2]], i32 [[TMP3]]) #[[ATTR2]] +; MODULE-NEXT: ret i32 [[RESULT]] +; +; CGSCC: Function Attrs: nounwind +; CGSCC-LABEL: define {{[^@]+}}@unions_v2 +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: call void @vfu1(i8 noundef 0, i32 undef) #[[ATTR0]] +; CGSCC-NEXT: [[RESULT:%.*]] = call i32 @vfu2_v2(i8 undef, i32 undef) #[[ATTR0]] +; CGSCC-NEXT: ret i32 [[RESULT]] ; entry: call void @vfu1(%struct.MYstr* byval(%struct.MYstr) align 4 @mystr) nounwind @@ -322,13 +222,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 } +; MODULE: attributes #[[ATTR0]] = { nounwind } +; MODULE: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind readonly willreturn } +; MODULE: attributes #[[ATTR2]] = { nounwind readonly } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nounwind } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR0]] = { nounwind } +; CGSCC: 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,27 +1,24 @@ ; 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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" define i64 @fn2() { +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@fn2 +; MODULE-SAME: () #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: ret i64 poison ; -; 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 -; -; 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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@fn2 +; CGSCC-SAME: () #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[CONV:%.*]] = sext i32 undef to i64 +; CGSCC-NEXT: [[DIV:%.*]] = sdiv i64 8, 0 +; CGSCC-NEXT: ret i64 poison ; entry: %conv = sext i32 undef to i64 @@ -31,40 +28,21 @@ } define i64 @fn2b(i32 %arg) { +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@fn2b +; MODULE-SAME: (i32 [[ARG:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[CONV:%.*]] = sext i32 [[ARG]] to i64 +; MODULE-NEXT: [[DIV:%.*]] = sdiv i64 8, [[CONV]] +; MODULE-NEXT: ret i64 [[DIV]] ; -; 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]] -; -; 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]] +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@fn2b +; CGSCC-SAME: (i32 [[ARG:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[CONV:%.*]] = sext i32 [[ARG]] to i64 +; CGSCC-NEXT: [[DIV:%.*]] = sdiv i64 8, [[CONV]] +; CGSCC-NEXT: ret i64 [[DIV]] ; entry: %conv = sext i32 %arg to i64 @@ -74,24 +52,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@fn2c +; MODULE-SAME: () #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-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 -; -; 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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@fn2c +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[CONV:%.*]] = sext i32 undef to i64 +; CGSCC-NEXT: ret i64 42 ; entry: %conv = sext i32 undef to i64 @@ -101,23 +73,11 @@ } define internal i64 @fn1(i64 %p1) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fn1 -; IS__TUNIT_OPM-SAME: (i64 returned [[P1:%.*]]) #[[ATTR0]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: ret i64 [[P1]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@fn1 -; IS__CGSCC_OPM-SAME: (i64 returned [[P1:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: ret i64 [[P1]] -; -; IS__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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@fn1 +; CGSCC-SAME: (i64 [[P1:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: ret i64 undef ; entry: %tobool = icmp ne i64 %p1, 0 @@ -125,10 +85,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 } +; MODULE: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: 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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC 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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind +; MODULE-LABEL: define {{[^@]+}}@fn2 +; MODULE-SAME: (i32* nocapture nofree [[P:%.*]], i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: br label [[IF_END:%.*]] +; MODULE: for.cond1: +; MODULE-NEXT: br i1 [[C]], label [[IF_END]], label [[EXIT:%.*]] +; MODULE: if.end: +; MODULE-NEXT: [[E_2:%.*]] = phi i32* [ [[P]], [[ENTRY:%.*]] ], [ null, [[FOR_COND1:%.*]] ] +; MODULE-NEXT: [[TMP0:%.*]] = load i32, i32* [[E_2]], align 4 +; MODULE-NEXT: store i32 [[TMP0]], i32* [[P]], align 4 +; MODULE-NEXT: br label [[FOR_COND1]] +; MODULE: exit: +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind +; CGSCC-LABEL: define {{[^@]+}}@fn2 +; CGSCC-SAME: (i32* nocapture nofree nonnull align 4 dereferenceable(4) [[P:%.*]], i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br label [[IF_END:%.*]] +; CGSCC: for.cond1: +; CGSCC-NEXT: br i1 [[C]], label [[IF_END]], label [[EXIT:%.*]] +; CGSCC: if.end: +; CGSCC-NEXT: [[E_2:%.*]] = phi i32* [ [[P]], [[ENTRY:%.*]] ], [ null, [[FOR_COND1:%.*]] ] +; CGSCC-NEXT: [[TMP0:%.*]] = load i32, i32* [[E_2]], align 4 +; CGSCC-NEXT: store i32 [[TMP0]], i32* [[P]], align 4 +; CGSCC-NEXT: br label [[FOR_COND1]] +; CGSCC: exit: +; CGSCC-NEXT: ret void ; entry: br label %if.end @@ -87,23 +52,11 @@ } define internal i32 @fn1(i32 %p1) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fn1 -; IS__TUNIT_OPM-SAME: (i32 returned [[P1:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: ret i32 [[P1]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@fn1 -; IS__CGSCC_OPM-SAME: (i32 returned [[P1:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: ret i32 [[P1]] -; -; IS__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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@fn1 +; CGSCC-SAME: (i32 [[P1:%.*]]) #[[ATTR1:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: ret i32 undef ; entry: %tobool = icmp ne i32 %p1, 0 @@ -112,68 +65,35 @@ } 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 +; MODULE: Function Attrs: nofree nosync nounwind null_pointer_is_valid +; MODULE-LABEL: define {{[^@]+}}@fn_no_null_opt +; MODULE-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i1 [[C:%.*]]) #[[ATTR1:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: br label [[IF_END:%.*]] +; MODULE: for.cond1: +; MODULE-NEXT: br i1 [[C]], label [[IF_END]], label [[EXIT:%.*]] +; MODULE: if.end: +; MODULE-NEXT: [[E_2:%.*]] = phi i32* [ undef, [[ENTRY:%.*]] ], [ null, [[FOR_COND1:%.*]] ] +; MODULE-NEXT: [[TMP0:%.*]] = load i32, i32* null, align 4 +; MODULE-NEXT: store i32 [[TMP0]], i32* [[P]], align 4 +; MODULE-NEXT: br label [[FOR_COND1]] +; MODULE: exit: +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid +; CGSCC-LABEL: define {{[^@]+}}@fn_no_null_opt +; CGSCC-SAME: (i32* nocapture nofree writeonly align 4 dereferenceable_or_null(4) [[P:%.*]], i1 [[C:%.*]]) #[[ATTR2:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br label [[IF_END:%.*]] +; CGSCC: for.cond1: +; CGSCC-NEXT: br i1 [[C]], label [[IF_END]], label [[EXIT:%.*]] +; CGSCC: if.end: +; CGSCC-NEXT: [[E_2:%.*]] = phi i32* [ undef, [[ENTRY:%.*]] ], [ null, [[FOR_COND1:%.*]] ] +; CGSCC-NEXT: [[TMP0:%.*]] = load i32, i32* null, align 4294967296 +; CGSCC-NEXT: store i32 [[TMP0]], i32* [[P]], align 4 +; CGSCC-NEXT: br label [[FOR_COND1]] +; CGSCC: exit: +; CGSCC-NEXT: ret void ; entry: br label %if.end @@ -192,23 +112,11 @@ } define internal i32 @fn0(i32 %p1) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fn0 -; IS__TUNIT_OPM-SAME: (i32 returned [[P1:%.*]]) #[[ATTR1]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: ret i32 [[P1]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@fn0 -; IS__CGSCC_OPM-SAME: (i32 returned [[P1:%.*]]) #[[ATTR1]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: ret i32 [[P1]] -; -; IS__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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@fn0 +; CGSCC-SAME: (i32 [[P1:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: ret i32 undef ; entry: %tobool = icmp ne i32 %p1, 0 @@ -216,15 +124,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 } +; MODULE: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind } +; CGSCC: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: 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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC %struct.wobble = type { i32 } %struct.zot = type { %struct.wobble, %struct.wobble, %struct.wobble } @@ -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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@widget +; MODULE-SAME: (<8 x i32> [[ARG:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: bb: +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@widget +; CGSCC-SAME: (<8 x i32> [[ARG:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: bb: +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@baz +; MODULE-SAME: (<8 x i32> [[ARG:%.*]]) local_unnamed_addr #[[ATTR0]] { +; MODULE-NEXT: bb: +; MODULE-NEXT: [[TMP1:%.*]] = extractvalue [[STRUCT_ZOT:%.*]] undef, 0, 0 +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@baz +; CGSCC-SAME: (<8 x i32> [[ARG:%.*]]) local_unnamed_addr #[[ATTR0]] { +; CGSCC-NEXT: bb: +; CGSCC-NEXT: [[TMP1:%.*]] = extractvalue [[STRUCT_ZOT:%.*]] undef, 0, 0 +; CGSCC-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 } +; MODULE: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: 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,20 +1,15 @@ ; 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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; The original C source looked like this: -; ; long long a101, b101, e101; ; volatile long c101; ; int d101; -; ; static inline int bar(p1, p2) ; { ; return 0; ; } -; ; void foo(unsigned p1) ; { ; long long *f = &b101, *g = &e101; @@ -22,12 +17,9 @@ ; (void)((*f |= a101) - (*g = bar(d101))); ; c101 = (*f |= a101 &= p1) == d101; ; } -; ; When compiled with Clang it gives a warning ; warning: too few arguments in call to 'bar' -; ; This ll reproducer has been reduced to only include tha call. -; ; Note that -lint will report this as UB, but it passes -verify. ; This test is just to verify that we do not crash/assert due to mismatch in @@ -36,74 +28,63 @@ ; FIXME we should recognize this as UB and make it an unreachable. define dso_local i16 @foo(i16 %a) { -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@foo -; NOT_CGSCC_NPM-SAME: (i16 [[A:%.*]]) { -; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar to i16 (i16)*)(i16 [[A]]) -; NOT_CGSCC_NPM-NEXT: ret i16 [[CALL]] +; MODULE-LABEL: define {{[^@]+}}@foo +; MODULE-SAME: (i16 [[A:%.*]]) { +; MODULE-NEXT: [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar to i16 (i16)*)(i16 [[A]]) +; MODULE-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]] +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone +; CGSCC-LABEL: define {{[^@]+}}@foo +; CGSCC-SAME: (i16 [[A:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar to i16 (i16)*)(i16 [[A]]) +; CGSCC-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 -; -; 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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@bar +; MODULE-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@bar +; CGSCC-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]]) #[[ATTR1:[0-9]+]] { +; CGSCC-NEXT: ret i16 0 ; ret i16 0 } define dso_local i16 @foo2(i16 %a) { -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@foo2 -; NOT_CGSCC_NPM-SAME: (i16 [[A:%.*]]) { -; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar2 to i16 (i16)*)(i16 [[A]]) -; NOT_CGSCC_NPM-NEXT: ret i16 [[CALL]] +; MODULE-LABEL: define {{[^@]+}}@foo2 +; MODULE-SAME: (i16 [[A:%.*]]) { +; MODULE-NEXT: [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar2 to i16 (i16)*)(i16 [[A]]) +; MODULE-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]] +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone +; CGSCC-LABEL: define {{[^@]+}}@foo2 +; CGSCC-SAME: (i16 [[A:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar2 to i16 (i16)*)(i16 [[A]]) +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@bar2 +; MODULE-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[A:%.*]] = add i16 [[P1]], [[P2]] +; MODULE-NEXT: ret i16 [[A]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@bar2 +; CGSCC-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: [[A:%.*]] = add i16 [[P1]], [[P2]] +; CGSCC-NEXT: ret i16 [[A]] ; %a = add i16 %p1, %p2 ret i16 %a @@ -116,18 +97,18 @@ ; been provided), define dso_local i16 @vararg_tests(i16 %a) { -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@vararg_tests -; NOT_CGSCC_NPM-SAME: (i16 [[A:%.*]]) { -; NOT_CGSCC_NPM-NEXT: [[CALL2:%.*]] = call i16 bitcast (i16 (i16, i16, ...)* @vararg_no_prop to i16 (i16)*)(i16 noundef 7) -; NOT_CGSCC_NPM-NEXT: [[ADD:%.*]] = add i16 7, [[CALL2]] -; NOT_CGSCC_NPM-NEXT: ret i16 [[ADD]] -; -; 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]] +; MODULE-LABEL: define {{[^@]+}}@vararg_tests +; MODULE-SAME: (i16 [[A:%.*]]) { +; MODULE-NEXT: [[CALL2:%.*]] = call i16 bitcast (i16 (i16, i16, ...)* @vararg_no_prop to i16 (i16)*)(i16 noundef 7) +; MODULE-NEXT: [[ADD:%.*]] = add i16 7, [[CALL2]] +; MODULE-NEXT: ret i16 [[ADD]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone +; CGSCC-LABEL: define {{[^@]+}}@vararg_tests +; CGSCC-SAME: (i16 [[A:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[CALL2:%.*]] = call i16 bitcast (i16 (i16, i16, ...)* @vararg_no_prop to i16 (i16)*)(i16 noundef 7) +; CGSCC-NEXT: [[ADD:%.*]] = add i16 7, [[CALL2]] +; CGSCC-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 +117,31 @@ } 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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@vararg_prop +; CGSCC-SAME: (i16 [[P1:%.*]], ...) #[[ATTR1]] { +; CGSCC-NEXT: ret i16 undef ; ret i16 %p1 } define internal i16 @vararg_no_prop(i16 %p1, i16 %p2, ...) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@vararg_no_prop -; IS__TUNIT____-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]], ...) #[[ATTR0]] { -; IS__TUNIT____-NEXT: ret i16 7 -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@vararg_no_prop -; IS__CGSCC_OPM-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]], ...) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: ret i16 7 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@vararg_no_prop +; MODULE-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]], ...) #[[ATTR0]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@vararg_no_prop +; CGSCC-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]], ...) #[[ATTR1]] { +; CGSCC-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 } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone } +; CGSCC: 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,53 +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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; This test is just to verify that we do not crash/assert due to mismatch in ; argument type between the caller and callee. define dso_local i16 @foo(i16 %a) { -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@foo -; NOT_CGSCC_NPM-SAME: (i16 [[A:%.*]]) { -; 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]] +; MODULE-LABEL: define {{[^@]+}}@foo +; MODULE-SAME: (i16 [[A:%.*]]) { +; MODULE-NEXT: [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar to i16 (i16, i32)*)(i16 [[A]], i32 7) +; MODULE-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]] +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone +; CGSCC-LABEL: define {{[^@]+}}@foo +; CGSCC-SAME: (i16 [[A:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar to i16 (i16, i32)*)(i16 [[A]], i32 7) +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@bar +; MODULE-SAME: (i16 [[P1:%.*]], i16 returned [[P2:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-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]] +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@bar +; CGSCC-SAME: (i16 [[P1:%.*]], i16 returned [[P2:%.*]]) #[[ATTR1:[0-9]+]] { +; CGSCC-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 } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone } +; CGSCC: 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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; 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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@baz +; MODULE-SAME: () #[[ATTR0:[0-9]+]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@baz +; CGSCC-SAME: () #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: ret i32 10 ; ret i32 10 } @@ -27,7 +25,6 @@ ; CHECK-LABEL: define {{[^@]+}}@foo() { ; CHECK-NEXT: ret i32 10 ; - %val = call i32 @baz() ret i32 %val } @@ -37,12 +34,11 @@ ; CHECK-NEXT: [[VAL:%.*]] = call i32 @foo() ; CHECK-NEXT: ret i32 [[VAL]] ; - %val = call i32 @foo() ret i32 %val } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: 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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; PR5569 ; IPSCCP should prove that the blocks are dead and delete them, and @@ -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*)] +; MODULE: @[[CODE:[a-zA-Z0-9_$"\\.-]+]] = global [5 x i32] [i32 0, i32 0, i32 0, i32 0, i32 1], align 4 +; MODULE: @[[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:%.*]])] +; CGSCC: @[[CODE:[a-zA-Z0-9_$"\\.-]+]] = global [5 x i32] [i32 0, i32 0, i32 0, i32 0, i32 1], align 4 +; CGSCC: @[[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 +; CGSCC: Function Attrs: nounwind readnone +; CGSCC-LABEL: define {{[^@]+}}@foo +; CGSCC-SAME: (i32 [[X:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[B:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: store volatile i32 -1, i32* [[B]], align 4 +; CGSCC-NEXT: ret void ; entry: %b = alloca i32, align 4 ; [#uses=1] @@ -34,37 +32,19 @@ } 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] +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone +; CGSCC-LABEL: define {{[^@]+}}@bar +; CGSCC-SAME: () #[[ATTR1:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br label [[INDIRECTGOTO:%.*]] +; CGSCC: lab0: +; CGSCC-NEXT: [[INDVAR_NEXT:%.*]] = add i32 [[INDVAR:%.*]], 1 +; CGSCC-NEXT: br label [[INDIRECTGOTO]] +; CGSCC: end: +; CGSCC-NEXT: ret void +; CGSCC: indirectgoto: +; CGSCC-NEXT: [[INDVAR]] = phi i32 [ [[INDVAR_NEXT]], [[LAB0:%.*]] ], [ 0, [[ENTRY:%.*]] ] +; CGSCC-NEXT: indirectbr i8* undef, [label [[LAB0]], label %end] ; entry: br label %indirectgoto @@ -86,29 +66,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@main +; MODULE-SAME: () #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@main +; CGSCC-SAME: () #[[ATTR2:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: ret i32 0 ; entry: ret i32 0 } ;. -; IS__TUNIT____: 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 } +; MODULE: attributes #[[ATTR0]] = { nofree 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 } +; CGSCC: attributes #[[ATTR0]] = { nounwind readnone } +; CGSCC: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone } +; CGSCC: 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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC 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 +; CGSCC-LABEL: define {{[^@]+}}@foo +; CGSCC-SAME: (i32 [[X:%.*]]) { +; CGSCC-NEXT: call void @foo(i32 [[X]]) +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@bar +; MODULE-SAME: () #[[ATTR0:[0-9]+]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@bar +; CGSCC-SAME: () #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: ret void ; ret void } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: 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,69 +1,66 @@ ; 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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC 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 +; MODULE: Function Attrs: nofree noreturn nosync nounwind readnone +; MODULE-LABEL: define {{[^@]+}}@test +; MODULE-SAME: (i32 signext [[N:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: unreachable +; MODULE: if.then: +; MODULE-NEXT: unreachable +; MODULE: if.end: +; MODULE-NEXT: unreachable +; MODULE: if.then2: +; MODULE-NEXT: unreachable +; MODULE: if.end4: +; MODULE-NEXT: unreachable +; MODULE: if.then9: +; MODULE-NEXT: unreachable +; MODULE: if.then12: +; MODULE-NEXT: unreachable +; MODULE: if.else14: +; MODULE-NEXT: unreachable +; MODULE: do.body: +; MODULE-NEXT: unreachable +; MODULE: if.then33: +; MODULE-NEXT: unreachable +; MODULE: cond.false.i28: +; MODULE-NEXT: unreachable +; MODULE: _ZN5boost4math4signIgEEiRKT_.exit30: +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind readnone +; CGSCC-LABEL: define {{[^@]+}}@test +; CGSCC-SAME: (i32 signext [[N:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: unreachable +; CGSCC: if.then: +; CGSCC-NEXT: unreachable +; CGSCC: if.end: +; CGSCC-NEXT: unreachable +; CGSCC: if.then2: +; CGSCC-NEXT: unreachable +; CGSCC: if.end4: +; CGSCC-NEXT: unreachable +; CGSCC: if.then9: +; CGSCC-NEXT: unreachable +; CGSCC: if.then12: +; CGSCC-NEXT: unreachable +; CGSCC: if.else14: +; CGSCC-NEXT: unreachable +; CGSCC: do.body: +; CGSCC-NEXT: unreachable +; CGSCC: if.then33: +; CGSCC-NEXT: unreachable +; CGSCC: cond.false.i28: +; CGSCC-NEXT: unreachable +; CGSCC: _ZN5boost4math4signIgEEiRKT_.exit30: +; CGSCC-NEXT: unreachable ; - entry: br i1 undef, label %if.then, label %if.end @@ -109,7 +106,7 @@ } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noreturn nosync nounwind readnone } +; MODULE: attributes #[[ATTR0]] = { nofree noreturn nosync nounwind readnone } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse noreturn nosync nounwind readnone } +; CGSCC: 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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC @_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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@_Z7test1f1v +; MODULE-SAME: () #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: br label [[IF_END:%.*]] +; MODULE: if.then: +; MODULE-NEXT: unreachable +; MODULE: if.end: +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@_Z7test1f1v +; CGSCC-SAME: () #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br label [[IF_END:%.*]] +; CGSCC: if.then: +; CGSCC-NEXT: unreachable +; CGSCC: if.end: +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@_Z7test1f2v +; MODULE-SAME: () #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@_Z7test1f2v +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: ret i32 42 ; entry: %tmp = load i32, i32* @_ZL6test1g, align 4 ret i32 %tmp } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: 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,16 +1,11 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=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 -; -; +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; /---------------------------------------| ; | /----------------------|----| ; | | /-----| | ; V V V | | ; void broker(int (*cb0)(int), int (*cb1)(int), int (*cb2)(int), int, int); -; ; static int cb0(int zero) { ; return zero; ; } @@ -27,7 +22,6 @@ ; static int cb4(int unknown) { ; return unknown; ; } -; ; void foo() { ; cb0(0); ; cb3(1); @@ -36,55 +30,54 @@ ; broker(cb3, cb2, cb3, 0, 1); ; broker(cb4, cb4, cb4, 0, 1); ; } -; 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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@cb0 +; MODULE-SAME: (i32 [[ZERO:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: ret i32 0 +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@cb0 +; CGSCC-SAME: (i32 [[ZERO:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@cb1 +; MODULE-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: ret i32 [[UNKNOWN]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@cb1 +; CGSCC-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@cb2 +; MODULE-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: ret i32 [[UNKNOWN]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@cb2 +; CGSCC-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: ret i32 [[UNKNOWN]] ; entry: %call = call i32 @cb0(i32 0) @@ -92,34 +85,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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@cb3 +; MODULE-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: ret i32 [[UNKNOWN]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@cb3 +; CGSCC-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@cb4 +; MODULE-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: ret i32 [[UNKNOWN]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@cb4 +; CGSCC-SAME: (i32 noundef returned [[UNKNOWN:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: ret i32 [[UNKNOWN]] ; entry: ret i32 %unknown @@ -151,9 +144,9 @@ !2 = !{i64 2, i64 3, i1 false} !3 = !{!0, !2, !1} ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: 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,78 +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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; PR36485 ; musttail call result can't be replaced with a constant, unless the call can be removed declare i32 @external() define i8* @start(i8 %v) { +; MODULE-LABEL: define {{[^@]+}}@start +; MODULE-SAME: (i8 [[V:%.*]]) { +; MODULE-NEXT: [[C1:%.*]] = icmp eq i8 [[V]], 0 +; MODULE-NEXT: br i1 [[C1]], label [[TRUE:%.*]], label [[FALSE:%.*]] +; MODULE: true: +; MODULE-NEXT: [[CA:%.*]] = musttail call i8* @side_effects(i8 undef) +; MODULE-NEXT: ret i8* [[CA]] +; MODULE: false: +; MODULE-NEXT: [[C2:%.*]] = icmp eq i8 [[V]], 1 +; MODULE-NEXT: br i1 [[C2]], label [[C2_TRUE:%.*]], label [[C2_FALSE:%.*]] +; MODULE: c2_true: +; MODULE-NEXT: ret i8* null +; MODULE: c2_false: +; MODULE-NEXT: [[CA2:%.*]] = musttail call i8* @dont_zap_me(i8 undef) +; MODULE-NEXT: ret i8* [[CA2]] ; -; 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]] -; -; 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]] +; CGSCC-LABEL: define {{[^@]+}}@start +; CGSCC-SAME: (i8 [[V:%.*]]) { +; CGSCC-NEXT: [[C1:%.*]] = icmp eq i8 [[V]], 0 +; CGSCC-NEXT: br i1 [[C1]], label [[TRUE:%.*]], label [[FALSE:%.*]] +; CGSCC: true: +; CGSCC-NEXT: [[CA:%.*]] = musttail call i8* @side_effects(i8 undef) +; CGSCC-NEXT: ret i8* [[CA]] +; CGSCC: false: +; CGSCC-NEXT: [[C2:%.*]] = icmp eq i8 [[V]], 1 +; CGSCC-NEXT: br i1 [[C2]], label [[C2_TRUE:%.*]], label [[C2_FALSE:%.*]] +; CGSCC: c2_true: +; CGSCC-NEXT: ret i8* undef +; CGSCC: c2_false: +; CGSCC-NEXT: [[CA2:%.*]] = musttail call i8* @dont_zap_me(i8 undef) +; CGSCC-NEXT: ret i8* [[CA2]] ; %c1 = icmp eq i8 %v, 0 br i1 %c1, label %true, label %false @@ -92,17 +57,11 @@ } 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 +76,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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@no_side_effects +; CGSCC-SAME: (i8 [[V:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: ret i8* undef ; ret i8* null } @@ -135,5 +94,5 @@ ret i8* null } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: 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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32" target triple = "i686-pc-windows-msvc19.0.24215" 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,24 +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=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 -; +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; void bar(int, float, double); -; ; void foo(int N) { ; float p = 3; ; double q = 5; ; N = 7; -; ; #pragma omp parallel for firstprivate(q) ; for (int i = 2; i < N; i++) { ; bar(i, p, q); ; } ; } -; ; Verify the constant value of q is propagated into the outlined function. -; target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" %struct.ident_t = type { i32, i32, i32, i32, i8* } @@ -33,49 +26,27 @@ ; 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 +; MODULE-LABEL: define {{[^@]+}}@foo +; MODULE-SAME: (i32 [[N:%.*]]) { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4 +; MODULE-NEXT: [[P:%.*]] = alloca float, align 4 +; MODULE-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4 +; MODULE-NEXT: store float 3.000000e+00, float* [[P]], align 4 +; MODULE-NEXT: store i32 7, i32* [[N_ADDR]], align 4 +; MODULE-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) +; MODULE-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 +; CGSCC-LABEL: define {{[^@]+}}@foo +; CGSCC-SAME: (i32 [[N:%.*]]) { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: [[P:%.*]] = alloca float, align 4 +; CGSCC-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4 +; CGSCC-NEXT: store float 3.000000e+00, float* [[P]], align 4 +; CGSCC-NEXT: store i32 7, i32* [[N_ADDR]], align 4 +; CGSCC-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) +; CGSCC-NEXT: ret void ; entry: %N.addr = alloca i32, align 4 @@ -88,127 +59,66 @@ } 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,26 +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 -; +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; #include -; ; void *GlobalVPtr; -; ; static void *foo(void *arg) { return arg; } ; static void *bar(void *arg) { return arg; } -; ; int main() { ; pthread_t thread; ; pthread_create(&thread, NULL, foo, NULL); ; pthread_create(&thread, NULL, bar, &GlobalVPtr); ; return 0; ; } -; ; Verify the constant values NULL and &GlobalVPtr are propagated into foo and ; bar, respectively. -; target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" %union.pthread_attr_t = type { i64, [48 x i8] } @@ -34,27 +26,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 +; MODULE-LABEL: define {{[^@]+}}@main() { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[ALLOC1:%.*]] = alloca i8, align 8 +; MODULE-NEXT: [[ALLOC2:%.*]] = alloca i8, align 8 +; MODULE-NEXT: [[THREAD:%.*]] = alloca i64, align 8 +; MODULE-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) +; MODULE-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) +; MODULE-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]]) +; MODULE-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]]) +; MODULE-NEXT: ret i32 0 +; +; CGSCC-LABEL: define {{[^@]+}}@main() { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[ALLOC1:%.*]] = alloca i8, align 8 +; CGSCC-NEXT: [[ALLOC2:%.*]] = alloca i8, align 8 +; CGSCC-NEXT: [[THREAD:%.*]] = alloca i64, align 8 +; 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) +; 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*)) +; 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]]) +; 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]]) +; CGSCC-NEXT: ret i32 0 ; entry: %alloc1 = alloca i8, align 8 @@ -70,68 +62,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@foo +; MODULE-SAME: (i8* noalias nocapture nofree readnone align 4294967296 [[ARG:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: ret i8* null +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@foo +; CGSCC-SAME: (i8* noalias nocapture nofree readnone align 4294967296 [[ARG:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-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*) +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@bar +; MODULE-SAME: (i8* noalias nocapture nofree nonnull readnone align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: ret i8* bitcast (i8** @GlobalVPtr to i8*) +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@bar +; CGSCC-SAME: (i8* noalias nocapture nofree nonnull readnone align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@baz +; MODULE-SAME: (i8* noalias nofree noundef nonnull readnone returned align 8 dereferenceable(1) "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: ret i8* [[ARG]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@baz +; CGSCC-SAME: (i8* noalias nofree noundef nonnull readnone returned align 8 dereferenceable(1) "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@buz +; MODULE-SAME: (i8* noalias nofree noundef nonnull readnone returned align 8 dereferenceable(1) "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: ret i8* [[ARG]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@buz +; CGSCC-SAME: (i8* noalias nofree noundef nonnull readnone returned align 8 dereferenceable(1) "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: ret i8* [[ARG]] ; entry: ret i8* %arg @@ -140,9 +132,9 @@ !1 = !{i64 2, i64 3, i1 false} !0 = !{!1} ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: 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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; 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 +; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@foo +; CGSCC-SAME: () #[[ATTR0:[0-9]+]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@bar +; MODULE-SAME: () #[[ATTR0:[0-9]+]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@bar +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: unreachable ; call i32 @foo( i32 17 ) ; :1 [#uses=0] ret void } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noreturn nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR0]] = { nofree noreturn nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; CGSCC: 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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; PR5596 ; IPSCCP should propagate the 0 argument, eliminate the switch, and propagate @@ -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 +; MODULE: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@main +; MODULE-SAME: () #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@main +; CGSCC-SAME: () #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@wwrite +; CGSCC-SAME: () #[[ATTR1:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: switch i64 0, label [[SW_DEFAULT:%.*]] [ +; CGSCC-NEXT: i64 3, label [[RETURN:%.*]] +; CGSCC-NEXT: i64 10, label [[RETURN]] +; CGSCC-NEXT: ] +; CGSCC: sw.default: +; CGSCC-NEXT: ret i32 undef +; CGSCC: return: +; CGSCC-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 } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/return-argument.ll b/llvm/test/Transforms/Attributor/IPConstantProp/return-argument.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/return-argument.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/return-argument.ll @@ -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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ;; 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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@incdec +; MODULE-SAME: (i1 [[C:%.*]], i32* noalias nofree noundef nonnull returned align 4 dereferenceable(4) "no-capture-maybe-returned" [[V:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: [[X:%.*]] = load i32, i32* [[V]], align 4 +; MODULE-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; MODULE: T: +; MODULE-NEXT: [[X1:%.*]] = add i32 [[X]], 1 +; MODULE-NEXT: store i32 [[X1]], i32* [[V]], align 4 +; MODULE-NEXT: ret i32* [[V]] +; MODULE: F: +; MODULE-NEXT: [[X2:%.*]] = sub i32 [[X]], 1 +; MODULE-NEXT: store i32 [[X2]], i32* [[V]], align 4 +; MODULE-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 +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@incdec +; CGSCC-SAME: (i1 [[C:%.*]], i32* noalias nofree noundef nonnull align 4 dereferenceable(4) "no-capture-maybe-returned" [[V:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: [[X:%.*]] = load i32, i32* [[V]], align 4 +; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; CGSCC: T: +; CGSCC-NEXT: [[X1:%.*]] = add i32 [[X]], 1 +; CGSCC-NEXT: store i32 [[X1]], i32* [[V]], align 4 +; CGSCC-NEXT: ret i32* undef +; CGSCC: F: +; CGSCC-NEXT: [[X2:%.*]] = sub i32 [[X]], 1 +; CGSCC-NEXT: store i32 [[X2]], i32* [[V]], align 4 +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@foo +; MODULE-SAME: (i32 noundef [[A:%.*]], i32 noundef [[B:%.*]]) #[[ATTR1:[0-9]+]] { +; MODULE-NEXT: [[X:%.*]] = add i32 [[A]], [[B]] +; MODULE-NEXT: [[Y:%.*]] = insertvalue { i32, i32 } undef, i32 [[A]], 0 +; MODULE-NEXT: [[Z:%.*]] = insertvalue { i32, i32 } [[Y]], i32 [[X]], 1 +; MODULE-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]] +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@foo +; CGSCC-SAME: (i32 noundef [[A:%.*]], i32 noundef [[B:%.*]]) #[[ATTR1:[0-9]+]] { +; CGSCC-NEXT: [[X:%.*]] = add i32 [[A]], [[B]] +; CGSCC-NEXT: [[Y:%.*]] = insertvalue { i32, i32 } undef, i32 [[A]], 0 +; CGSCC-NEXT: [[Z:%.*]] = insertvalue { i32, i32 } [[Y]], i32 [[X]], 1 +; CGSCC-NEXT: ret { i32, i32 } [[Z]] ; %X = add i32 %A, %B %Y = insertvalue { i32, i32 } undef, i32 %A, 0 @@ -88,81 +72,43 @@ } 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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@caller +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR1]] personality i32 (...)* @__gxx_personality_v0 { +; MODULE-NEXT: [[Q:%.*]] = alloca i32, align 4 +; MODULE-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]+]] +; MODULE-NEXT: [[S1:%.*]] = call { i32, i32 } @foo(i32 noundef 1, i32 noundef 2) #[[ATTR1]] +; MODULE-NEXT: [[X1:%.*]] = extractvalue { i32, i32 } [[S1]], 0 +; MODULE-NEXT: [[S2:%.*]] = call { i32, i32 } @foo(i32 noundef 3, i32 noundef 4) #[[ATTR1]] +; MODULE-NEXT: br label [[OK:%.*]] +; MODULE: OK: +; MODULE-NEXT: [[X2:%.*]] = extractvalue { i32, i32 } [[S2]], 0 +; MODULE-NEXT: [[Z:%.*]] = add i32 [[X1]], [[X2]] +; MODULE-NEXT: store i32 [[Z]], i32* [[Q]], align 4 +; MODULE-NEXT: br label [[RET:%.*]] +; MODULE: LPAD: +; MODULE-NEXT: unreachable +; MODULE: RET: +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@caller +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR1]] personality i32 (...)* @__gxx_personality_v0 { +; CGSCC-NEXT: [[Q:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: [[W:%.*]] = call i32* @incdec(i1 [[C]], i32* noalias nofree noundef nonnull align 4 dereferenceable(4) "no-capture-maybe-returned" [[Q]]) #[[ATTR2:[0-9]+]] +; CGSCC-NEXT: [[S1:%.*]] = call { i32, i32 } @foo(i32 noundef 1, i32 noundef 2) #[[ATTR3:[0-9]+]] +; CGSCC-NEXT: [[X1:%.*]] = extractvalue { i32, i32 } [[S1]], 0 +; CGSCC-NEXT: [[S2:%.*]] = call { i32, i32 } @foo(i32 noundef 3, i32 noundef 4) #[[ATTR4:[0-9]+]] +; CGSCC-NEXT: br label [[OK:%.*]] +; CGSCC: OK: +; CGSCC-NEXT: [[X2:%.*]] = extractvalue { i32, i32 } [[S2]], 0 +; CGSCC-NEXT: [[Z:%.*]] = add i32 [[X1]], [[X2]] +; CGSCC-NEXT: store i32 [[Z]], i32* [[Q]], align 4 +; CGSCC-NEXT: br label [[RET:%.*]] +; CGSCC: LPAD: +; CGSCC-NEXT: unreachable +; CGSCC: RET: +; CGSCC-NEXT: ret void ; %Q = alloca i32 ;; Call incdec to see if %W is properly replaced by %Q @@ -192,13 +138,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 } +; MODULE: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind willreturn } +; MODULE: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR2]] = { nounwind willreturn } +; CGSCC: attributes #[[ATTR3]] = { readnone willreturn } +; CGSCC: 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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; 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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@invokecaller +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] personality i32 (...)* @__gxx_personality_v0 { +; MODULE-NEXT: [[X:%.*]] = call i32 @foo(i1 [[C]]) #[[ATTR1:[0-9]+]] +; MODULE-NEXT: br label [[OK:%.*]] +; MODULE: OK: +; MODULE-NEXT: ret i1 true +; MODULE: FAIL: +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@invokecaller +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] personality i32 (...)* @__gxx_personality_v0 { +; CGSCC-NEXT: [[X:%.*]] = call i32 @foo(i1 [[C]]) #[[ATTR1:[0-9]+]] +; CGSCC-NEXT: br label [[OK:%.*]] +; CGSCC: OK: +; CGSCC-NEXT: ret i1 true +; CGSCC: FAIL: +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@foo +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; MODULE: T: +; MODULE-NEXT: ret i32 undef +; MODULE: F: +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@foo +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; CGSCC: T: +; CGSCC-NEXT: ret i32 undef +; CGSCC: F: +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@caller +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@caller +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; CGSCC-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 } +; MODULE: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR1]] = { nounwind readnone } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { nounwind readnone } +; CGSCC: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: 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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ;; FIXME: support for extractvalue and insertvalue missing. %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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@foo +; MODULE-SAME: (i1 [[Q:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: br i1 [[Q]], label [[T:%.*]], label [[F:%.*]] +; MODULE: T: +; MODULE-NEXT: [[MRV:%.*]] = insertvalue [[TMP0:%.*]] undef, i32 21, 0 +; MODULE-NEXT: [[MRV1:%.*]] = insertvalue [[TMP0]] [[MRV]], i32 22, 1 +; MODULE-NEXT: ret [[TMP0]] [[MRV1]] +; MODULE: F: +; MODULE-NEXT: [[MRV2:%.*]] = insertvalue [[TMP0]] undef, i32 21, 0 +; MODULE-NEXT: [[MRV3:%.*]] = insertvalue [[TMP0]] [[MRV2]], i32 23, 1 +; MODULE-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]] +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@foo +; CGSCC-SAME: (i1 [[Q:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: br i1 [[Q]], label [[T:%.*]], label [[F:%.*]] +; CGSCC: T: +; CGSCC-NEXT: [[MRV:%.*]] = insertvalue [[TMP0:%.*]] undef, i32 21, 0 +; CGSCC-NEXT: [[MRV1:%.*]] = insertvalue [[TMP0]] [[MRV]], i32 22, 1 +; CGSCC-NEXT: ret [[TMP0]] [[MRV1]] +; CGSCC: F: +; CGSCC-NEXT: [[MRV2:%.*]] = insertvalue [[TMP0]] undef, i32 21, 0 +; CGSCC-NEXT: [[MRV3:%.*]] = insertvalue [[TMP0]] [[MRV2]], i32 23, 1 +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@bar +; MODULE-SAME: (i1 [[Q:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[A:%.*]] = insertvalue [[TMP0:%.*]] undef, i32 21, 0 +; MODULE-NEXT: br i1 [[Q]], label [[T:%.*]], label [[F:%.*]] +; MODULE: T: +; MODULE-NEXT: [[B:%.*]] = insertvalue [[TMP0]] [[A]], i32 22, 1 +; MODULE-NEXT: ret [[TMP0]] [[B]] +; MODULE: F: +; MODULE-NEXT: [[C:%.*]] = insertvalue [[TMP0]] [[A]], i32 23, 1 +; MODULE-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]] +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@bar +; CGSCC-SAME: (i1 [[Q:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[A:%.*]] = insertvalue [[TMP0:%.*]] undef, i32 21, 0 +; CGSCC-NEXT: br i1 [[Q]], label [[T:%.*]], label [[F:%.*]] +; CGSCC: T: +; CGSCC-NEXT: [[B:%.*]] = insertvalue [[TMP0]] [[A]], i32 22, 1 +; CGSCC-NEXT: ret [[TMP0]] [[B]] +; CGSCC: F: +; CGSCC-NEXT: [[C:%.*]] = insertvalue [[TMP0]] [[A]], i32 23, 1 +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@caller +; MODULE-SAME: (i1 [[Q:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[X:%.*]] = call [[TMP0:%.*]] @foo(i1 [[Q]]) #[[ATTR0]] +; MODULE-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]] +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@caller +; CGSCC-SAME: (i1 [[Q:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[X:%.*]] = call [[TMP0:%.*]] @foo(i1 [[Q]]) #[[ATTR1:[0-9]+]] +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@caller2 +; MODULE-SAME: (i1 [[Q:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[X:%.*]] = call [[TMP0:%.*]] @foo(i1 [[Q]]) #[[ATTR0]] +; MODULE-NEXT: [[A:%.*]] = extractvalue [[TMP0]] [[X]], 0 +; MODULE-NEXT: [[B:%.*]] = extractvalue [[TMP0]] [[X]], 1 +; MODULE-NEXT: [[Y:%.*]] = call [[TMP0]] @bar(i1 [[Q]]) #[[ATTR0]] +; MODULE-NEXT: [[C:%.*]] = extractvalue [[TMP0]] [[Y]], 0 +; MODULE-NEXT: [[D:%.*]] = extractvalue [[TMP0]] [[Y]], 1 +; MODULE-NEXT: [[M:%.*]] = add i32 [[A]], [[C]] +; MODULE-NEXT: [[N:%.*]] = add i32 [[B]], [[D]] +; MODULE-NEXT: [[R:%.*]] = add i32 [[N]], [[M]] +; MODULE-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]] +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@caller2 +; CGSCC-SAME: (i1 [[Q:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[X:%.*]] = call [[TMP0:%.*]] @foo(i1 [[Q]]) #[[ATTR1]] +; CGSCC-NEXT: [[A:%.*]] = extractvalue [[TMP0]] [[X]], 0 +; CGSCC-NEXT: [[B:%.*]] = extractvalue [[TMP0]] [[X]], 1 +; CGSCC-NEXT: [[Y:%.*]] = call [[TMP0]] @bar(i1 [[Q]]) #[[ATTR1]] +; CGSCC-NEXT: [[C:%.*]] = extractvalue [[TMP0]] [[Y]], 0 +; CGSCC-NEXT: [[D:%.*]] = extractvalue [[TMP0]] [[Y]], 1 +; CGSCC-NEXT: [[M:%.*]] = add i32 [[A]], [[C]] +; CGSCC-NEXT: [[N:%.*]] = add i32 [[B]], [[D]] +; CGSCC-NEXT: [[R:%.*]] = add i32 [[N]], [[M]] +; CGSCC-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 } +; MODULE: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { readnone willreturn } +; CGSCC: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: 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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC 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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@testf +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br i1 [[C]], label [[IF_COND:%.*]], label [[IF_END:%.*]] +; CGSCC: if.cond: +; CGSCC-NEXT: unreachable +; CGSCC: if.then: +; CGSCC-NEXT: unreachable +; CGSCC: if.end: +; CGSCC-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test1 +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br label [[IF_THEN:%.*]] +; CGSCC: if.then: +; CGSCC-NEXT: br label [[RET1:%.*]] +; CGSCC: ret1: +; CGSCC-NEXT: ret i32 undef +; CGSCC: ret2: +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@main +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@main +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: ret i32 99 ; %res = call i32 @test1(i1 %c) ret i32 %res } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: 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,23 +1,16 @@ ; 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 -; +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; #include ; thread_local int gtl = 0; ; int gsh = 0; -; ; static int callee(int *thread_local_ptr, int *shared_ptr) { ; return *thread_local_ptr + *shared_ptr; ; } -; ; void broker(int *, int (*callee)(int *, int *), int *); -; ; void caller() { ; broker(>l, callee, &gsh); ; } -; target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" @gtl = dso_local thread_local global i32 0, align 4 @@ -28,23 +21,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]] +; MODULE: Function Attrs: nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@callee +; MODULE-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]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[TMP:%.*]] = load i32, i32* [[THREAD_LOCAL_PTR]], align 4 +; MODULE-NEXT: [[TMP1:%.*]] = load i32, i32* @gsh, align 4 +; MODULE-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP]], [[TMP1]] +; MODULE-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]] +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@callee +; 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]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[TMP:%.*]] = load i32, i32* [[THREAD_LOCAL_PTR]], align 4 +; CGSCC-NEXT: [[TMP1:%.*]] = load i32, i32* @gsh, align 4 +; CGSCC-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP]], [[TMP1]] +; CGSCC-NEXT: ret i32 [[ADD]] ; entry: %tmp = load i32, i32* %thread_local_ptr, align 4 @@ -54,15 +47,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 +; MODULE-LABEL: define {{[^@]+}}@caller() { +; MODULE-NEXT: entry: +; MODULE-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) +; MODULE-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 +; CGSCC-LABEL: define {{[^@]+}}@caller() { +; CGSCC-NEXT: entry: +; 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) +; CGSCC-NEXT: ret void ; entry: call void @broker(i32* nonnull @gtl, i32 (i32*, i32*)* nonnull @callee, i32* nonnull @gsh) @@ -74,9 +67,9 @@ !1 = !{i64 1, i64 0, i64 2, i1 false} !0 = !{!1} ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readonly willreturn } +; MODULE: attributes #[[ATTR0]] = { nofree nosync nounwind readonly willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readonly willreturn } +; CGSCC: 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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC 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]] +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@test1 +; MODULE-SAME: (i32* nofree readnone returned align 8 "no-capture-maybe-returned" [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-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]] +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@test1 +; CGSCC-SAME: (i32* nofree readnone returned align 8 "no-capture-maybe-returned" [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-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]] +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@test2 +; MODULE-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[TMP0:%.*]]) #[[ATTR0]] { +; MODULE-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]] +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@test2 +; CGSCC-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[TMP0:%.*]]) #[[ATTR0]] { +; CGSCC-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]] +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@test3 +; MODULE-SAME: (i32* nofree readnone align 8 "no-capture-maybe-returned" [[TMP0:%.*]], i32* nofree readnone align 4 "no-capture-maybe-returned" [[TMP1:%.*]], i1 [[TMP2:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[RET:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP1]] +; MODULE-NEXT: ret i32* [[RET]] +; +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@test3 +; 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]] { +; CGSCC-NEXT: [[RET:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP1]] +; CGSCC-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]] +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@test4 +; MODULE-SAME: (i32* nofree readnone align 32 "no-capture-maybe-returned" [[TMP0:%.*]], i32* nofree readnone align 32 "no-capture-maybe-returned" [[TMP1:%.*]], i1 [[TMP2:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[RET:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP1]] +; MODULE-NEXT: ret i32* [[RET]] +; +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@test4 +; 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]] { +; CGSCC-NEXT: [[RET:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP1]] +; CGSCC-NEXT: ret i32* [[RET]] ; %ret = select i1 %2, i32* %0, i32* %1 ret i32* %ret @@ -108,30 +106,30 @@ ; TEST 6 ; SCC define i32* @test6_1() #0 { -; NOT_CGSCC_NPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test6_1 -; NOT_CGSCC_NPM-SAME: () #[[ATTR1:[0-9]+]] { -; NOT_CGSCC_NPM-NEXT: unreachable +; MODULE: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@test6_1 +; MODULE-SAME: () #[[ATTR1:[0-9]+]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@test6_1 +; CGSCC-SAME: () #[[ATTR1:[0-9]+]] { +; CGSCC-NEXT: unreachable ; %ret = tail call i32* @test6_2() ret i32* %ret } define i32* @test6_2() #0 { -; NOT_CGSCC_NPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test6_2 -; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { -; NOT_CGSCC_NPM-NEXT: unreachable +; MODULE: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@test6_2 +; MODULE-SAME: () #[[ATTR1]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@test6_2 +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-NEXT: unreachable ; %ret = tail call i32* @test6_1() ret i32* %ret @@ -140,14 +138,12 @@ ; char a1 __attribute__((aligned(8))); ; char a2 __attribute__((aligned(16))); -; ; char* f1(char* a ){ ; return a?a:f2(&a1); ; } ; char* f2(char* a){ ; return a?f1(a):f3(&a2); ; } -; ; char* f3(char* a){ ; return a?&a1: f1(&a2); ; } @@ -157,23 +153,14 @@ ; 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 +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@f1 +; CGSCC-SAME: () local_unnamed_addr #[[ATTR0]] { +; CGSCC-NEXT: br label [[TMP2:%.*]] +; CGSCC: 1: +; CGSCC-NEXT: unreachable +; CGSCC: 2: +; CGSCC-NEXT: ret i8* undef ; %2 = icmp eq i8* %0, null br i1 %2, label %3, label %5 @@ -190,27 +177,16 @@ ; Function Attrs: nounwind readnone ssp uwtable define internal i8* @f2(i8* readnone %0) local_unnamed_addr #0 { -; IS__CGSCC_OPM: Function Attrs: noinline nounwind uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f2 -; IS__CGSCC_OPM-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr #[[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 +; CGSCC: Function Attrs: noinline nounwind uwtable +; CGSCC-LABEL: define {{[^@]+}}@f2 +; CGSCC-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2:[0-9]+]] { +; CGSCC-NEXT: unreachable +; CGSCC: 2: +; CGSCC-NEXT: unreachable +; CGSCC: 3: +; CGSCC-NEXT: unreachable +; CGSCC: 4: +; CGSCC-NEXT: unreachable ; %2 = icmp eq i8* %0, null br i1 %2, label %5, label %3 @@ -231,23 +207,14 @@ ; Function Attrs: nounwind readnone ssp uwtable define internal i8* @f3(i8* readnone %0) local_unnamed_addr #0 { -; IS__CGSCC_OPM: Function Attrs: noinline nounwind uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f3 -; IS__CGSCC_OPM-SAME: (i8* nonnull readnone [[TMP0:%.*]]) local_unnamed_addr #[[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 +; CGSCC: Function Attrs: noinline nounwind uwtable +; CGSCC-LABEL: define {{[^@]+}}@f3 +; CGSCC-SAME: (i8* nonnull readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2]] { +; CGSCC-NEXT: br label [[TMP3:%.*]] +; CGSCC: 2: +; CGSCC-NEXT: unreachable +; CGSCC: 3: +; CGSCC-NEXT: ret i8* @a1 ; %2 = icmp eq i8* %0, null br i1 %2, label %3, label %5 @@ -264,15 +231,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 +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@test7 +; MODULE-SAME: () #[[ATTR0]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@test7 +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: ret i8* @a1 ; %c = tail call i8* @f1(i8* align 8 dereferenceable(1) @a1) ret i8* %c @@ -281,23 +248,14 @@ ; 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 +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@f1b +; CGSCC-SAME: () local_unnamed_addr #[[ATTR0]] { +; CGSCC-NEXT: br label [[TMP2:%.*]] +; CGSCC: 1: +; CGSCC-NEXT: unreachable +; CGSCC: 2: +; CGSCC-NEXT: ret i8* undef ; %2 = icmp eq i8* %0, null br i1 %2, label %3, label %5 @@ -315,28 +273,16 @@ ; Function Attrs: nounwind readnone ssp uwtable define internal i8* @f2b(i8* readnone %0) local_unnamed_addr #0 { -; -; IS__CGSCC_OPM: Function Attrs: noinline nounwind uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f2b -; IS__CGSCC_OPM-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr #[[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 +; CGSCC: Function Attrs: noinline nounwind uwtable +; CGSCC-LABEL: define {{[^@]+}}@f2b +; CGSCC-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2]] { +; CGSCC-NEXT: unreachable +; CGSCC: 2: +; CGSCC-NEXT: unreachable +; CGSCC: 3: +; CGSCC-NEXT: unreachable +; CGSCC: 4: +; CGSCC-NEXT: unreachable ; %2 = icmp eq i8* %0, null br i1 %2, label %5, label %3 @@ -357,24 +303,14 @@ ; Function Attrs: nounwind readnone ssp uwtable define internal i8* @f3b(i8* readnone %0) local_unnamed_addr #0 { -; -; IS__CGSCC_OPM: Function Attrs: noinline nounwind uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f3b -; IS__CGSCC_OPM-SAME: (i8* nonnull readnone [[TMP0:%.*]]) local_unnamed_addr #[[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 +; CGSCC: Function Attrs: noinline nounwind uwtable +; CGSCC-LABEL: define {{[^@]+}}@f3b +; CGSCC-SAME: (i8* nonnull readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2]] { +; CGSCC-NEXT: br label [[TMP3:%.*]] +; CGSCC: 2: +; CGSCC-NEXT: unreachable +; CGSCC: 3: +; CGSCC-NEXT: ret i8* @a1 ; %2 = icmp eq i8* %0, null br i1 %2, label %3, label %5 @@ -389,15 +325,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]] +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@test7b +; MODULE-SAME: (i32* nofree readnone returned align 32 "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR0]] { +; MODULE-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]] +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@test7b +; CGSCC-SAME: (i32* nofree readnone returned align 32 "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: ret i32* [[P]] ; tail call i8* @f1b(i8* align 8 dereferenceable(1) @a1) ret i32* %p @@ -405,32 +341,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 +; MODULE-LABEL: define {{[^@]+}}@test8_helper() { +; MODULE-NEXT: [[PTR0:%.*]] = tail call i32* @unknown() +; MODULE-NEXT: [[PTR1:%.*]] = tail call align 4 i32* @unknown() +; MODULE-NEXT: [[PTR2:%.*]] = tail call align 8 i32* @unknown() +; MODULE-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]+]] +; MODULE-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]] +; MODULE-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]] +; MODULE-NEXT: ret void +; +; CGSCC-LABEL: define {{[^@]+}}@test8_helper() { +; CGSCC-NEXT: [[PTR0:%.*]] = tail call i32* @unknown() +; CGSCC-NEXT: [[PTR1:%.*]] = tail call align 4 i32* @unknown() +; CGSCC-NEXT: [[PTR2:%.*]] = tail call align 8 i32* @unknown() +; CGSCC-NEXT: tail call void @test8(i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone [[PTR0]]) #[[ATTR3:[0-9]+]] +; CGSCC-NEXT: tail call void @test8(i32* noalias nocapture readnone align 8 [[PTR2]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]]) #[[ATTR3]] +; CGSCC-NEXT: tail call void @test8(i32* noalias nocapture readnone align 8 [[PTR2]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]]) #[[ATTR3]] +; CGSCC-NEXT: ret void ; %ptr0 = tail call i32* @unknown() %ptr1 = tail call align 4 i32* @unknown() @@ -444,29 +371,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 +; MODULE: Function Attrs: nounwind +; MODULE-LABEL: define {{[^@]+}}@test8 +; MODULE-SAME: (i32* noalias nocapture readnone align 4 [[A:%.*]], i32* noalias nocapture readnone align 4 [[B:%.*]], i32* noalias nocapture readnone [[C:%.*]]) #[[ATTR2]] { +; MODULE-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[A]]) #[[ATTR2]] +; MODULE-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[B]]) #[[ATTR2]] +; MODULE-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone [[C]]) #[[ATTR2]] +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nounwind +; CGSCC-LABEL: define {{[^@]+}}@test8 +; CGSCC-SAME: (i32* noalias nocapture readnone align 4 [[A:%.*]], i32* noalias nocapture readnone align 4 [[B:%.*]], i32* noalias nocapture readnone [[C:%.*]]) #[[ATTR3]] { +; CGSCC-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[A]]) #[[ATTR3]] +; CGSCC-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[B]]) #[[ATTR3]] +; CGSCC-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone [[C]]) #[[ATTR3]] +; CGSCC-NEXT: ret void ; call void @user_i32_ptr(i32* %a) call void @user_i32_ptr(i32* %b) @@ -494,62 +413,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]] +; MODULE: Function Attrs: nofree nosync nounwind +; MODULE-LABEL: define {{[^@]+}}@test10a +; MODULE-SAME: (i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR3:[0-9]+]] { +; MODULE-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 32 +; MODULE-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0 +; MODULE-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; MODULE: t: +; MODULE-NEXT: [[R:%.*]] = call align 32 i32* @test10a(i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR3]] +; MODULE-NEXT: store i32 1, i32* [[R]], align 32 +; MODULE-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8 +; MODULE-NEXT: br label [[E:%.*]] +; MODULE: f: +; MODULE-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 8 +; MODULE-NEXT: store i32 -1, i32* [[G1]], align 32 +; MODULE-NEXT: br label [[E]] +; MODULE: e: +; MODULE-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ] +; MODULE-NEXT: ret i32* [[PHI]] +; +; CGSCC: Function Attrs: nofree nosync nounwind +; CGSCC-LABEL: define {{[^@]+}}@test10a +; CGSCC-SAME: (i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR4:[0-9]+]] { +; CGSCC-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 32 +; CGSCC-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0 +; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; CGSCC: t: +; CGSCC-NEXT: [[R:%.*]] = call align 32 i32* @test10a(i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR4]] +; CGSCC-NEXT: store i32 1, i32* [[R]], align 32 +; CGSCC-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8 +; CGSCC-NEXT: br label [[E:%.*]] +; CGSCC: f: +; CGSCC-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 8 +; CGSCC-NEXT: store i32 -1, i32* [[G1]], align 32 +; CGSCC-NEXT: br label [[E]] +; CGSCC: e: +; CGSCC-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ] +; CGSCC-NEXT: ret i32* [[PHI]] ; %l = load i32, i32* %p %c = icmp eq i32 %l, 0 @@ -575,62 +475,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]] +; MODULE: Function Attrs: nofree nosync nounwind +; MODULE-LABEL: define {{[^@]+}}@test10b +; MODULE-SAME: (i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR3]] { +; MODULE-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 32 +; MODULE-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0 +; MODULE-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; MODULE: t: +; MODULE-NEXT: [[R:%.*]] = call align 32 i32* @test10b(i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR3]] +; MODULE-NEXT: store i32 1, i32* [[R]], align 32 +; MODULE-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8 +; MODULE-NEXT: br label [[E:%.*]] +; MODULE: f: +; MODULE-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 -8 +; MODULE-NEXT: store i32 -1, i32* [[G1]], align 32 +; MODULE-NEXT: br label [[E]] +; MODULE: e: +; MODULE-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ] +; MODULE-NEXT: ret i32* [[PHI]] +; +; CGSCC: Function Attrs: nofree nosync nounwind +; CGSCC-LABEL: define {{[^@]+}}@test10b +; CGSCC-SAME: (i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 32 +; CGSCC-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0 +; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; CGSCC: t: +; CGSCC-NEXT: [[R:%.*]] = call align 32 i32* @test10b(i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR4]] +; CGSCC-NEXT: store i32 1, i32* [[R]], align 32 +; CGSCC-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8 +; CGSCC-NEXT: br label [[E:%.*]] +; CGSCC: f: +; CGSCC-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 -8 +; CGSCC-NEXT: store i32 -1, i32* [[G1]], align 32 +; CGSCC-NEXT: br label [[E]] +; CGSCC: e: +; CGSCC-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ] +; CGSCC-NEXT: ret i32* [[PHI]] ; %l = load i32, i32* %p %c = icmp eq i32 %l, 0 @@ -651,26 +532,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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@test11 +; MODULE-SAME: (i32* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[P:%.*]]) #[[ATTR4:[0-9]+]] { +; MODULE-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; MODULE-NEXT: [[RET:%.*]] = load i64, i64* [[P_CAST]], align 8 +; MODULE-NEXT: ret i64 [[RET]] +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@test11 +; CGSCC-SAME: (i32* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[P:%.*]]) #[[ATTR5:[0-9]+]] { +; CGSCC-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; CGSCC-NEXT: [[RET:%.*]] = load i64, i64* [[P_CAST]], align 8 +; CGSCC-NEXT: ret i64 [[RET]] ; %p-cast = bitcast i32* %p to i64* %ret = load i64, i64* %p-cast, align 8 @@ -682,32 +556,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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@test12-1 +; MODULE-SAME: (i32* nocapture nofree readonly align 16 [[P:%.*]]) #[[ATTR4]] { +; MODULE-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; MODULE-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 +; MODULE-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 +; MODULE-NEXT: [[RET:%.*]] = load i64, i64* [[ARRAYIDX1]], align 16 +; MODULE-NEXT: ret i64 [[RET]] +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@test12-1 +; CGSCC-SAME: (i32* nocapture nofree readonly align 16 [[P:%.*]]) #[[ATTR5]] { +; CGSCC-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; CGSCC-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 +; CGSCC-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 +; CGSCC-NEXT: [[RET:%.*]] = load i64, i64* [[ARRAYIDX1]], align 16 +; CGSCC-NEXT: ret i64 [[RET]] ; %p-cast = bitcast i32* %p to i64* %arrayidx0 = getelementptr i64, i64* %p-cast, i64 1 @@ -717,29 +582,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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@test12-2 +; MODULE-SAME: (i32* nocapture nofree nonnull readonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR4]] { +; MODULE-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; MODULE-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 +; MODULE-NEXT: [[RET:%.*]] = load i64, i64* [[ARRAYIDX0]], align 16 +; MODULE-NEXT: ret i64 [[RET]] +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@test12-2 +; CGSCC-SAME: (i32* nocapture nofree nonnull readonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR5]] { +; CGSCC-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; CGSCC-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 +; CGSCC-NEXT: [[RET:%.*]] = load i64, i64* [[ARRAYIDX0]], align 16 +; CGSCC-NEXT: ret i64 [[RET]] ; %p-cast = bitcast i32* %p to i64* %arrayidx0 = getelementptr i64, i64* %p-cast, i64 0 @@ -749,32 +606,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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@test12-3 +; MODULE-SAME: (i32* nocapture nofree writeonly align 16 [[P:%.*]]) #[[ATTR5:[0-9]+]] { +; MODULE-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; MODULE-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 +; MODULE-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 +; MODULE-NEXT: store i64 0, i64* [[ARRAYIDX1]], align 16 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@test12-3 +; CGSCC-SAME: (i32* nocapture nofree writeonly align 16 [[P:%.*]]) #[[ATTR6:[0-9]+]] { +; CGSCC-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; CGSCC-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 +; CGSCC-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 +; CGSCC-NEXT: store i64 0, i64* [[ARRAYIDX1]], align 16 +; CGSCC-NEXT: ret void ; %p-cast = bitcast i32* %p to i64* %arrayidx0 = getelementptr i64, i64* %p-cast, i64 1 @@ -784,29 +632,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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@test12-4 +; MODULE-SAME: (i32* nocapture nofree nonnull writeonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR5]] { +; MODULE-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; MODULE-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 +; MODULE-NEXT: store i64 0, i64* [[ARRAYIDX0]], align 16 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@test12-4 +; CGSCC-SAME: (i32* nocapture nofree nonnull writeonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR6]] { +; CGSCC-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; CGSCC-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 +; CGSCC-NEXT: store i64 0, i64* [[ARRAYIDX0]], align 16 +; CGSCC-NEXT: ret void ; %p-cast = bitcast i32* %p to i64* %arrayidx0 = getelementptr i64, i64* %p-cast, i64 0 @@ -817,32 +657,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 +; MODULE: Function Attrs: nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@test12-5 +; MODULE-SAME: (i32* align 16 [[P:%.*]]) #[[ATTR6:[0-9]+]] { +; MODULE-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; MODULE-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 +; MODULE-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 +; MODULE-NEXT: tail call void @use(i64* align 16 [[ARRAYIDX1]]) #[[ATTR6]] +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@test12-5 +; CGSCC-SAME: (i32* align 16 [[P:%.*]]) #[[ATTR7:[0-9]+]] { +; CGSCC-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; CGSCC-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1 +; CGSCC-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3 +; CGSCC-NEXT: tail call void @use(i64* align 16 [[ARRAYIDX1]]) #[[ATTR7]] +; CGSCC-NEXT: ret void ; %p-cast = bitcast i32* %p to i64* %arrayidx0 = getelementptr i64, i64* %p-cast, i64 1 @@ -852,29 +683,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 +; MODULE: Function Attrs: nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@test12-6 +; MODULE-SAME: (i32* align 16 [[P:%.*]]) #[[ATTR6]] { +; MODULE-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; MODULE-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 +; MODULE-NEXT: tail call void @use(i64* align 16 [[ARRAYIDX0]]) #[[ATTR6]] +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@test12-6 +; CGSCC-SAME: (i32* align 16 [[P:%.*]]) #[[ATTR7]] { +; CGSCC-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64* +; CGSCC-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0 +; CGSCC-NEXT: tail call void @use(i64* align 16 [[ARRAYIDX0]]) #[[ATTR7]] +; CGSCC-NEXT: ret void ; %p-cast = bitcast i32* %p to i64* %arrayidx0 = getelementptr i64, i64* %p-cast, i64 0 @@ -883,44 +706,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 +; MODULE: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@test13 +; MODULE-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR7:[0-9]+]] { +; MODULE-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] +; MODULE: truebb: +; MODULE-NEXT: br label [[END:%.*]] +; MODULE: falsebb: +; MODULE-NEXT: br label [[END]] +; MODULE: end: +; MODULE-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ null, [[FALSEBB]] ] +; MODULE-NEXT: store i32 0, i32* [[PTR]], align 32 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@test13 +; CGSCC-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8:[0-9]+]] { +; CGSCC-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] +; CGSCC: truebb: +; CGSCC-NEXT: br label [[END:%.*]] +; CGSCC: falsebb: +; CGSCC-NEXT: br label [[END]] +; CGSCC: end: +; CGSCC-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ null, [[FALSEBB]] ] +; CGSCC-NEXT: store i32 0, i32* [[PTR]], align 32 +; CGSCC-NEXT: ret void ; br i1 %c, label %truebb, label %falsebb truebb: @@ -934,44 +744,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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@test13-1 +; MODULE-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8:[0-9]+]] { +; MODULE-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] +; MODULE: truebb: +; MODULE-NEXT: br label [[END:%.*]] +; MODULE: falsebb: +; MODULE-NEXT: br label [[END]] +; MODULE: end: +; MODULE-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 48 to i32*), [[FALSEBB]] ] +; MODULE-NEXT: store i32 0, i32* [[PTR]], align 16 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@test13-1 +; CGSCC-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR9:[0-9]+]] { +; CGSCC-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] +; CGSCC: truebb: +; CGSCC-NEXT: br label [[END:%.*]] +; CGSCC: falsebb: +; CGSCC-NEXT: br label [[END]] +; CGSCC: end: +; CGSCC-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 48 to i32*), [[FALSEBB]] ] +; CGSCC-NEXT: store i32 0, i32* [[PTR]], align 16 +; CGSCC-NEXT: ret void ; br i1 %c, label %truebb, label %falsebb truebb: @@ -985,44 +782,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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@test13-2 +; MODULE-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8]] { +; MODULE-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] +; MODULE: truebb: +; MODULE-NEXT: br label [[END:%.*]] +; MODULE: falsebb: +; MODULE-NEXT: br label [[END]] +; MODULE: end: +; MODULE-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 160 to i32*), [[FALSEBB]] ] +; MODULE-NEXT: store i32 0, i32* [[PTR]], align 32 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@test13-2 +; CGSCC-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR9]] { +; CGSCC-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] +; CGSCC: truebb: +; CGSCC-NEXT: br label [[END:%.*]] +; CGSCC: falsebb: +; CGSCC-NEXT: br label [[END]] +; CGSCC: end: +; CGSCC-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 160 to i32*), [[FALSEBB]] ] +; CGSCC-NEXT: store i32 0, i32* [[PTR]], align 32 +; CGSCC-NEXT: ret void ; br i1 %c, label %truebb, label %falsebb truebb: @@ -1036,44 +820,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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@test13-3 +; MODULE-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8]] { +; MODULE-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] +; MODULE: truebb: +; MODULE-NEXT: br label [[END:%.*]] +; MODULE: falsebb: +; MODULE-NEXT: br label [[END]] +; MODULE: end: +; MODULE-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 128 to i32*), [[FALSEBB]] ] +; MODULE-NEXT: store i32 0, i32* [[PTR]], align 32 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@test13-3 +; CGSCC-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR9]] { +; CGSCC-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] +; CGSCC: truebb: +; CGSCC-NEXT: br label [[END:%.*]] +; CGSCC: falsebb: +; CGSCC-NEXT: br label [[END]] +; CGSCC: end: +; CGSCC-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 128 to i32*), [[FALSEBB]] ] +; CGSCC-NEXT: store i32 0, i32* [[PTR]], align 32 +; CGSCC-NEXT: ret void ; br i1 %c, label %truebb, label %falsebb truebb: @@ -1088,45 +859,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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@ptr2int +; MODULE-SAME: (i32* nofree readnone [[P:%.*]]) #[[ATTR9:[0-9]+]] { +; MODULE-NEXT: [[P2I:%.*]] = ptrtoint i32* [[P]] to i64 +; MODULE-NEXT: ret i64 [[P2I]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@ptr2int +; CGSCC-SAME: (i32* nofree readnone [[P:%.*]]) #[[ATTR10:[0-9]+]] { +; CGSCC-NEXT: [[P2I:%.*]] = ptrtoint i32* [[P]] to i64 +; CGSCC-NEXT: ret i64 [[P2I]] ; %p2i = ptrtoint i32* %p to i64 ret i64 %p2i } define i64* @int2ptr(i64 %i) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@int2ptr +; MODULE-SAME: (i64 [[I:%.*]]) #[[ATTR9]] { +; MODULE-NEXT: [[I2P:%.*]] = inttoptr i64 [[I]] to i64* +; MODULE-NEXT: ret i64* [[I2P]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@int2ptr +; CGSCC-SAME: (i64 [[I:%.*]]) #[[ATTR10]] { +; CGSCC-NEXT: [[I2P:%.*]] = inttoptr i64 [[I]] to i64* +; CGSCC-NEXT: ret i64* [[I2P]] ; %i2p = inttoptr i64 %i to i64* ret i64* %i2p @@ -1134,23 +893,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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@aligned_store +; MODULE-SAME: (i8* nofree writeonly [[VALUE:%.*]], i8** nocapture nofree noundef nonnull writeonly align 32 dereferenceable(8) [[PTR:%.*]]) #[[ATTR5]] { +; MODULE-NEXT: store i8* [[VALUE]], i8** [[PTR]], align 32 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@aligned_store +; CGSCC-SAME: (i8* nofree writeonly [[VALUE:%.*]], i8** nocapture nofree noundef nonnull writeonly align 32 dereferenceable(8) [[PTR:%.*]]) #[[ATTR6]] { +; CGSCC-NEXT: store i8* [[VALUE]], i8** [[PTR]], align 32 +; CGSCC-NEXT: ret void ; store i8* %Value, i8** %Ptr, align 32 ret void @@ -1169,27 +922,19 @@ ret void } 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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@align_store_after_bc +; MODULE-SAME: (i32* nocapture nofree nonnull writeonly align 2048 dereferenceable(1) [[ARG:%.*]]) #[[ATTR5]] { +; MODULE-NEXT: [[BC:%.*]] = bitcast i32* [[ARG]] to i8* +; MODULE-NEXT: store i8 0, i8* [[BC]], align 2048 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@align_store_after_bc +; CGSCC-SAME: (i32* nocapture nofree nonnull writeonly align 2048 dereferenceable(1) [[ARG:%.*]]) #[[ATTR6]] { +; CGSCC-NEXT: [[BC:%.*]] = bitcast i32* [[ARG]] to i8* +; CGSCC-NEXT: store i8 0, i8* [[BC]], align 2048 +; CGSCC-NEXT: ret void ; %bc = bitcast i32* %arg to i8* store i8 0, i8* %bc @@ -1200,60 +945,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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@musttail_callee_1 +; MODULE-SAME: (i32* nocapture nofree noundef nonnull readonly dereferenceable(4) [[P:%.*]]) #[[ATTR4]] { +; MODULE-NEXT: [[V:%.*]] = load i32, i32* [[P]], align 32 +; MODULE-NEXT: ret i32 [[V]] +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@musttail_callee_1 +; CGSCC-SAME: (i32* nocapture nofree noundef nonnull readonly dereferenceable(4) [[P:%.*]]) #[[ATTR5]] { +; CGSCC-NEXT: [[V:%.*]] = load i32, i32* [[P]], align 32 +; CGSCC-NEXT: ret i32 [[V]] ; %v = load i32, i32* %p, align 32 ret i32 %v } define i32 @musttail_caller_1(i32* %p) { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readonly willreturn -; IS__TUNIT____-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 +; MODULE: Function Attrs: nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@musttail_caller_1 +; MODULE-SAME: (i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR10:[0-9]+]] { +; MODULE-NEXT: [[C:%.*]] = load i1, i1* @cnd, align 1 +; MODULE-NEXT: br i1 [[C]], label [[MT:%.*]], label [[EXIT:%.*]] +; MODULE: mt: +; MODULE-NEXT: [[V:%.*]] = musttail call i32 @musttail_callee_1(i32* nocapture nofree readonly [[P]]) #[[ATTR10]] +; MODULE-NEXT: ret i32 [[V]] +; MODULE: exit: +; MODULE-NEXT: ret i32 0 +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@musttail_caller_1 +; CGSCC-SAME: (i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR11:[0-9]+]] { +; CGSCC-NEXT: [[C:%.*]] = load i1, i1* @cnd, align 1 +; CGSCC-NEXT: br i1 [[C]], label [[MT:%.*]], label [[EXIT:%.*]] +; CGSCC: mt: +; CGSCC-NEXT: [[V:%.*]] = musttail call i32 @musttail_callee_1(i32* nocapture nofree noundef nonnull readonly dereferenceable(4) [[P]]) #[[ATTR12:[0-9]+]] +; CGSCC-NEXT: ret i32 [[V]] +; CGSCC: exit: +; CGSCC-NEXT: ret i32 0 ; %c = load i1, i1* @cnd br i1 %c, label %mt, label %exit @@ -1265,53 +993,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]] +; MODULE: Function Attrs: nounwind +; MODULE-LABEL: define {{[^@]+}}@checkAndAdvance +; MODULE-SAME: (i32* noundef nonnull readonly align 16 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR2]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[TMP0:%.*]] = load i32, i32* [[P]], align 16 +; MODULE-NEXT: [[CMP:%.*]] = icmp eq i32 [[TMP0]], 0 +; MODULE-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]] +; MODULE: if.then: +; MODULE-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 4 +; MODULE-NEXT: [[CALL:%.*]] = call nonnull align 16 i32* @checkAndAdvance(i32* nonnull readonly align 16 "no-capture-maybe-returned" [[ADD_PTR]]) #[[ATTR2]] +; MODULE-NEXT: br label [[RETURN]] +; MODULE: return: +; MODULE-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[CALL]], [[IF_THEN]] ], [ [[P]], [[ENTRY:%.*]] ] +; MODULE-NEXT: call void @user_i32_ptr(i32* noalias nocapture nonnull readnone align 16 [[RETVAL_0]]) #[[ATTR2]] +; MODULE-NEXT: ret i32* [[RETVAL_0]] +; +; CGSCC: Function Attrs: nounwind +; CGSCC-LABEL: define {{[^@]+}}@checkAndAdvance +; CGSCC-SAME: (i32* noundef nonnull readonly align 16 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR3]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[TMP0:%.*]] = load i32, i32* [[P]], align 16 +; CGSCC-NEXT: [[CMP:%.*]] = icmp eq i32 [[TMP0]], 0 +; CGSCC-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]] +; CGSCC: if.then: +; CGSCC-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 4 +; CGSCC-NEXT: [[CALL:%.*]] = call nonnull align 16 i32* @checkAndAdvance(i32* nonnull readonly align 16 "no-capture-maybe-returned" [[ADD_PTR]]) #[[ATTR3]] +; CGSCC-NEXT: br label [[RETURN]] +; CGSCC: return: +; CGSCC-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[CALL]], [[IF_THEN]] ], [ [[P]], [[ENTRY:%.*]] ] +; CGSCC-NEXT: call void @user_i32_ptr(i32* noalias nocapture nonnull readnone align 16 [[RETVAL_0]]) #[[ATTR3]] +; CGSCC-NEXT: ret i32* [[RETVAL_0]] ; entry: %0 = load i32, i32* %p, align 4 @@ -1347,44 +1059,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 } +; MODULE: attributes #[[ATTR0]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; MODULE: attributes #[[ATTR1]] = { nofree noinline noreturn nosync nounwind readnone uwtable willreturn } +; MODULE: attributes #[[ATTR2]] = { nounwind } +; MODULE: attributes #[[ATTR3]] = { nofree nosync nounwind } +; MODULE: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind readonly willreturn } +; MODULE: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; MODULE: attributes #[[ATTR6]] = { nounwind willreturn } +; MODULE: attributes #[[ATTR7]] = { argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly } +; MODULE: attributes #[[ATTR8]] = { nofree nosync nounwind willreturn writeonly } +; MODULE: attributes #[[ATTR9]] = { nofree nosync nounwind readnone willreturn } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } +; CGSCC: attributes #[[ATTR1]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn } +; CGSCC: attributes #[[ATTR2]] = { noinline nounwind uwtable } +; CGSCC: attributes #[[ATTR3]] = { nounwind } +; CGSCC: attributes #[[ATTR4]] = { nofree nosync nounwind } +; CGSCC: attributes #[[ATTR5]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; CGSCC: attributes #[[ATTR6]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; CGSCC: attributes #[[ATTR7]] = { nounwind willreturn } +; CGSCC: attributes #[[ATTR8]] = { argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly } +; CGSCC: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind willreturn writeonly } +; CGSCC: attributes #[[ATTR10]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR11]] = { nofree norecurse nosync nounwind readonly willreturn } +; CGSCC: 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,43 +1,40 @@ ; 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 -; +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; When a function is marked `alwaysinline` and is able to be inlined, ; we can IPO its boundaries ; 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 +; MODULE: Function Attrs: alwaysinline nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@inner1 +; MODULE-SAME: () #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-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 +; CGSCC: Function Attrs: alwaysinline nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@inner1 +; CGSCC-SAME: () #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@outer1 +; MODULE-SAME: () #[[ATTR1:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@outer1 +; CGSCC-SAME: () #[[ATTR1:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: ret void ; entry: call void @inner1() @@ -105,11 +102,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 } +; MODULE: attributes #[[ATTR0]] = { alwaysinline nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { alwaysinline nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: 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,13 +1,10 @@ ; 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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" ; Test 0 -; ; Make sure we propagate information from the caller to the callback callee but ; only for arguments that are mapped through the callback metadata. Here, the ; first two arguments of the call and the callback callee do not correspond to @@ -16,53 +13,29 @@ ; 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 +; MODULE-LABEL: define {{[^@]+}}@t0_caller +; MODULE-SAME: (i32* align 256 [[A:%.*]]) { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[B:%.*]] = alloca i32, align 32 +; MODULE-NEXT: [[C:%.*]] = alloca i32*, align 64 +; MODULE-NEXT: [[PTR:%.*]] = alloca i32, align 128 +; MODULE-NEXT: [[TMP0:%.*]] = bitcast i32* [[B]] to i8* +; MODULE-NEXT: store i32 42, i32* [[B]], align 32 +; MODULE-NEXT: store i32* [[B]], i32** [[C]], align 64 +; MODULE-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]]) +; MODULE-NEXT: ret void +; +; CGSCC-LABEL: define {{[^@]+}}@t0_caller +; CGSCC-SAME: (i32* align 256 [[A:%.*]]) { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[B:%.*]] = alloca i32, align 32 +; CGSCC-NEXT: [[C:%.*]] = alloca i32*, align 64 +; CGSCC-NEXT: [[PTR:%.*]] = alloca i32, align 128 +; CGSCC-NEXT: [[TMP0:%.*]] = bitcast i32* [[B]] to i8* +; CGSCC-NEXT: store i32 42, i32* [[B]], align 32 +; CGSCC-NEXT: store i32* [[B]], i32** [[C]], align 64 +; CGSCC-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]]) +; CGSCC-NEXT: ret void ; entry: %b = alloca i32, align 32 @@ -78,24 +51,14 @@ ; Note that the first two arguments are provided by the callback_broker according to the callback in !1 below! ; 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 @@ -110,59 +73,33 @@ declare !callback !0 void @t0_callback_broker(i32*, i32*, void (i32*, i32*, ...)*, ...) ; Test 1 -; ; Similar to test 0 but with some additional annotations (noalias/nocapute) to make sure ; we deduce and propagate noalias and others properly. 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 +; MODULE-LABEL: define {{[^@]+}}@t1_caller +; MODULE-SAME: (i32* noalias nocapture align 256 [[A:%.*]]) { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[B:%.*]] = alloca i32, align 32 +; MODULE-NEXT: [[C:%.*]] = alloca i32*, align 64 +; MODULE-NEXT: [[PTR:%.*]] = alloca i32, align 128 +; MODULE-NEXT: [[TMP0:%.*]] = bitcast i32* [[B]] to i8* +; MODULE-NEXT: store i32 42, i32* [[B]], align 32 +; MODULE-NEXT: store i32* [[B]], i32** [[C]], align 64 +; MODULE-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]]) +; MODULE-NEXT: ret void +; +; CGSCC-LABEL: define {{[^@]+}}@t1_caller +; CGSCC-SAME: (i32* noalias nocapture align 256 [[A:%.*]]) { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[B:%.*]] = alloca i32, align 32 +; CGSCC-NEXT: [[C:%.*]] = alloca i32*, align 64 +; CGSCC-NEXT: [[PTR:%.*]] = alloca i32, align 128 +; CGSCC-NEXT: [[TMP0:%.*]] = bitcast i32* [[B]] to i8* +; CGSCC-NEXT: store i32 42, i32* [[B]], align 32 +; CGSCC-NEXT: store i32* [[B]], i32** [[C]], align 64 +; CGSCC-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]]) +; CGSCC-NEXT: ret void ; entry: %b = alloca i32, align 32 @@ -178,26 +115,15 @@ ; Note that the first two arguments are provided by the callback_broker according to the callback in !1 below! ; 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 @@ -212,57 +138,32 @@ declare !callback !0 void @t1_callback_broker(i32* nocapture , i32* nocapture , void (i32*, i32*, ...)* nocapture, ...) ; Test 2 -; ; 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 +; MODULE-LABEL: define {{[^@]+}}@t2_caller +; MODULE-SAME: (i32* noalias nocapture align 256 [[A:%.*]]) { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[B:%.*]] = alloca i32, align 32 +; MODULE-NEXT: [[C:%.*]] = alloca i32*, align 64 +; MODULE-NEXT: [[PTR:%.*]] = alloca i32, align 128 +; MODULE-NEXT: [[TMP0:%.*]] = bitcast i32* [[B]] to i8* +; MODULE-NEXT: store i32 42, i32* [[B]], align 32 +; MODULE-NEXT: store i32* [[B]], i32** [[C]], align 64 +; MODULE-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]]) +; MODULE-NEXT: ret void +; +; CGSCC-LABEL: define {{[^@]+}}@t2_caller +; CGSCC-SAME: (i32* noalias nocapture align 256 [[A:%.*]]) { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[B:%.*]] = alloca i32, align 32 +; CGSCC-NEXT: [[C:%.*]] = alloca i32*, align 64 +; CGSCC-NEXT: [[PTR:%.*]] = alloca i32, align 128 +; CGSCC-NEXT: [[TMP0:%.*]] = bitcast i32* [[B]] to i8* +; CGSCC-NEXT: store i32 42, i32* [[B]], align 32 +; CGSCC-NEXT: store i32* [[B]], i32** [[C]], align 64 +; CGSCC-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]]) +; CGSCC-NEXT: ret void ; entry: %b = alloca i32, align 32 @@ -277,27 +178,16 @@ ; Note that the first two arguments are provided by the callback_broker according to the callback in !1 below! ; The others are annotated with alignment information, amongst others, or even replaced by the constants passed to the call. -; ; 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 @@ -312,61 +202,34 @@ declare !callback !0 void @t2_callback_broker(i32* nocapture , i32* nocapture , void (i32*, i32*, ...)* nocapture, ...) ; Test 3 -; ; 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 +; MODULE-LABEL: define {{[^@]+}}@t3_caller +; MODULE-SAME: (i32* noalias nocapture align 256 [[A:%.*]]) { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[B:%.*]] = alloca i32, align 32 +; MODULE-NEXT: [[C:%.*]] = alloca i32*, align 64 +; MODULE-NEXT: [[PTR:%.*]] = alloca i32, align 128 +; MODULE-NEXT: [[TMP0:%.*]] = bitcast i32* [[B]] to i8* +; MODULE-NEXT: store i32 42, i32* [[B]], align 32 +; MODULE-NEXT: store i32* [[B]], i32** [[C]], align 64 +; MODULE-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]]) +; MODULE-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]]) +; MODULE-NEXT: ret void +; +; CGSCC-LABEL: define {{[^@]+}}@t3_caller +; CGSCC-SAME: (i32* noalias nocapture align 256 [[A:%.*]]) { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[B:%.*]] = alloca i32, align 32 +; CGSCC-NEXT: [[C:%.*]] = alloca i32*, align 64 +; CGSCC-NEXT: [[PTR:%.*]] = alloca i32, align 128 +; CGSCC-NEXT: [[TMP0:%.*]] = bitcast i32* [[B]] to i8* +; CGSCC-NEXT: store i32 42, i32* [[B]], align 32 +; CGSCC-NEXT: store i32* [[B]], i32** [[C]], align 64 +; CGSCC-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]]) +; CGSCC-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]]) +; CGSCC-NEXT: ret void ; entry: %b = alloca i32, align 32 @@ -382,27 +245,16 @@ ; Note that the first two arguments are provided by the callback_broker according to the callback in !1 below! ; The others are annotated with alignment information, amongst others, or even replaced by the constants passed to the call. -; ; 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 +271,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,13 +1,11 @@ ; 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 -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,MODULE -; 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 +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC define dso_local i32 @test_range1(i32 %0) #0 { ; CHECK-LABEL: define {{[^@]+}}@test_range1 @@ -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 } +; MODULE: attributes #[[ATTR0]] = { nofree noinline nosync nounwind readnone sspstrong uwtable willreturn } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone sspstrong uwtable willreturn } +; CGSCC: 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,13 +1,11 @@ ; 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 -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,MODULE -; 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 +; 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,CGSCC define dso_local i32 @test_range1(i32 %0) #0 { ; CHECK-LABEL: define {{[^@]+}}@test_range1 @@ -101,9 +99,6 @@ ; CHECK-NEXT: [[TMP4:%.*]] = zext i1 [[TMP3]] to i32 ; CHECK-NEXT: ret i32 [[TMP4]] ; -; IS__TUNIT_____ENABLED-LABEL: define {{[^@]+}}@test_pcheck1 -; IS__TUNIT_____ENABLED-SAME: (i32 [[TMP0:%.*]]) -; IS__TUNIT_____ENABLED-NEXT: ret i32 1 %2 = call i32 @test(i32 %0, i32 1) %3 = icmp slt i32 %2, 101 %4 = zext i1 %3 to i32 @@ -157,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 } +; MODULE: attributes #[[ATTR0]] = { nofree noinline nosync nounwind readnone sspstrong uwtable willreturn } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone sspstrong uwtable willreturn } +; CGSCC: 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,13 +1,11 @@ ; 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 -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,MODULE -; 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 +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC define i32 @test_range(i32 %unknown) { ; CHECK-LABEL: define {{[^@]+}}@test_range @@ -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]] +; MODULE-LABEL: define {{[^@]+}}@test1 +; MODULE-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR0]], !range [[RNG0:![0-9]+]] +; MODULE-NEXT: [[TMP2:%.*]] = sub nsw i32 [[TMP1]], [[B]] +; MODULE-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]] +; CGSCC-LABEL: define {{[^@]+}}@test1 +; CGSCC-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR1:[0-9]+]], !range [[RNG0:![0-9]+]] +; CGSCC-NEXT: [[TMP2:%.*]] = sub nsw i32 [[TMP1]], [[B]] +; CGSCC-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]] +; MODULE-LABEL: define {{[^@]+}}@test2 +; MODULE-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR0]], !range [[RNG0]] +; MODULE-NEXT: [[TMP2:%.*]] = add nsw i32 [[TMP1]], [[B]] +; MODULE-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]] +; CGSCC-LABEL: define {{[^@]+}}@test2 +; CGSCC-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR1]], !range [[RNG0]] +; CGSCC-NEXT: [[TMP2:%.*]] = add nsw i32 [[TMP1]], [[B]] +; CGSCC-NEXT: ret i32 [[TMP2]] ; %1 = call i32 @test_range(i32 %unknown) %2 = add nsw i32 %1, %b @@ -60,19 +58,19 @@ ; Positive checks define i32 @test1_pcheck(i32 %unknown) { -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test1_pcheck -; NOT_CGSCC_NPM-SAME: (i32 [[UNKNOWN:%.*]]) #[[ATTR0]] { -; NOT_CGSCC_NPM-NEXT: [[TMP1:%.*]] = call i32 @test1(i32 [[UNKNOWN]], i32 noundef 20) -; NOT_CGSCC_NPM-NEXT: [[TMP2:%.*]] = icmp sle i32 [[TMP1]], 90 -; NOT_CGSCC_NPM-NEXT: [[TMP3:%.*]] = zext i1 [[TMP2]] to i32 -; NOT_CGSCC_NPM-NEXT: ret i32 [[TMP3]] +; MODULE-LABEL: define {{[^@]+}}@test1_pcheck +; MODULE-SAME: (i32 [[UNKNOWN:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[TMP1:%.*]] = call i32 @test1(i32 [[UNKNOWN]], i32 noundef 20) +; MODULE-NEXT: [[TMP2:%.*]] = icmp sle i32 [[TMP1]], 90 +; MODULE-NEXT: [[TMP3:%.*]] = zext i1 [[TMP2]] to i32 +; MODULE-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]] +; CGSCC-LABEL: define {{[^@]+}}@test1_pcheck +; CGSCC-SAME: (i32 [[UNKNOWN:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[TMP1:%.*]] = call i32 @test1(i32 [[UNKNOWN]], i32 noundef 20) #[[ATTR1]], !range [[RNG1:![0-9]+]] +; CGSCC-NEXT: [[TMP2:%.*]] = icmp sle i32 [[TMP1]], 90 +; CGSCC-NEXT: [[TMP3:%.*]] = zext i1 [[TMP2]] to i32 +; CGSCC-NEXT: ret i32 [[TMP3]] ; %1 = call i32 @test1(i32 %unknown, i32 20) %2 = icmp sle i32 %1, 90 @@ -97,19 +95,19 @@ ; Negative checks define i32 @test1_ncheck(i32 %unknown) { -; 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) -; 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]] +; MODULE-LABEL: define {{[^@]+}}@test1_ncheck +; MODULE-SAME: (i32 [[UNKNOWN:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[TMP1:%.*]] = call i32 @test1(i32 [[UNKNOWN]], i32 noundef 20) +; MODULE-NEXT: [[TMP2:%.*]] = icmp sle i32 [[TMP1]], 10 +; MODULE-NEXT: [[TMP3:%.*]] = zext i1 [[TMP2]] to i32 +; MODULE-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]] +; CGSCC-LABEL: define {{[^@]+}}@test1_ncheck +; CGSCC-SAME: (i32 [[UNKNOWN:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[TMP1:%.*]] = call i32 @test1(i32 [[UNKNOWN]], i32 noundef 20) #[[ATTR1]], !range [[RNG1]] +; CGSCC-NEXT: [[TMP2:%.*]] = icmp sle i32 [[TMP1]], 10 +; CGSCC-NEXT: [[TMP3:%.*]] = zext i1 [[TMP2]] to i32 +; CGSCC-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 } +; MODULE: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { readnone willreturn } +; CGSCC: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR1]] = { readnone willreturn } ;. -; NOT_CGSCC_NPM: [[META0:![0-9]+]] = !{i32 0, i32 101} +; MODULE: [[RNG0]] = !{i32 0, i32 101} ;. -; IS__CGSCC_NPM: [[RNG0]] = !{i32 0, i32 101} -; IS__CGSCC_NPM: [[RNG1]] = !{i32 -2147483647, i32 -2147483648} +; CGSCC: [[RNG0]] = !{i32 0, i32 101} +; CGSCC: [[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,13 +1,11 @@ ; 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 -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,MODULE -; 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 +; 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,CGSCC define i32 @test_range(i32 %unknown) { ; CHECK-LABEL: define {{[^@]+}}@test_range @@ -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]] +; MODULE-LABEL: define {{[^@]+}}@test1 +; MODULE-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR0]], !range [[RNG0:![0-9]+]] +; MODULE-NEXT: [[TMP2:%.*]] = sub nsw i32 [[TMP1]], [[B]] +; MODULE-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]] +; CGSCC-LABEL: define {{[^@]+}}@test1 +; CGSCC-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR1:[0-9]+]], !range [[RNG0:![0-9]+]] +; CGSCC-NEXT: [[TMP2:%.*]] = sub nsw i32 [[TMP1]], [[B]] +; CGSCC-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]] +; MODULE-LABEL: define {{[^@]+}}@test2 +; MODULE-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR0]], !range [[RNG0]] +; MODULE-NEXT: [[TMP2:%.*]] = add nsw i32 [[TMP1]], [[B]] +; MODULE-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]] +; CGSCC-LABEL: define {{[^@]+}}@test2 +; CGSCC-SAME: (i32 [[UNKNOWN:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[TMP1:%.*]] = call i32 @test_range(i32 [[UNKNOWN]]) #[[ATTR1]], !range [[RNG0]] +; CGSCC-NEXT: [[TMP2:%.*]] = add nsw i32 [[TMP1]], [[B]] +; CGSCC-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]] +; MODULE-LABEL: define {{[^@]+}}@test1_ncheck +; MODULE-SAME: (i32 [[UNKNOWN:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[TMP1:%.*]] = call i32 @test1(i32 [[UNKNOWN]], i32 noundef 20) #[[ATTR0]], !range [[RNG1:![0-9]+]] +; MODULE-NEXT: [[TMP2:%.*]] = icmp sle i32 [[TMP1]], 10 +; MODULE-NEXT: [[TMP3:%.*]] = zext i1 [[TMP2]] to i32 +; MODULE-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]] +; CGSCC-LABEL: define {{[^@]+}}@test1_ncheck +; CGSCC-SAME: (i32 [[UNKNOWN:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[TMP1:%.*]] = call i32 @test1(i32 [[UNKNOWN]], i32 noundef 20) #[[ATTR1]], !range [[RNG1:![0-9]+]] +; CGSCC-NEXT: [[TMP2:%.*]] = icmp sle i32 [[TMP1]], 10 +; CGSCC-NEXT: [[TMP3:%.*]] = zext i1 [[TMP2]] to i32 +; CGSCC-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]] +; MODULE-LABEL: define {{[^@]+}}@test2_ncheck +; MODULE-SAME: (i32 [[UNKNOWN:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[TMP1:%.*]] = call i32 @test2(i32 [[UNKNOWN]], i32 noundef 20) #[[ATTR0]], !range [[RNG2:![0-9]+]] +; MODULE-NEXT: [[TMP2:%.*]] = icmp sge i32 [[TMP1]], 30 +; MODULE-NEXT: [[TMP3:%.*]] = zext i1 [[TMP2]] to i32 +; MODULE-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]] +; CGSCC-LABEL: define {{[^@]+}}@test2_ncheck +; CGSCC-SAME: (i32 [[UNKNOWN:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[TMP1:%.*]] = call i32 @test2(i32 [[UNKNOWN]], i32 noundef 20) #[[ATTR1]], !range [[RNG2:![0-9]+]] +; CGSCC-NEXT: [[TMP2:%.*]] = icmp sge i32 [[TMP1]], 30 +; CGSCC-NEXT: [[TMP3:%.*]] = zext i1 [[TMP2]] to i32 +; CGSCC-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 } +; MODULE: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR1]] = { readnone willreturn } +; CGSCC: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: 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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC 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,29 +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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; FIXME: Figure out why we need 16 iterations here. declare void @deref_phi_user(i32* %a); ; TEST 1 ; 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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test1 +; MODULE-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]+]] { +; MODULE-NEXT: [[TMP4:%.*]] = bitcast double* [[TMP1]] to i32* +; MODULE-NEXT: [[TMP5:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP4]] +; MODULE-NEXT: ret i32* [[TMP5]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test1 +; 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]+]] { +; CGSCC-NEXT: [[TMP4:%.*]] = bitcast double* [[TMP1]] to i32* +; CGSCC-NEXT: [[TMP5:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP4]] +; CGSCC-NEXT: ret i32* [[TMP5]] ; %4 = bitcast double* %1 to i32* %5 = select i1 %2, i32* %0, i32* %4 @@ -32,19 +29,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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test2 +; MODULE-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]] { +; MODULE-NEXT: [[TMP4:%.*]] = bitcast double* [[TMP1]] to i32* +; MODULE-NEXT: [[TMP5:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP4]] +; MODULE-NEXT: ret i32* [[TMP5]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test2 +; 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]] { +; CGSCC-NEXT: [[TMP4:%.*]] = bitcast double* [[TMP1]] to i32* +; CGSCC-NEXT: [[TMP5:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP4]] +; CGSCC-NEXT: ret i32* [[TMP5]] ; %4 = bitcast double* %1 to i32* %5 = select i1 %2, i32* %0, i32* %4 @@ -54,55 +51,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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test3_1 +; MODULE-SAME: (i32* nofree nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { +; MODULE-NEXT: [[RET:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 1 +; MODULE-NEXT: ret i32* [[RET]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test3_1 +; CGSCC-SAME: (i32* nofree nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { +; CGSCC-NEXT: [[RET:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 1 +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test3_2 +; MODULE-SAME: (i32* nofree readnone dereferenceable_or_null(32) "no-capture-maybe-returned" [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { +; MODULE-NEXT: [[RET:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 4 +; MODULE-NEXT: ret i32* [[RET]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test3_2 +; CGSCC-SAME: (i32* nofree readnone dereferenceable_or_null(32) "no-capture-maybe-returned" [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { +; CGSCC-NEXT: [[RET:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 4 +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test3_3 +; MODULE-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]] { +; MODULE-NEXT: [[RET1:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 1 +; MODULE-NEXT: [[RET2:%.*]] = getelementptr inbounds i32, i32* [[TMP1]], i64 2 +; MODULE-NEXT: [[RET:%.*]] = select i1 [[TMP2]], i32* [[RET1]], i32* [[RET2]] +; MODULE-NEXT: ret i32* [[RET]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test3_3 +; 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]] { +; CGSCC-NEXT: [[RET1:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 1 +; CGSCC-NEXT: [[RET2:%.*]] = getelementptr inbounds i32, i32* [[TMP1]], i64 2 +; CGSCC-NEXT: [[RET:%.*]] = select i1 [[TMP2]], i32* [[RET1]], i32* [[RET2]] +; CGSCC-NEXT: ret i32* [[RET]] ; %ret1 = getelementptr inbounds i32, i32* %0, i64 1 %ret2 = getelementptr inbounds i32, i32* %1, i64 2 @@ -114,15 +111,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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test4 +; MODULE-SAME: (i32* nofree nonnull readnone returned dereferenceable(8) "no-capture-maybe-returned" [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { +; MODULE-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]] +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test4 +; CGSCC-SAME: (i32* nofree nonnull readnone returned dereferenceable(8) "no-capture-maybe-returned" [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { +; CGSCC-NEXT: ret i32* [[TMP0]] ; ret i32* %0 } @@ -321,19 +318,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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@test_for_minus_index +; MODULE-SAME: (i32* nofree nonnull writeonly align 4 "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR2:[0-9]+]] { +; MODULE-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 -2 +; MODULE-NEXT: store i32 1, i32* [[Q]], align 4 +; MODULE-NEXT: ret i32* [[Q]] +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@test_for_minus_index +; CGSCC-SAME: (i32* nofree nonnull writeonly align 4 "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR2:[0-9]+]] { +; CGSCC-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 -2 +; CGSCC-NEXT: store i32 1, i32* [[Q]], align 4 +; CGSCC-NEXT: ret i32* [[Q]] ; %q = getelementptr inbounds i32, i32* %p, i32 -2 store i32 1, i32* %q @@ -341,17 +338,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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@deref_or_null_and_nonnull +; MODULE-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(100) [[TMP0:%.*]]) #[[ATTR2]] { +; MODULE-NEXT: store i32 1, i32* [[TMP0]], align 4 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@deref_or_null_and_nonnull +; CGSCC-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(100) [[TMP0:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: store i32 1, i32* [[TMP0]], align 4 +; CGSCC-NEXT: ret void ; store i32 1, i32* %0 ret void @@ -366,73 +363,39 @@ ; FIXME: %ptr should be dereferenceable(31) define void @test8(i8* %ptr) #0 { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind writeonly -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test8 -; IS__TUNIT_OPM-SAME: (i8* nocapture nofree nonnull writeonly [[PTR:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: br label [[TMP1:%.*]] -; IS__TUNIT_OPM: 1: -; IS__TUNIT_OPM-NEXT: [[I_0:%.*]] = phi i32 [ 20, [[TMP0:%.*]] ], [ [[TMP4:%.*]], [[TMP5:%.*]] ] -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = sext i32 [[I_0]] to i64 -; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[TMP2]] -; IS__TUNIT_OPM-NEXT: store i8 32, i8* [[TMP3]], align 1 -; IS__TUNIT_OPM-NEXT: [[TMP4]] = add nsw i32 [[I_0]], 1 -; IS__TUNIT_OPM-NEXT: br label [[TMP5]] -; IS__TUNIT_OPM: 5: -; IS__TUNIT_OPM-NEXT: [[TMP6:%.*]] = icmp slt i32 [[TMP4]], 30 -; IS__TUNIT_OPM-NEXT: br i1 [[TMP6]], label [[TMP1]], label [[TMP7:%.*]] -; IS__TUNIT_OPM: 7: -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test8 -; IS__TUNIT_NPM-SAME: (i8* nocapture nofree nonnull writeonly dereferenceable(21) [[PTR:%.*]]) #[[ATTR2]] { -; IS__TUNIT_NPM-NEXT: br label [[TMP1:%.*]] -; IS__TUNIT_NPM: 1: -; IS__TUNIT_NPM-NEXT: [[I_0:%.*]] = phi i32 [ 20, [[TMP0:%.*]] ], [ [[TMP4:%.*]], [[TMP5:%.*]] ] -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = sext i32 [[I_0]] to i64 -; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[TMP2]] -; IS__TUNIT_NPM-NEXT: store i8 32, i8* [[TMP3]], align 1 -; IS__TUNIT_NPM-NEXT: [[TMP4]] = add nsw i32 [[I_0]], 1 -; IS__TUNIT_NPM-NEXT: br label [[TMP5]] -; IS__TUNIT_NPM: 5: -; IS__TUNIT_NPM-NEXT: [[TMP6:%.*]] = icmp slt i32 [[TMP4]], 30 -; IS__TUNIT_NPM-NEXT: br i1 [[TMP6]], label [[TMP1]], label [[TMP7:%.*]] -; IS__TUNIT_NPM: 7: -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test8 -; IS__CGSCC_OPM-SAME: (i8* nocapture nofree nonnull writeonly [[PTR:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: br label [[TMP1:%.*]] -; IS__CGSCC_OPM: 1: -; IS__CGSCC_OPM-NEXT: [[I_0:%.*]] = phi i32 [ 20, [[TMP0:%.*]] ], [ [[TMP4:%.*]], [[TMP5:%.*]] ] -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = sext i32 [[I_0]] to i64 -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[TMP2]] -; IS__CGSCC_OPM-NEXT: store i8 32, i8* [[TMP3]], align 1 -; IS__CGSCC_OPM-NEXT: [[TMP4]] = add nsw i32 [[I_0]], 1 -; IS__CGSCC_OPM-NEXT: br label [[TMP5]] -; IS__CGSCC_OPM: 5: -; IS__CGSCC_OPM-NEXT: [[TMP6:%.*]] = icmp slt i32 [[TMP4]], 30 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP6]], label [[TMP1]], label [[TMP7:%.*]] -; IS__CGSCC_OPM: 7: -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test8 -; IS__CGSCC_NPM-SAME: (i8* nocapture nofree nonnull writeonly dereferenceable(21) [[PTR:%.*]]) #[[ATTR2]] { -; IS__CGSCC_NPM-NEXT: br label [[TMP1:%.*]] -; IS__CGSCC_NPM: 1: -; IS__CGSCC_NPM-NEXT: [[I_0:%.*]] = phi i32 [ 20, [[TMP0:%.*]] ], [ [[TMP4:%.*]], [[TMP5:%.*]] ] -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = sext i32 [[I_0]] to i64 -; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[TMP2]] -; IS__CGSCC_NPM-NEXT: store i8 32, i8* [[TMP3]], align 1 -; IS__CGSCC_NPM-NEXT: [[TMP4]] = add nsw i32 [[I_0]], 1 -; IS__CGSCC_NPM-NEXT: br label [[TMP5]] -; IS__CGSCC_NPM: 5: -; IS__CGSCC_NPM-NEXT: [[TMP6:%.*]] = icmp slt i32 [[TMP4]], 30 -; IS__CGSCC_NPM-NEXT: br i1 [[TMP6]], label [[TMP1]], label [[TMP7:%.*]] -; IS__CGSCC_NPM: 7: -; IS__CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@test8 +; MODULE-SAME: (i8* nocapture nofree nonnull writeonly dereferenceable(21) [[PTR:%.*]]) #[[ATTR2]] { +; MODULE-NEXT: br label [[TMP1:%.*]] +; MODULE: 1: +; MODULE-NEXT: [[I_0:%.*]] = phi i32 [ 20, [[TMP0:%.*]] ], [ [[TMP4:%.*]], [[TMP5:%.*]] ] +; MODULE-NEXT: [[TMP2:%.*]] = sext i32 [[I_0]] to i64 +; MODULE-NEXT: [[TMP3:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[TMP2]] +; MODULE-NEXT: store i8 32, i8* [[TMP3]], align 1 +; MODULE-NEXT: [[TMP4]] = add nsw i32 [[I_0]], 1 +; MODULE-NEXT: br label [[TMP5]] +; MODULE: 5: +; MODULE-NEXT: [[TMP6:%.*]] = icmp slt i32 [[TMP4]], 30 +; MODULE-NEXT: br i1 [[TMP6]], label [[TMP1]], label [[TMP7:%.*]] +; MODULE: 7: +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@test8 +; CGSCC-SAME: (i8* nocapture nofree nonnull writeonly dereferenceable(21) [[PTR:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: br label [[TMP1:%.*]] +; CGSCC: 1: +; CGSCC-NEXT: [[I_0:%.*]] = phi i32 [ 20, [[TMP0:%.*]] ], [ [[TMP4:%.*]], [[TMP5:%.*]] ] +; CGSCC-NEXT: [[TMP2:%.*]] = sext i32 [[I_0]] to i64 +; CGSCC-NEXT: [[TMP3:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[TMP2]] +; CGSCC-NEXT: store i8 32, i8* [[TMP3]], align 1 +; CGSCC-NEXT: [[TMP4]] = add nsw i32 [[I_0]], 1 +; CGSCC-NEXT: br label [[TMP5]] +; CGSCC: 5: +; CGSCC-NEXT: [[TMP6:%.*]] = icmp slt i32 [[TMP4]], 30 +; CGSCC-NEXT: br i1 [[TMP6]], label [[TMP1]], label [[TMP7:%.*]] +; CGSCC: 7: +; CGSCC-NEXT: ret void ; br label %1 1: ; preds = %5, %0 @@ -452,21 +415,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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@test8_neg +; MODULE-SAME: (i32 [[I:%.*]], i8* nocapture nofree nonnull writeonly [[PTR:%.*]]) #[[ATTR2]] { +; MODULE-NEXT: [[TMP1:%.*]] = sext i32 [[I]] to i64 +; MODULE-NEXT: [[TMP2:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[TMP1]] +; MODULE-NEXT: store i8 65, i8* [[TMP2]], align 1 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@test8_neg +; CGSCC-SAME: (i32 [[I:%.*]], i8* nocapture nofree nonnull writeonly [[PTR:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: [[TMP1:%.*]] = sext i32 [[I]] to i64 +; CGSCC-NEXT: [[TMP2:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[TMP1]] +; CGSCC-NEXT: store i8 65, i8* [[TMP2]], align 1 +; CGSCC-NEXT: ret void ; %1 = sext i32 %i to i64 %2 = getelementptr inbounds i8, i8* %ptr, i64 %1 @@ -483,73 +446,39 @@ ; NOTE: %p should not be dereferenceable define internal void @fill_range_not_inbounds(i32* %p, i64 %start){ -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind writeonly -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fill_range_not_inbounds -; IS__TUNIT_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR3]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 -; IS__TUNIT_OPM-NEXT: br label [[FOR_BODY:%.*]] -; IS__TUNIT_OPM: for.cond.cleanup: -; IS__TUNIT_OPM-NEXT: ret void -; IS__TUNIT_OPM: for.body: -; IS__TUNIT_OPM-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] -; IS__TUNIT_OPM-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 -; IS__TUNIT_OPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr i32, i32* [[P]], i64 [[I_06]] -; IS__TUNIT_OPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 -; IS__TUNIT_OPM-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 -; IS__TUNIT_OPM-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] -; IS__TUNIT_OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@fill_range_not_inbounds -; IS__TUNIT_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR2]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 -; IS__TUNIT_NPM-NEXT: br label [[FOR_BODY:%.*]] -; IS__TUNIT_NPM: for.cond.cleanup: -; IS__TUNIT_NPM-NEXT: ret void -; IS__TUNIT_NPM: for.body: -; IS__TUNIT_NPM-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] -; IS__TUNIT_NPM-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 -; IS__TUNIT_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr i32, i32* [[P]], i64 [[I_06]] -; IS__TUNIT_NPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 -; IS__TUNIT_NPM-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 -; IS__TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] -; IS__TUNIT_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@fill_range_not_inbounds -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR3]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 -; IS__CGSCC_OPM-NEXT: br label [[FOR_BODY:%.*]] -; IS__CGSCC_OPM: for.cond.cleanup: -; IS__CGSCC_OPM-NEXT: ret void -; IS__CGSCC_OPM: for.body: -; IS__CGSCC_OPM-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] -; IS__CGSCC_OPM-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr i32, i32* [[P]], i64 [[I_06]] -; IS__CGSCC_OPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 -; IS__CGSCC_OPM-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 -; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] -; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fill_range_not_inbounds -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR2]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 -; IS__CGSCC_NPM-NEXT: br label [[FOR_BODY:%.*]] -; IS__CGSCC_NPM: for.cond.cleanup: -; IS__CGSCC_NPM-NEXT: ret void -; IS__CGSCC_NPM: for.body: -; IS__CGSCC_NPM-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] -; IS__CGSCC_NPM-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr i32, i32* [[P]], i64 [[I_06]] -; IS__CGSCC_NPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 -; IS__CGSCC_NPM-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 -; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] -; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@fill_range_not_inbounds +; MODULE-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR2]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 +; MODULE-NEXT: br label [[FOR_BODY:%.*]] +; MODULE: for.cond.cleanup: +; MODULE-NEXT: ret void +; MODULE: for.body: +; MODULE-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] +; MODULE-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 +; MODULE-NEXT: [[ARRAYIDX:%.*]] = getelementptr i32, i32* [[P]], i64 [[I_06]] +; MODULE-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 +; MODULE-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 +; MODULE-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] +; MODULE-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@fill_range_not_inbounds +; CGSCC-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 +; CGSCC-NEXT: br label [[FOR_BODY:%.*]] +; CGSCC: for.cond.cleanup: +; CGSCC-NEXT: ret void +; CGSCC: for.body: +; CGSCC-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] +; CGSCC-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 +; CGSCC-NEXT: [[ARRAYIDX:%.*]] = getelementptr i32, i32* [[P]], i64 [[I_06]] +; CGSCC-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 +; CGSCC-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 +; CGSCC-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] +; CGSCC-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; entry: %0 = add nsw i64 %start, 9 @@ -570,73 +499,39 @@ ; FIXME: %p should be dereferenceable(40) define internal void @fill_range_inbounds(i32* %p, i64 %start){ -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind writeonly -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fill_range_inbounds -; IS__TUNIT_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR3]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 -; IS__TUNIT_OPM-NEXT: br label [[FOR_BODY:%.*]] -; IS__TUNIT_OPM: for.cond.cleanup: -; IS__TUNIT_OPM-NEXT: ret void -; IS__TUNIT_OPM: for.body: -; IS__TUNIT_OPM-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] -; IS__TUNIT_OPM-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 -; IS__TUNIT_OPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 [[I_06]] -; IS__TUNIT_OPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 -; IS__TUNIT_OPM-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 -; IS__TUNIT_OPM-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] -; IS__TUNIT_OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@fill_range_inbounds -; IS__TUNIT_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR2]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 -; IS__TUNIT_NPM-NEXT: br label [[FOR_BODY:%.*]] -; IS__TUNIT_NPM: for.cond.cleanup: -; IS__TUNIT_NPM-NEXT: ret void -; IS__TUNIT_NPM: for.body: -; IS__TUNIT_NPM-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] -; IS__TUNIT_NPM-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 -; IS__TUNIT_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 [[I_06]] -; IS__TUNIT_NPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 -; IS__TUNIT_NPM-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 -; IS__TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] -; IS__TUNIT_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind writeonly -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@fill_range_inbounds -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR3]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 -; IS__CGSCC_OPM-NEXT: br label [[FOR_BODY:%.*]] -; IS__CGSCC_OPM: for.cond.cleanup: -; IS__CGSCC_OPM-NEXT: ret void -; IS__CGSCC_OPM: for.body: -; IS__CGSCC_OPM-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] -; IS__CGSCC_OPM-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 [[I_06]] -; IS__CGSCC_OPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 -; IS__CGSCC_OPM-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 -; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] -; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fill_range_inbounds -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR2]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 -; IS__CGSCC_NPM-NEXT: br label [[FOR_BODY:%.*]] -; IS__CGSCC_NPM: for.cond.cleanup: -; IS__CGSCC_NPM-NEXT: ret void -; IS__CGSCC_NPM: for.body: -; IS__CGSCC_NPM-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] -; IS__CGSCC_NPM-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 [[I_06]] -; IS__CGSCC_NPM-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 -; IS__CGSCC_NPM-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 -; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] -; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@fill_range_inbounds +; MODULE-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR2]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 +; MODULE-NEXT: br label [[FOR_BODY:%.*]] +; MODULE: for.cond.cleanup: +; MODULE-NEXT: ret void +; MODULE: for.body: +; MODULE-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] +; MODULE-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 +; MODULE-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 [[I_06]] +; MODULE-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 +; MODULE-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 +; MODULE-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] +; MODULE-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@fill_range_inbounds +; CGSCC-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64 [[START:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[TMP0:%.*]] = add nsw i64 [[START]], 9 +; CGSCC-NEXT: br label [[FOR_BODY:%.*]] +; CGSCC: for.cond.cleanup: +; CGSCC-NEXT: ret void +; CGSCC: for.body: +; CGSCC-NEXT: [[I_06:%.*]] = phi i64 [ [[START]], [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ] +; CGSCC-NEXT: [[CONV:%.*]] = trunc i64 [[I_06]] to i32 +; CGSCC-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 [[I_06]] +; CGSCC-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX]], align 4 +; CGSCC-NEXT: [[INC]] = add nsw i64 [[I_06]], 1 +; CGSCC-NEXT: [[CMP:%.*]] = icmp slt i64 [[I_06]], [[TMP0]] +; CGSCC-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; entry: %0 = add nsw i64 %start, 9 @@ -656,41 +551,23 @@ } define void @call_fill_range(i32* nocapture %p, i64* nocapture readonly %range) { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@call_fill_range -; IS__TUNIT_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[RANGE:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: [[TMP0:%.*]] = load i64, i64* [[RANGE]], align 8, !range [[RNG0:![0-9]+]] -; IS__TUNIT_OPM-NEXT: tail call void @fill_range_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR6:[0-9]+]] -; IS__TUNIT_OPM-NEXT: tail call void @fill_range_not_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR6]] -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@call_fill_range -; IS__TUNIT_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[RANGE:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i64, i64* [[RANGE]], align 8, !range [[RNG0:![0-9]+]] -; IS__TUNIT_NPM-NEXT: tail call void @fill_range_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR6:[0-9]+]] -; IS__TUNIT_NPM-NEXT: tail call void @fill_range_not_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR6]] -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@call_fill_range -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[RANGE:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = load i64, i64* [[RANGE]], align 8, !range [[RNG0:![0-9]+]] -; IS__CGSCC_OPM-NEXT: tail call void @fill_range_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR7:[0-9]+]] -; IS__CGSCC_OPM-NEXT: tail call void @fill_range_not_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR7]] -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@call_fill_range -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[RANGE:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i64, i64* [[RANGE]], align 8, !range [[RNG0:![0-9]+]] -; IS__CGSCC_NPM-NEXT: tail call void @fill_range_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR6:[0-9]+]] -; IS__CGSCC_NPM-NEXT: tail call void @fill_range_not_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR6]] -; IS__CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@call_fill_range +; MODULE-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[RANGE:%.*]]) #[[ATTR3:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[TMP0:%.*]] = load i64, i64* [[RANGE]], align 8, !range [[RNG0:![0-9]+]] +; MODULE-NEXT: tail call void @fill_range_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR6:[0-9]+]] +; MODULE-NEXT: tail call void @fill_range_not_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR6]] +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@call_fill_range +; CGSCC-SAME: (i32* nocapture nofree writeonly [[P:%.*]], i64* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[RANGE:%.*]]) #[[ATTR3:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[TMP0:%.*]] = load i64, i64* [[RANGE]], align 8, !range [[RNG0:![0-9]+]] +; CGSCC-NEXT: tail call void @fill_range_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR6:[0-9]+]] +; CGSCC-NEXT: tail call void @fill_range_not_inbounds(i32* nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR6]] +; CGSCC-NEXT: ret void ; entry: %0 = load i64, i64* %range, align 8, !range !0 @@ -789,62 +666,61 @@ ; *ptr = 4; ; } ; } -; ; 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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@rec-branch-1 +; MODULE-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]], i32* nocapture nofree writeonly [[PTR:%.*]]) #[[ATTR2]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[A]], 0 +; MODULE-NEXT: br i1 [[TOBOOL]], label [[IF_ELSE3:%.*]], label [[IF_THEN:%.*]] +; MODULE: if.then: +; MODULE-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[B]], 0 +; MODULE-NEXT: br i1 [[TOBOOL1]], label [[IF_ELSE:%.*]], label [[IF_THEN2:%.*]] +; MODULE: if.then2: +; MODULE-NEXT: store i32 1, i32* [[PTR]], align 4 +; MODULE-NEXT: br label [[IF_END8:%.*]] +; MODULE: if.else: +; MODULE-NEXT: store i32 2, i32* [[PTR]], align 4 +; MODULE-NEXT: br label [[IF_END8]] +; MODULE: if.else3: +; MODULE-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 0 +; MODULE-NEXT: br i1 [[TOBOOL4]], label [[IF_ELSE6:%.*]], label [[IF_THEN5:%.*]] +; MODULE: if.then5: +; MODULE-NEXT: store i32 3, i32* [[PTR]], align 4 +; MODULE-NEXT: br label [[IF_END8]] +; MODULE: if.else6: +; MODULE-NEXT: store i32 4, i32* [[PTR]], align 4 +; MODULE-NEXT: br label [[IF_END8]] +; MODULE: if.end8: +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@rec-branch-1 +; CGSCC-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]], i32* nocapture nofree writeonly [[PTR:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[A]], 0 +; CGSCC-NEXT: br i1 [[TOBOOL]], label [[IF_ELSE3:%.*]], label [[IF_THEN:%.*]] +; CGSCC: if.then: +; CGSCC-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[B]], 0 +; CGSCC-NEXT: br i1 [[TOBOOL1]], label [[IF_ELSE:%.*]], label [[IF_THEN2:%.*]] +; CGSCC: if.then2: +; CGSCC-NEXT: store i32 1, i32* [[PTR]], align 4 +; CGSCC-NEXT: br label [[IF_END8:%.*]] +; CGSCC: if.else: +; CGSCC-NEXT: store i32 2, i32* [[PTR]], align 4 +; CGSCC-NEXT: br label [[IF_END8]] +; CGSCC: if.else3: +; CGSCC-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 0 +; CGSCC-NEXT: br i1 [[TOBOOL4]], label [[IF_ELSE6:%.*]], label [[IF_THEN5:%.*]] +; CGSCC: if.then5: +; CGSCC-NEXT: store i32 3, i32* [[PTR]], align 4 +; CGSCC-NEXT: br label [[IF_END8]] +; CGSCC: if.else6: +; CGSCC-NEXT: store i32 4, i32* [[PTR]], align 4 +; CGSCC-NEXT: br label [[IF_END8]] +; CGSCC: if.end8: +; CGSCC-NEXT: ret void ; entry: %tobool = icmp eq i32 %a, 0 @@ -893,86 +769,32 @@ ; } ; 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 @@ -1008,41 +830,17 @@ declare void @unknown() define void @nonnull_assume_pos(i8* %arg1, i8* %arg2, i8* %arg3, i8* %arg4) { -; ATTRIBUTOR-LABEL: define {{[^@]+}}@nonnull_assume_pos -; ATTRIBUTOR-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:%.*]]) -; ATTRIBUTOR-NEXT: call void @llvm.assume(i1 true) #6 [ "nonnull"(i8* undef), "dereferenceable"(i8* undef, i64 1), "dereferenceable"(i8* undef, i64 2), "dereferenceable"(i8* undef, i64 101), "dereferenceable_or_null"(i8* undef, i64 31), "dereferenceable_or_null"(i8* undef, i64 42) ] -; 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() ret void } define void @nonnull_assume_neg(i8* %arg1, i8* %arg2, i8* %arg3) { -; ATTRIBUTOR-LABEL: define {{[^@]+}}@nonnull_assume_neg -; ATTRIBUTOR-SAME: (i8* nocapture nofree readnone [[ARG1:%.*]], i8* nocapture nofree readnone [[ARG2:%.*]], i8* nocapture nofree readnone [[ARG3:%.*]]) -; ATTRIBUTOR-NEXT: call void @unknown() -; ATTRIBUTOR-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i8* undef, i64 101), "dereferenceable"(i8* undef, i64 -2), "dereferenceable_or_null"(i8* undef, i64 31) ] -; ATTRIBUTOR-NEXT: ret void -; ; CHECK-LABEL: define {{[^@]+}}@nonnull_assume_neg ; CHECK-SAME: (i8* nocapture nofree readnone [[ARG1:%.*]], i8* nocapture nofree readnone [[ARG2:%.*]], i8* nocapture nofree readnone [[ARG3:%.*]]) { ; CHECK-NEXT: call void @unknown() @@ -1054,77 +852,23 @@ ret void } define void @nonnull_assume_call(i8* %arg1, i8* %arg2, i8* %arg3, i8* %arg4) { -; ATTRIBUTOR-LABEL: define {{[^@]+}}@nonnull_assume_call -; ATTRIBUTOR-SAME: (i8* [[ARG1:%.*]], i8* [[ARG2:%.*]], i8* [[ARG3:%.*]], i8* [[ARG4:%.*]]) -; ATTRIBUTOR-NEXT: call void @unknown() -; ATTRIBUTOR-NEXT: [[P:%.*]] = call nonnull dereferenceable(101) i32* @unkown_ptr() -; ATTRIBUTOR-NEXT: call void @unknown_use32(i32* nonnull dereferenceable(101) [[P]]) -; ATTRIBUTOR-NEXT: call void @unknown_use8(i8* nonnull dereferenceable(42) [[ARG4]]) -; ATTRIBUTOR-NEXT: call void @unknown_use8(i8* nonnull [[ARG3]]) -; ATTRIBUTOR-NEXT: call void @unknown_use8(i8* nonnull dereferenceable(31) [[ARG2]]) -; ATTRIBUTOR-NEXT: call void @unknown_use8(i8* nonnull dereferenceable(2) [[ARG1]]) -; ATTRIBUTOR-NEXT: call void @llvm.assume(i1 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) ] -; ATTRIBUTOR-NEXT: call void @unknown_use8(i8* nonnull dereferenceable(2) [[ARG1]]) -; ATTRIBUTOR-NEXT: call void @unknown_use8(i8* nonnull dereferenceable(31) [[ARG2]]) -; ATTRIBUTOR-NEXT: call void @unknown_use8(i8* nonnull [[ARG3]]) -; ATTRIBUTOR-NEXT: call void @unknown_use8(i8* nonnull dereferenceable(42) [[ARG4]]) -; ATTRIBUTOR-NEXT: call void @unknown_use32(i32* nonnull dereferenceable(101) [[P]]) -; 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 +893,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 } +; MODULE: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR1]] = { nounwind willreturn } +; MODULE: attributes #[[ATTR2]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; MODULE: attributes #[[ATTR3]] = { argmemonly nofree nosync nounwind willreturn } +; MODULE: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind writeonly } +; MODULE: attributes #[[ATTR5:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } +; MODULE: attributes #[[ATTR6]] = { nofree nosync nounwind willreturn writeonly } +; MODULE: attributes #[[ATTR7]] = { nofree nosync nounwind writeonly } +; MODULE: attributes #[[ATTR8]] = { willreturn } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR1]] = { nounwind willreturn } +; CGSCC: attributes #[[ATTR2]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; CGSCC: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind writeonly } +; CGSCC: attributes #[[ATTR5:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR6]] = { nosync nounwind willreturn writeonly } +; CGSCC: attributes #[[ATTR7]] = { nofree nosync nounwind writeonly } +; CGSCC: attributes #[[ATTR8]] = { willreturn } +; CGSCC: 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,49 +1,46 @@ ; 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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; 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]] -; - ; GEP of index 0 is simplified away. +; MODULE: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@PR21780 +; MODULE-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 1 +; MODULE-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 2 +; MODULE-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 +; MODULE-NEXT: [[T0:%.*]] = load double, double* [[PTR]], align 8 +; MODULE-NEXT: [[T1:%.*]] = load double, double* [[ARRAYIDX1]], align 8 +; MODULE-NEXT: [[T2:%.*]] = load double, double* [[ARRAYIDX2]], align 8 +; MODULE-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; MODULE-NEXT: [[VECINIT0:%.*]] = insertelement <4 x double> poison, double [[T0]], i32 0 +; MODULE-NEXT: [[VECINIT1:%.*]] = insertelement <4 x double> [[VECINIT0]], double [[T1]], i32 1 +; MODULE-NEXT: [[VECINIT2:%.*]] = insertelement <4 x double> [[VECINIT1]], double [[T2]], i32 2 +; MODULE-NEXT: [[VECINIT3:%.*]] = insertelement <4 x double> [[VECINIT2]], double [[T3]], i32 3 +; MODULE-NEXT: [[SHUFFLE:%.*]] = shufflevector <4 x double> [[VECINIT3]], <4 x double> [[VECINIT3]], <4 x i32> +; MODULE-NEXT: ret <4 x double> [[SHUFFLE]] +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@PR21780 +; CGSCC-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 1 +; CGSCC-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 2 +; CGSCC-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 +; CGSCC-NEXT: [[T0:%.*]] = load double, double* [[PTR]], align 8 +; CGSCC-NEXT: [[T1:%.*]] = load double, double* [[ARRAYIDX1]], align 8 +; CGSCC-NEXT: [[T2:%.*]] = load double, double* [[ARRAYIDX2]], align 8 +; CGSCC-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; CGSCC-NEXT: [[VECINIT0:%.*]] = insertelement <4 x double> poison, double [[T0]], i32 0 +; CGSCC-NEXT: [[VECINIT1:%.*]] = insertelement <4 x double> [[VECINIT0]], double [[T1]], i32 1 +; CGSCC-NEXT: [[VECINIT2:%.*]] = insertelement <4 x double> [[VECINIT1]], double [[T2]], i32 2 +; CGSCC-NEXT: [[VECINIT3:%.*]] = insertelement <4 x double> [[VECINIT2]], double [[T3]], i32 3 +; CGSCC-NEXT: [[SHUFFLE:%.*]] = shufflevector <4 x double> [[VECINIT3]], <4 x double> [[VECINIT3]], <4 x i32> +; CGSCC-NEXT: ret <4 x double> [[SHUFFLE]] +; %arrayidx1 = getelementptr inbounds double, double* %ptr, i64 1 %arrayidx2 = getelementptr inbounds double, double* %ptr, i64 2 %arrayidx3 = getelementptr inbounds double, double* %ptr, i64 3 @@ -63,40 +60,39 @@ 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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@PR21780_only_access3_with_inbounds +; MODULE-SAME: (double* nocapture nofree nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 +; MODULE-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; MODULE-NEXT: ret double [[T3]] +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@PR21780_only_access3_with_inbounds +; CGSCC-SAME: (double* nocapture nofree nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 +; CGSCC-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; CGSCC-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]] -; - %arrayidx3 = getelementptr inbounds double, double* %ptr, i64 3 %t3 = load double, double* %arrayidx3, align 8 ret double %t3 } 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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@PR21780_only_access3_without_inbounds +; MODULE-SAME: (double* nocapture nofree readonly align 8 [[PTR:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 +; MODULE-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; MODULE-NEXT: ret double [[T3]] +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@PR21780_only_access3_without_inbounds +; CGSCC-SAME: (double* nocapture nofree readonly align 8 [[PTR:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 +; CGSCC-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; CGSCC-NEXT: ret double [[T3]] ; %arrayidx3 = getelementptr double, double* %ptr, i64 3 %t3 = load double, double* %arrayidx3, align 8 @@ -104,21 +100,20 @@ } 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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@PR21780_without_inbounds +; MODULE-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 +; MODULE-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; MODULE-NEXT: ret double [[T3]] +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@PR21780_without_inbounds +; CGSCC-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 +; CGSCC-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; CGSCC-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]] -; - %arrayidx1 = getelementptr double, double* %ptr, i64 1 %arrayidx2 = getelementptr double, double* %ptr, i64 2 %arrayidx3 = getelementptr double, double* %ptr, i64 3 @@ -134,21 +129,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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@gep0 +; MODULE-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]+]] { +; MODULE-NEXT: [[ARRAYIDX2:%.*]] = getelementptr i8, i8* [[PTR]], i64 2 +; MODULE-NEXT: [[T2:%.*]] = load i8, i8* [[ARRAYIDX2]], align 1 +; MODULE-NEXT: store i8 [[T2]], i8* [[OTHER]], align 1 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@gep0 +; 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]+]] { +; CGSCC-NEXT: [[ARRAYIDX2:%.*]] = getelementptr i8, i8* [[PTR]], i64 2 +; CGSCC-NEXT: [[T2:%.*]] = load i8, i8* [[ARRAYIDX2]], align 1 +; CGSCC-NEXT: store i8 [[T2]], i8* [[OTHER]], align 1 +; CGSCC-NEXT: ret void ; %arrayidx0 = getelementptr i8, i8* %ptr, i64 0 %arrayidx1 = getelementptr i8, i8* %ptr, i64 1 @@ -164,15 +159,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@ordering +; MODULE-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR1:%.*]], i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR2:%.*]]) #[[ATTR2:[0-9]+]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@ordering +; CGSCC-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR1:%.*]], i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR2:%.*]]) #[[ATTR2:[0-9]+]] { +; CGSCC-NEXT: ret void ; %a20 = getelementptr i32, i32* %ptr2, i64 0 %a12 = getelementptr i8, i8* %ptr1, i64 2 @@ -190,21 +185,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@not_entry_but_guaranteed_to_execute +; MODULE-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR:%.*]]) #[[ATTR2]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: br label [[EXIT:%.*]] +; MODULE: exit: +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@not_entry_but_guaranteed_to_execute +; CGSCC-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br label [[EXIT:%.*]] +; CGSCC: exit: +; CGSCC-NEXT: ret void ; entry: br label %exit @@ -221,25 +216,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@not_entry_not_guaranteed_to_execute +; MODULE-SAME: (i8* nocapture nofree readnone [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] +; MODULE: loads: +; MODULE-NEXT: ret void +; MODULE: exit: +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@not_entry_not_guaranteed_to_execute +; CGSCC-SAME: (i8* nocapture nofree readnone [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] +; CGSCC: loads: +; CGSCC-NEXT: ret void +; CGSCC: exit: +; CGSCC-NEXT: ret void ; entry: br i1 %cond, label %loads, label %exit @@ -258,25 +253,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@partial_in_entry +; MODULE-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(4) [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] +; MODULE: loads: +; MODULE-NEXT: ret void +; MODULE: exit: +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@partial_in_entry +; CGSCC-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(4) [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] +; CGSCC: loads: +; CGSCC-NEXT: ret void +; CGSCC: exit: +; CGSCC-NEXT: ret void ; entry: %arrayidx0 = getelementptr i16, i16* %ptr, i64 0 @@ -296,17 +291,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 +; MODULE: Function Attrs: argmemonly nofree nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@volatile_is_not_dereferenceable +; MODULE-SAME: (i16* nofree align 2 [[PTR:%.*]]) #[[ATTR3:[0-9]+]] { +; MODULE-NEXT: [[T0:%.*]] = load volatile i16, i16* [[PTR]], align 2 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@volatile_is_not_dereferenceable +; CGSCC-SAME: (i16* nofree align 2 [[PTR:%.*]]) #[[ATTR3:[0-9]+]] { +; CGSCC-NEXT: [[T0:%.*]] = load volatile i16, i16* [[PTR]], align 2 +; CGSCC-NEXT: ret void ; %arrayidx0 = getelementptr i16, i16* %ptr, i64 0 %arrayidx1 = getelementptr i16, i16* %ptr, i64 1 @@ -320,15 +315,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@atomic_is_alright +; MODULE-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(6) [[PTR:%.*]]) #[[ATTR2]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@atomic_is_alright +; CGSCC-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(6) [[PTR:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: ret void ; %arrayidx0 = getelementptr i16, i16* %ptr, i64 0 %arrayidx1 = getelementptr i16, i16* %ptr, i64 1 @@ -360,15 +355,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@variable_gep_index +; MODULE-SAME: (i8* nocapture nofree readnone [[UNUSED:%.*]], i8* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]], i64 [[VARIABLE_INDEX:%.*]]) #[[ATTR2]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@variable_gep_index +; CGSCC-SAME: (i8* nocapture nofree readnone [[UNUSED:%.*]], i8* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]], i64 [[VARIABLE_INDEX:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: ret void ; %arrayidx1 = getelementptr i8, i8* %ptr, i64 %variable_index %arrayidx2 = getelementptr i8, i8* %ptr, i64 2 @@ -382,15 +377,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@multi_index_gep +; MODULE-SAME: (<4 x i8>* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]]) #[[ATTR2]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@multi_index_gep +; CGSCC-SAME: (<4 x i8>* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: ret void ; %arrayidx00 = getelementptr <4 x i8>, <4 x i8>* %ptr, i64 0, i64 0 %t0 = load i8, i8* %arrayidx00 @@ -400,15 +395,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@not_byte_multiple +; MODULE-SAME: (i9* nocapture nofree nonnull readnone align 2 dereferenceable(2) [[PTR:%.*]]) #[[ATTR2]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@not_byte_multiple +; CGSCC-SAME: (i9* nocapture nofree nonnull readnone align 2 dereferenceable(2) [[PTR:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: ret void ; %arrayidx0 = getelementptr i9, i9* %ptr, i64 0 %t0 = load i9, i9* %arrayidx0 @@ -418,15 +413,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@no_pointer_deref +; MODULE-SAME: (i16* nocapture nofree readnone align 2 [[PTR:%.*]]) #[[ATTR2]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@no_pointer_deref +; CGSCC-SAME: (i16* nocapture nofree readnone align 2 [[PTR:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: ret void ; %arrayidx1 = getelementptr i16, i16* %ptr, i64 1 %arrayidx2 = getelementptr i16, i16* %ptr, i64 2 @@ -438,15 +433,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@non_consecutive +; MODULE-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR:%.*]]) #[[ATTR2]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_consecutive +; CGSCC-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: ret void ; %arrayidx1 = getelementptr i32, i32* %ptr, i64 1 %arrayidx0 = getelementptr i32, i32* %ptr, i64 0 @@ -460,15 +455,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@more_bytes +; MODULE-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@more_bytes +; CGSCC-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: ret void ; %arrayidx3 = getelementptr i32, i32* %ptr, i64 3 %arrayidx1 = getelementptr i32, i32* %ptr, i64 1 @@ -484,15 +479,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@more_bytes_and_not_null +; MODULE-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@more_bytes_and_not_null +; CGSCC-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: ret void ; %arrayidx3 = getelementptr i32, i32* %ptr, i64 3 %arrayidx1 = getelementptr i32, i32* %ptr, i64 1 @@ -508,15 +503,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@better_bytes +; MODULE-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(100) [[PTR:%.*]]) #[[ATTR2]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@better_bytes +; CGSCC-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(100) [[PTR:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: ret void ; %arrayidx3 = getelementptr i32, i32* %ptr, i64 3 %arrayidx1 = getelementptr i32, i32* %ptr, i64 1 @@ -530,15 +525,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@bitcast +; MODULE-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR2]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@bitcast +; CGSCC-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: ret void ; %ptr = bitcast i32* %arg to float* %arrayidx0 = getelementptr float, float* %ptr, i64 0 @@ -549,15 +544,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@bitcast_different_sizes +; MODULE-SAME: (double* nocapture nofree nonnull readnone align 4 dereferenceable(12) [[ARG1:%.*]], i8* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[ARG2:%.*]]) #[[ATTR2]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@bitcast_different_sizes +; CGSCC-SAME: (double* nocapture nofree nonnull readnone align 4 dereferenceable(12) [[ARG1:%.*]], i8* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[ARG2:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: ret void ; %ptr1 = bitcast double* %arg1 to float* %a10 = getelementptr float, float* %ptr1, i64 0 @@ -576,15 +571,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@negative_offset +; MODULE-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR2]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@negative_offset +; CGSCC-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: ret void ; %ptr = bitcast i32* %arg to float* %arrayidx0 = getelementptr float, float* %ptr, i64 0 @@ -595,25 +590,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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@stores +; MODULE-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { +; MODULE-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* +; MODULE-NEXT: [[ARRAYIDX0:%.*]] = getelementptr float, float* [[PTR]], i64 0 +; MODULE-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 +; MODULE-NEXT: store float 1.000000e+00, float* [[ARRAYIDX0]], align 4 +; MODULE-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@stores +; CGSCC-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { +; CGSCC-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* +; CGSCC-NEXT: [[ARRAYIDX0:%.*]] = getelementptr float, float* [[PTR]], i64 0 +; CGSCC-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 +; CGSCC-NEXT: store float 1.000000e+00, float* [[ARRAYIDX0]], align 4 +; CGSCC-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 +; CGSCC-NEXT: ret void ; %ptr = bitcast i32* %arg to float* %arrayidx0 = getelementptr float, float* %ptr, i64 0 @@ -624,21 +619,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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@load_store +; MODULE-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; MODULE-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* +; MODULE-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 +; MODULE-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@load_store +; CGSCC-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* +; CGSCC-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 +; CGSCC-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 +; CGSCC-NEXT: ret void ; %ptr = bitcast i32* %arg to float* %arrayidx0 = getelementptr float, float* %ptr, i64 0 @@ -649,21 +644,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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@different_size1 +; MODULE-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; MODULE-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* +; MODULE-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 +; MODULE-NEXT: store i32 0, i32* [[ARG]], align 8 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@different_size1 +; CGSCC-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* +; CGSCC-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 +; CGSCC-NEXT: store i32 0, i32* [[ARG]], align 8 +; CGSCC-NEXT: ret void ; %arg-cast = bitcast i32* %arg to double* store double 0.000000e+00, double* %arg-cast @@ -672,21 +667,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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@different_size2 +; MODULE-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; MODULE-NEXT: store i32 0, i32* [[ARG]], align 8 +; MODULE-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* +; MODULE-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@different_size2 +; CGSCC-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: store i32 0, i32* [[ARG]], align 8 +; CGSCC-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* +; CGSCC-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 +; CGSCC-NEXT: ret void ; store i32 0, i32* %arg %arg-cast = bitcast i32* %arg to double* @@ -695,7 +690,6 @@ } ; Make use of MustBeExecuted Explorer -; ; [CFG] ; entry ; / \ @@ -710,114 +704,58 @@ ; end ; According to the above CFG, we can see that instructions in l5 Block must be executed. ; Therefore, %p must be dereferenced. -; -; 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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@require_cfg_analysis +; MODULE-SAME: (i32 [[C:%.*]], i32* nocapture nofree nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR4]] { +; MODULE-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C]], 0 +; MODULE-NEXT: br i1 [[TOBOOL1]], label [[L1:%.*]], label [[L2:%.*]] +; MODULE: l1: +; MODULE-NEXT: br label [[L4:%.*]] +; MODULE: l2: +; MODULE-NEXT: [[TOBOOL3:%.*]] = icmp eq i32 [[C]], 2 +; MODULE-NEXT: br i1 [[TOBOOL3]], label [[L3:%.*]], label [[L4]] +; MODULE: l3: +; MODULE-NEXT: br label [[L5:%.*]] +; MODULE: l4: +; MODULE-NEXT: br label [[L5]] +; MODULE: l5: +; MODULE-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 4 +; MODULE-NEXT: br i1 [[TOBOOL4]], label [[L6:%.*]], label [[L7:%.*]] +; MODULE: l6: +; MODULE-NEXT: store i32 0, i32* [[P]], align 4 +; MODULE-NEXT: br label [[END:%.*]] +; MODULE: l7: +; MODULE-NEXT: store i32 1, i32* [[P]], align 4 +; MODULE-NEXT: br label [[END]] +; MODULE: end: +; MODULE-NEXT: ret i32 1 +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@require_cfg_analysis +; CGSCC-SAME: (i32 [[C:%.*]], i32* nocapture nofree nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C]], 0 +; CGSCC-NEXT: br i1 [[TOBOOL1]], label [[L1:%.*]], label [[L2:%.*]] +; CGSCC: l1: +; CGSCC-NEXT: br label [[L4:%.*]] +; CGSCC: l2: +; CGSCC-NEXT: [[TOBOOL3:%.*]] = icmp eq i32 [[C]], 2 +; CGSCC-NEXT: br i1 [[TOBOOL3]], label [[L3:%.*]], label [[L4]] +; CGSCC: l3: +; CGSCC-NEXT: br label [[L5:%.*]] +; CGSCC: l4: +; CGSCC-NEXT: br label [[L5]] +; CGSCC: l5: +; CGSCC-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 4 +; CGSCC-NEXT: br i1 [[TOBOOL4]], label [[L6:%.*]], label [[L7:%.*]] +; CGSCC: l6: +; CGSCC-NEXT: store i32 0, i32* [[P]], align 4 +; CGSCC-NEXT: br label [[END:%.*]] +; CGSCC: l7: +; CGSCC-NEXT: store i32 1, i32* [[P]], align 4 +; CGSCC-NEXT: br label [[END]] +; CGSCC: end: +; CGSCC-NEXT: ret i32 1 ; %tobool1 = icmp eq i32 %c, 0 br i1 %tobool1, label %l1, label %l2 @@ -844,15 +782,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 } +; MODULE: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } +; MODULE: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn } +; MODULE: attributes #[[ATTR2]] = { nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR3]] = { argmemonly nofree nounwind willreturn } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; CGSCC: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR3]] = { argmemonly nofree norecurse nounwind willreturn } +; CGSCC: 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,49 +1,46 @@ ; 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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; 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]] -; - ; GEP of index 0 is simplified away. +; MODULE: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@PR21780 +; MODULE-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 1 +; MODULE-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 2 +; MODULE-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 +; MODULE-NEXT: [[T0:%.*]] = load double, double* [[PTR]], align 8 +; MODULE-NEXT: [[T1:%.*]] = load double, double* [[ARRAYIDX1]], align 8 +; MODULE-NEXT: [[T2:%.*]] = load double, double* [[ARRAYIDX2]], align 8 +; MODULE-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; MODULE-NEXT: [[VECINIT0:%.*]] = insertelement <4 x double> undef, double [[T0]], i32 0 +; MODULE-NEXT: [[VECINIT1:%.*]] = insertelement <4 x double> [[VECINIT0]], double [[T1]], i32 1 +; MODULE-NEXT: [[VECINIT2:%.*]] = insertelement <4 x double> [[VECINIT1]], double [[T2]], i32 2 +; MODULE-NEXT: [[VECINIT3:%.*]] = insertelement <4 x double> [[VECINIT2]], double [[T3]], i32 3 +; MODULE-NEXT: [[SHUFFLE:%.*]] = shufflevector <4 x double> [[VECINIT3]], <4 x double> [[VECINIT3]], <4 x i32> +; MODULE-NEXT: ret <4 x double> [[SHUFFLE]] +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@PR21780 +; CGSCC-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 1 +; CGSCC-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 2 +; CGSCC-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 +; CGSCC-NEXT: [[T0:%.*]] = load double, double* [[PTR]], align 8 +; CGSCC-NEXT: [[T1:%.*]] = load double, double* [[ARRAYIDX1]], align 8 +; CGSCC-NEXT: [[T2:%.*]] = load double, double* [[ARRAYIDX2]], align 8 +; CGSCC-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; CGSCC-NEXT: [[VECINIT0:%.*]] = insertelement <4 x double> undef, double [[T0]], i32 0 +; CGSCC-NEXT: [[VECINIT1:%.*]] = insertelement <4 x double> [[VECINIT0]], double [[T1]], i32 1 +; CGSCC-NEXT: [[VECINIT2:%.*]] = insertelement <4 x double> [[VECINIT1]], double [[T2]], i32 2 +; CGSCC-NEXT: [[VECINIT3:%.*]] = insertelement <4 x double> [[VECINIT2]], double [[T3]], i32 3 +; CGSCC-NEXT: [[SHUFFLE:%.*]] = shufflevector <4 x double> [[VECINIT3]], <4 x double> [[VECINIT3]], <4 x i32> +; CGSCC-NEXT: ret <4 x double> [[SHUFFLE]] +; %arrayidx1 = getelementptr inbounds double, double* %ptr, i64 1 %arrayidx2 = getelementptr inbounds double, double* %ptr, i64 2 %arrayidx3 = getelementptr inbounds double, double* %ptr, i64 3 @@ -63,40 +60,39 @@ 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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@PR21780_only_access3_with_inbounds +; MODULE-SAME: (double* nocapture nofree nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 +; MODULE-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; MODULE-NEXT: ret double [[T3]] +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@PR21780_only_access3_with_inbounds +; CGSCC-SAME: (double* nocapture nofree nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, double* [[PTR]], i64 3 +; CGSCC-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; CGSCC-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]] -; - %arrayidx3 = getelementptr inbounds double, double* %ptr, i64 3 %t3 = load double, double* %arrayidx3, align 8 ret double %t3 } 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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@PR21780_only_access3_without_inbounds +; MODULE-SAME: (double* nocapture nofree readonly align 8 [[PTR:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 +; MODULE-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; MODULE-NEXT: ret double [[T3]] +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@PR21780_only_access3_without_inbounds +; CGSCC-SAME: (double* nocapture nofree readonly align 8 [[PTR:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 +; CGSCC-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; CGSCC-NEXT: ret double [[T3]] ; %arrayidx3 = getelementptr double, double* %ptr, i64 3 %t3 = load double, double* %arrayidx3, align 8 @@ -104,21 +100,20 @@ } 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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@PR21780_without_inbounds +; MODULE-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 +; MODULE-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; MODULE-NEXT: ret double [[T3]] +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@PR21780_without_inbounds +; CGSCC-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(32) [[PTR:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[ARRAYIDX3:%.*]] = getelementptr double, double* [[PTR]], i64 3 +; CGSCC-NEXT: [[T3:%.*]] = load double, double* [[ARRAYIDX3]], align 8 +; CGSCC-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]] -; - %arrayidx1 = getelementptr double, double* %ptr, i64 1 %arrayidx2 = getelementptr double, double* %ptr, i64 2 %arrayidx3 = getelementptr double, double* %ptr, i64 3 @@ -134,21 +129,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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@gep0 +; MODULE-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]+]] { +; MODULE-NEXT: [[ARRAYIDX2:%.*]] = getelementptr i8, i8* [[PTR]], i64 2 +; MODULE-NEXT: [[T2:%.*]] = load i8, i8* [[ARRAYIDX2]], align 1 +; MODULE-NEXT: store i8 [[T2]], i8* [[OTHER]], align 1 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@gep0 +; 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]+]] { +; CGSCC-NEXT: [[ARRAYIDX2:%.*]] = getelementptr i8, i8* [[PTR]], i64 2 +; CGSCC-NEXT: [[T2:%.*]] = load i8, i8* [[ARRAYIDX2]], align 1 +; CGSCC-NEXT: store i8 [[T2]], i8* [[OTHER]], align 1 +; CGSCC-NEXT: ret void ; %arrayidx0 = getelementptr i8, i8* %ptr, i64 0 %arrayidx1 = getelementptr i8, i8* %ptr, i64 1 @@ -164,15 +159,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@ordering +; MODULE-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR1:%.*]], i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR2:%.*]]) #[[ATTR2:[0-9]+]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@ordering +; CGSCC-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR1:%.*]], i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR2:%.*]]) #[[ATTR2:[0-9]+]] { +; CGSCC-NEXT: ret void ; %a20 = getelementptr i32, i32* %ptr2, i64 0 %a12 = getelementptr i8, i8* %ptr1, i64 2 @@ -190,21 +185,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@not_entry_but_guaranteed_to_execute +; MODULE-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR:%.*]]) #[[ATTR2]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: br label [[EXIT:%.*]] +; MODULE: exit: +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@not_entry_but_guaranteed_to_execute +; CGSCC-SAME: (i8* nocapture nofree nonnull readnone dereferenceable(3) [[PTR:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br label [[EXIT:%.*]] +; CGSCC: exit: +; CGSCC-NEXT: ret void ; entry: br label %exit @@ -221,25 +216,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@not_entry_not_guaranteed_to_execute +; MODULE-SAME: (i8* nocapture nofree readnone [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] +; MODULE: loads: +; MODULE-NEXT: ret void +; MODULE: exit: +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@not_entry_not_guaranteed_to_execute +; CGSCC-SAME: (i8* nocapture nofree readnone [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] +; CGSCC: loads: +; CGSCC-NEXT: ret void +; CGSCC: exit: +; CGSCC-NEXT: ret void ; entry: br i1 %cond, label %loads, label %exit @@ -258,25 +253,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@partial_in_entry +; MODULE-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(4) [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] +; MODULE: loads: +; MODULE-NEXT: ret void +; MODULE: exit: +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@partial_in_entry +; CGSCC-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(4) [[PTR:%.*]], i1 [[COND:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br i1 [[COND]], label [[LOADS:%.*]], label [[EXIT:%.*]] +; CGSCC: loads: +; CGSCC-NEXT: ret void +; CGSCC: exit: +; CGSCC-NEXT: ret void ; entry: %arrayidx0 = getelementptr i16, i16* %ptr, i64 0 @@ -296,17 +291,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 +; MODULE: Function Attrs: argmemonly nofree nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@volatile_is_not_dereferenceable +; MODULE-SAME: (i16* nofree align 2 [[PTR:%.*]]) #[[ATTR3:[0-9]+]] { +; MODULE-NEXT: [[T0:%.*]] = load volatile i16, i16* [[PTR]], align 2 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@volatile_is_not_dereferenceable +; CGSCC-SAME: (i16* nofree align 2 [[PTR:%.*]]) #[[ATTR3:[0-9]+]] { +; CGSCC-NEXT: [[T0:%.*]] = load volatile i16, i16* [[PTR]], align 2 +; CGSCC-NEXT: ret void ; %arrayidx0 = getelementptr i16, i16* %ptr, i64 0 %arrayidx1 = getelementptr i16, i16* %ptr, i64 1 @@ -320,15 +315,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@atomic_is_alright +; MODULE-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(6) [[PTR:%.*]]) #[[ATTR2]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@atomic_is_alright +; CGSCC-SAME: (i16* nocapture nofree nonnull readnone align 2 dereferenceable(6) [[PTR:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: ret void ; %arrayidx0 = getelementptr i16, i16* %ptr, i64 0 %arrayidx1 = getelementptr i16, i16* %ptr, i64 1 @@ -360,15 +355,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@variable_gep_index +; MODULE-SAME: (i8* nocapture nofree readnone [[UNUSED:%.*]], i8* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]], i64 [[VARIABLE_INDEX:%.*]]) #[[ATTR2]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@variable_gep_index +; CGSCC-SAME: (i8* nocapture nofree readnone [[UNUSED:%.*]], i8* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]], i64 [[VARIABLE_INDEX:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: ret void ; %arrayidx1 = getelementptr i8, i8* %ptr, i64 %variable_index %arrayidx2 = getelementptr i8, i8* %ptr, i64 2 @@ -382,15 +377,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@multi_index_gep +; MODULE-SAME: (<4 x i8>* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]]) #[[ATTR2]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@multi_index_gep +; CGSCC-SAME: (<4 x i8>* nocapture nofree nonnull readnone dereferenceable(1) [[PTR:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: ret void ; %arrayidx00 = getelementptr <4 x i8>, <4 x i8>* %ptr, i64 0, i64 0 %t0 = load i8, i8* %arrayidx00 @@ -400,15 +395,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@not_byte_multiple +; MODULE-SAME: (i9* nocapture nofree nonnull readnone align 2 dereferenceable(2) [[PTR:%.*]]) #[[ATTR2]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@not_byte_multiple +; CGSCC-SAME: (i9* nocapture nofree nonnull readnone align 2 dereferenceable(2) [[PTR:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: ret void ; %arrayidx0 = getelementptr i9, i9* %ptr, i64 0 %t0 = load i9, i9* %arrayidx0 @@ -418,15 +413,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@no_pointer_deref +; MODULE-SAME: (i16* nocapture nofree readnone align 2 [[PTR:%.*]]) #[[ATTR2]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@no_pointer_deref +; CGSCC-SAME: (i16* nocapture nofree readnone align 2 [[PTR:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: ret void ; %arrayidx1 = getelementptr i16, i16* %ptr, i64 1 %arrayidx2 = getelementptr i16, i16* %ptr, i64 2 @@ -438,15 +433,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@non_consecutive +; MODULE-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR:%.*]]) #[[ATTR2]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_consecutive +; CGSCC-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[PTR:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: ret void ; %arrayidx1 = getelementptr i32, i32* %ptr, i64 1 %arrayidx0 = getelementptr i32, i32* %ptr, i64 0 @@ -460,15 +455,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@more_bytes +; MODULE-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@more_bytes +; CGSCC-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: ret void ; %arrayidx3 = getelementptr i32, i32* %ptr, i64 3 %arrayidx1 = getelementptr i32, i32* %ptr, i64 1 @@ -484,15 +479,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@more_bytes_and_not_null +; MODULE-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@more_bytes_and_not_null +; CGSCC-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[PTR:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: ret void ; %arrayidx3 = getelementptr i32, i32* %ptr, i64 3 %arrayidx1 = getelementptr i32, i32* %ptr, i64 1 @@ -508,15 +503,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@better_bytes +; MODULE-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(100) [[PTR:%.*]]) #[[ATTR2]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@better_bytes +; CGSCC-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(100) [[PTR:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: ret void ; %arrayidx3 = getelementptr i32, i32* %ptr, i64 3 %arrayidx1 = getelementptr i32, i32* %ptr, i64 1 @@ -530,15 +525,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@bitcast +; MODULE-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR2]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@bitcast +; CGSCC-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: ret void ; %ptr = bitcast i32* %arg to float* %arrayidx0 = getelementptr float, float* %ptr, i64 0 @@ -549,15 +544,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@bitcast_different_sizes +; MODULE-SAME: (double* nocapture nofree nonnull readnone align 4 dereferenceable(12) [[ARG1:%.*]], i8* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[ARG2:%.*]]) #[[ATTR2]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@bitcast_different_sizes +; CGSCC-SAME: (double* nocapture nofree nonnull readnone align 4 dereferenceable(12) [[ARG1:%.*]], i8* nocapture nofree nonnull readnone align 4 dereferenceable(16) [[ARG2:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: ret void ; %ptr1 = bitcast double* %arg1 to float* %a10 = getelementptr float, float* %ptr1, i64 0 @@ -576,15 +571,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@negative_offset +; MODULE-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR2]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@negative_offset +; CGSCC-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: ret void ; %ptr = bitcast i32* %arg to float* %arrayidx0 = getelementptr float, float* %ptr, i64 0 @@ -595,25 +590,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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@stores +; MODULE-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { +; MODULE-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* +; MODULE-NEXT: [[ARRAYIDX0:%.*]] = getelementptr float, float* [[PTR]], i64 0 +; MODULE-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 +; MODULE-NEXT: store float 1.000000e+00, float* [[ARRAYIDX0]], align 4 +; MODULE-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@stores +; CGSCC-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { +; CGSCC-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* +; CGSCC-NEXT: [[ARRAYIDX0:%.*]] = getelementptr float, float* [[PTR]], i64 0 +; CGSCC-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 +; CGSCC-NEXT: store float 1.000000e+00, float* [[ARRAYIDX0]], align 4 +; CGSCC-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 +; CGSCC-NEXT: ret void ; %ptr = bitcast i32* %arg to float* %arrayidx0 = getelementptr float, float* %ptr, i64 0 @@ -624,21 +619,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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@load_store +; MODULE-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; MODULE-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* +; MODULE-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 +; MODULE-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@load_store +; CGSCC-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: [[PTR:%.*]] = bitcast i32* [[ARG]] to float* +; CGSCC-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, float* [[PTR]], i64 1 +; CGSCC-NEXT: store float 2.000000e+00, float* [[ARRAYIDX1]], align 4 +; CGSCC-NEXT: ret void ; %ptr = bitcast i32* %arg to float* %arrayidx0 = getelementptr float, float* %ptr, i64 0 @@ -649,21 +644,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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@different_size1 +; MODULE-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; MODULE-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* +; MODULE-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 +; MODULE-NEXT: store i32 0, i32* [[ARG]], align 8 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@different_size1 +; CGSCC-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* +; CGSCC-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 +; CGSCC-NEXT: store i32 0, i32* [[ARG]], align 8 +; CGSCC-NEXT: ret void ; %arg-cast = bitcast i32* %arg to double* store double 0.000000e+00, double* %arg-cast @@ -672,21 +667,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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@different_size2 +; MODULE-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; MODULE-NEXT: store i32 0, i32* [[ARG]], align 8 +; MODULE-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* +; MODULE-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@different_size2 +; CGSCC-SAME: (i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: store i32 0, i32* [[ARG]], align 8 +; CGSCC-NEXT: [[ARG_CAST:%.*]] = bitcast i32* [[ARG]] to double* +; CGSCC-NEXT: store double 0.000000e+00, double* [[ARG_CAST]], align 8 +; CGSCC-NEXT: ret void ; store i32 0, i32* %arg %arg-cast = bitcast i32* %arg to double* @@ -695,7 +690,6 @@ } ; Make use of MustBeExecuted Explorer -; ; [CFG] ; entry ; / \ @@ -710,114 +704,58 @@ ; end ; According to the above CFG, we can see that instructions in l5 Block must be executed. ; Therefore, %p must be dereferenced. -; -; 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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@require_cfg_analysis +; MODULE-SAME: (i32 [[C:%.*]], i32* nocapture nofree nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR4]] { +; MODULE-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C]], 0 +; MODULE-NEXT: br i1 [[TOBOOL1]], label [[L1:%.*]], label [[L2:%.*]] +; MODULE: l1: +; MODULE-NEXT: br label [[L4:%.*]] +; MODULE: l2: +; MODULE-NEXT: [[TOBOOL3:%.*]] = icmp eq i32 [[C]], 2 +; MODULE-NEXT: br i1 [[TOBOOL3]], label [[L3:%.*]], label [[L4]] +; MODULE: l3: +; MODULE-NEXT: br label [[L5:%.*]] +; MODULE: l4: +; MODULE-NEXT: br label [[L5]] +; MODULE: l5: +; MODULE-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 4 +; MODULE-NEXT: br i1 [[TOBOOL4]], label [[L6:%.*]], label [[L7:%.*]] +; MODULE: l6: +; MODULE-NEXT: store i32 0, i32* [[P]], align 4 +; MODULE-NEXT: br label [[END:%.*]] +; MODULE: l7: +; MODULE-NEXT: store i32 1, i32* [[P]], align 4 +; MODULE-NEXT: br label [[END]] +; MODULE: end: +; MODULE-NEXT: ret i32 1 +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@require_cfg_analysis +; CGSCC-SAME: (i32 [[C:%.*]], i32* nocapture nofree nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C]], 0 +; CGSCC-NEXT: br i1 [[TOBOOL1]], label [[L1:%.*]], label [[L2:%.*]] +; CGSCC: l1: +; CGSCC-NEXT: br label [[L4:%.*]] +; CGSCC: l2: +; CGSCC-NEXT: [[TOBOOL3:%.*]] = icmp eq i32 [[C]], 2 +; CGSCC-NEXT: br i1 [[TOBOOL3]], label [[L3:%.*]], label [[L4]] +; CGSCC: l3: +; CGSCC-NEXT: br label [[L5:%.*]] +; CGSCC: l4: +; CGSCC-NEXT: br label [[L5]] +; CGSCC: l5: +; CGSCC-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 4 +; CGSCC-NEXT: br i1 [[TOBOOL4]], label [[L6:%.*]], label [[L7:%.*]] +; CGSCC: l6: +; CGSCC-NEXT: store i32 0, i32* [[P]], align 4 +; CGSCC-NEXT: br label [[END:%.*]] +; CGSCC: l7: +; CGSCC-NEXT: store i32 1, i32* [[P]], align 4 +; CGSCC-NEXT: br label [[END]] +; CGSCC: end: +; CGSCC-NEXT: ret i32 1 ; %tobool1 = icmp eq i32 %c, 0 br i1 %tobool1, label %l1, label %l2 @@ -844,15 +782,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 } +; MODULE: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } +; MODULE: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn } +; MODULE: attributes #[[ATTR2]] = { nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR3]] = { argmemonly nofree nounwind willreturn } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; CGSCC: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR3]] = { argmemonly nofree norecurse nounwind willreturn } +; CGSCC: 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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC declare noalias i8* @malloc(i64) @@ -31,49 +29,26 @@ 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 +121,10 @@ ; 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 +133,11 @@ } 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 +148,11 @@ 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 +176,12 @@ 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 +191,10 @@ ; 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 +205,19 @@ ; 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 +239,18 @@ ; 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 +272,12 @@ ; 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 +309,14 @@ ; TEST 9 - FIXME: malloc should be converted. define void @test9() { -; IS________OPM-LABEL: define {{[^@]+}}@test9() { -; IS________OPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) -; IS________OPM-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]]) -; IS________OPM-NEXT: [[TMP2:%.*]] = bitcast i8* [[TMP1]] to i32* -; IS________OPM-NEXT: store i32 10, i32* [[TMP2]], align 4 -; IS________OPM-NEXT: tail call void @foo_nounw(i32* nofree 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 +331,13 @@ ; 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 +349,14 @@ } 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 +371,10 @@ ; 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 +384,34 @@ ; 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 +452,25 @@ 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 +580,12 @@ } 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 +611,12 @@ } 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 +637,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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC target triple = "amdgcn-amd-amdhsa" @@ -90,19 +88,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:%.*]] = 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 +104,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:%.*]] = 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 +161,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:%.*]] = 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 +346,36 @@ ; 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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC 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]] +; MODULE: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@visible +; MODULE-SAME: (i32* noalias nocapture nofree readonly [[A:%.*]], i32* noalias nocapture nofree readonly [[B:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-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]+]] +; MODULE-NEXT: [[CALL2:%.*]] = call i32 @noalias_args_argmem(i32* noalias nocapture nofree readonly align 4 [[A]], i32* noalias nocapture nofree readonly align 4 [[B]]) #[[ATTR3]] +; MODULE-NEXT: [[ADD:%.*]] = add nsw i32 [[CALL1]], [[CALL2]] +; MODULE-NEXT: ret i32 [[ADD]] +; +; CGSCC: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@visible +; CGSCC-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]+]] { +; CGSCC-NEXT: entry: +; CGSCC-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]+]] +; CGSCC-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]] +; CGSCC-NEXT: [[ADD:%.*]] = add nsw i32 [[CALL1]], [[CALL2]] +; CGSCC-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]] +; MODULE: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@noalias_args +; MODULE-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]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[TMP0:%.*]] = load i32, i32* [[A]], align 4 +; MODULE-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4 +; MODULE-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], [[TMP1]] +; MODULE-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]] +; MODULE-NEXT: [[ADD2:%.*]] = add nsw i32 [[ADD]], [[CALL]] +; MODULE-NEXT: ret i32 [[ADD2]] +; +; CGSCC: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@noalias_args +; 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]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[TMP0:%.*]] = load i32, i32* [[A]], align 4 +; CGSCC-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4 +; CGSCC-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], [[TMP1]] +; CGSCC-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]+]] +; CGSCC-NEXT: [[ADD2:%.*]] = add nsw i32 [[ADD]], [[CALL]] +; CGSCC-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]] +; MODULE: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@noalias_args_argmem +; MODULE-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]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[TMP0:%.*]] = load i32, i32* [[A]], align 4 +; MODULE-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4 +; MODULE-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], [[TMP1]] +; MODULE-NEXT: ret i32 [[ADD]] +; +; CGSCC: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@noalias_args_argmem +; 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]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[TMP0:%.*]] = load i32, i32* [[A]], align 4 +; CGSCC-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4 +; CGSCC-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], [[TMP1]] +; CGSCC-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]] +; MODULE: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@visible_local +; MODULE-SAME: (i32* nocapture nofree readonly [[A:%.*]]) #[[ATTR1:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[B:%.*]] = alloca i32, align 4 +; MODULE-NEXT: store i32 5, i32* [[B]], align 4 +; MODULE-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]] +; MODULE-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]] +; MODULE-NEXT: [[ADD:%.*]] = add nsw i32 [[CALL1]], [[CALL2]] +; MODULE-NEXT: ret i32 [[ADD]] +; +; CGSCC: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@visible_local +; CGSCC-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[B:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: store i32 5, i32* [[B]], align 4 +; CGSCC-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]] +; CGSCC-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]] +; CGSCC-NEXT: [[ADD:%.*]] = add nsw i32 [[CALL1]], [[CALL2]] +; CGSCC-NEXT: ret i32 [[ADD]] ; entry: %B = alloca i32, align 4 @@ -153,43 +120,27 @@ } 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 +; MODULE: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@noalias_args_argmem_ro +; MODULE-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[B_PRIV:%.*]] = alloca i32, align 4 +; MODULE-NEXT: store i32 [[TMP1]], i32* [[B_PRIV]], align 4 +; MODULE-NEXT: [[A_PRIV:%.*]] = alloca i32, align 4 +; MODULE-NEXT: store i32 [[TMP0]], i32* [[A_PRIV]], align 4 +; MODULE-NEXT: [[T0:%.*]] = load i32, i32* [[A_PRIV]], align 4 +; MODULE-NEXT: [[T1:%.*]] = load i32, i32* [[B_PRIV]], align 4 +; MODULE-NEXT: [[ADD:%.*]] = add nsw i32 [[T0]], [[T1]] +; MODULE-NEXT: ret i32 [[ADD]] +; +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@noalias_args_argmem_ro +; CGSCC-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2:[0-9]+]] { +; CGSCC-NEXT: [[B_PRIV:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: [[A_PRIV:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: [[T0:%.*]] = load i32, i32* [[A_PRIV]], align 4 +; CGSCC-NEXT: [[T1:%.*]] = load i32, i32* [[B_PRIV]], align 4 +; CGSCC-NEXT: [[ADD:%.*]] = add nsw i32 5, 5 +; CGSCC-NEXT: ret i32 undef ; %t0 = load i32, i32* %A, align 4 %t1 = load i32, i32* %B, align 4 @@ -198,36 +149,20 @@ } 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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@visible_local_2 +; MODULE-SAME: () #[[ATTR2:[0-9]+]] { +; MODULE-NEXT: [[B:%.*]] = alloca i32, align 4 +; MODULE-NEXT: store i32 5, i32* [[B]], align 4 +; MODULE-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4 +; MODULE-NEXT: [[TMP2:%.*]] = load i32, i32* [[B]], align 4 +; MODULE-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem_ro(i32 [[TMP1]], i32 [[TMP2]]) #[[ATTR4:[0-9]+]] +; MODULE-NEXT: ret i32 [[CALL]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@visible_local_2 +; CGSCC-SAME: () #[[ATTR3:[0-9]+]] { +; CGSCC-NEXT: ret i32 10 ; %B = alloca i32, align 4 store i32 5, i32* %B, align 4 @@ -236,19 +171,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]] +; MODULE: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@noalias_args_argmem_rn +; MODULE-SAME: (i32* noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: [[T0:%.*]] = load i32, i32* [[B]], align 4 +; MODULE-NEXT: store i32 0, i32* [[B]], align 4 +; MODULE-NEXT: ret i32 [[T0]] +; +; CGSCC: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@noalias_args_argmem_rn +; CGSCC-SAME: (i32* noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: [[T0:%.*]] = load i32, i32* [[B]], align 4 +; CGSCC-NEXT: store i32 0, i32* [[B]], align 4 +; CGSCC-NEXT: ret i32 [[T0]] ; %t0 = load i32, i32* %B, align 4 store i32 0, i32* %B @@ -256,29 +191,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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@visible_local_3 +; MODULE-SAME: () #[[ATTR2]] { +; MODULE-NEXT: [[B:%.*]] = alloca i32, align 4 +; MODULE-NEXT: store i32 5, i32* [[B]], align 4 +; MODULE-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem_rn(i32* noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[B]]) #[[ATTR5:[0-9]+]] +; MODULE-NEXT: ret i32 [[CALL]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@visible_local_3 +; CGSCC-SAME: () #[[ATTR3]] { +; CGSCC-NEXT: [[B:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: store i32 5, i32* [[B]], align 4 +; CGSCC-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem_rn(i32* noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[B]]) #[[ATTR6:[0-9]+]] +; CGSCC-NEXT: ret i32 [[CALL]] ; %B = alloca i32, align 4 store i32 5, i32* %B, align 4 @@ -289,26 +216,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 } +; MODULE: attributes #[[ATTR0]] = { argmemonly nofree noinline nosync nounwind readonly uwtable willreturn } +; MODULE: attributes #[[ATTR1]] = { argmemonly nofree noinline nosync nounwind uwtable willreturn } +; MODULE: attributes #[[ATTR2]] = { nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR3]] = { nofree nosync nounwind readonly } +; MODULE: attributes #[[ATTR4]] = { nofree nosync nounwind readonly willreturn } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn } +; CGSCC: attributes #[[ATTR1]] = { argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn } +; CGSCC: attributes #[[ATTR2]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } +; CGSCC: attributes #[[ATTR3]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR4]] = { nounwind readonly } +; CGSCC: attributes #[[ATTR5]] = { nosync nounwind readonly } +; CGSCC: attributes #[[ATTR6]] = { nounwind willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/internalize.ll b/llvm/test/Transforms/Attributor/internalize.ll --- a/llvm/test/Transforms/Attributor/internalize.ll +++ b/llvm/test/Transforms/Attributor/internalize.ll @@ -1,17 +1,14 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes --check-attributes --check-globals ; Deep Wrapper disabled -; RUN: opt -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_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM,CHECK_DISABLED,NOT_CGSCC_NPM_DISABLED,NOT_CGSCC_OPM_DISABLED,NOT_TUNIT_NPM_DISABLED,IS__TUNIT_____DISABLED,IS________OPM_DISABLED,IS__TUNIT_OPM_DISABLED -; 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,CHECK_DISABLED,NOT_CGSCC_OPM_DISABLED,NOT_CGSCC_NPM_DISABLED,NOT_TUNIT_OPM_DISABLED,IS__TUNIT_____DISABLED,IS________NPM_DISABLED,IS__TUNIT_NPM_DISABLED +; 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,NODEEP ; Deep Wrapper enabled -; RUN: opt -attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=11 -attributor-allow-deep-wrappers -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM,CHECK_ENABLED,NOT_CGSCC_NPM_ENABLED,NOT_CGSCC_OPM_ENABLED,NOT_TUNIT_NPM_ENABLED,IS__TUNIT_____ENABLED,IS________OPM_ENABLED,IS__TUNIT_OPM_ENABLED -; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=11 -attributor-allow-deep-wrappers -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM,CHECK_ENABLED,NOT_CGSCC_OPM_ENABLED,NOT_CGSCC_NPM_ENABLED,NOT_TUNIT_OPM_ENABLED,IS__TUNIT_____ENABLED,IS________NPM_ENABLED,IS__TUNIT_NPM_ENABLED +; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=11 -attributor-allow-deep-wrappers -S < %s | FileCheck %s --check-prefixes=CHECK,DEEP ; TEST 1: This function is of linkage `linkonce`, we cannot internalize this ; function and use information derived from it -; ; CHECK-NOT: inner1.internalized define linkonce i32 @inner1(i32 %a, i32 %b) { ; CHECK-LABEL: define {{[^@]+}}@inner1 @@ -27,7 +24,6 @@ ; TEST 2: This function is of linkage `weak`, we cannot internalize this function and ; use information derived from it -; ; CHECK-NOT: inner2.internalized define weak i32 @inner2(i32 %a, i32 %b) { ; CHECK-LABEL: define {{[^@]+}}@inner2 @@ -43,13 +39,12 @@ ; TEST 3: This function is of linkage `linkonce_odr`, which can be internalized using the ; deep wrapper, and the IP information derived from this function can be used -; define linkonce_odr i32 @inner3(i32 %a, i32 %b) { -; CHECK_DISABLED-LABEL: define {{[^@]+}}@inner3 -; CHECK_DISABLED-SAME: (i32 [[A:%.*]], i32 [[B:%.*]]) { -; CHECK_DISABLED-NEXT: entry: -; CHECK_DISABLED-NEXT: [[C:%.*]] = add i32 [[A]], [[B]] -; CHECK_DISABLED-NEXT: ret i32 [[C]] +; NODEEP-LABEL: define {{[^@]+}}@inner3 +; NODEEP-SAME: (i32 [[A:%.*]], i32 [[B:%.*]]) { +; NODEEP-NEXT: entry: +; NODEEP-NEXT: [[C:%.*]] = add i32 [[A]], [[B]] +; NODEEP-NEXT: ret i32 [[C]] ; entry: %c = add i32 %a, %b @@ -58,13 +53,12 @@ ; TEST 4: This function is of linkage `weak_odr`, which can be internalized using the deep ; wrapper -; define weak_odr i32 @inner4(i32 %a, i32 %b) { -; CHECK_DISABLED-LABEL: define {{[^@]+}}@inner4 -; CHECK_DISABLED-SAME: (i32 [[A:%.*]], i32 [[B:%.*]]) { -; CHECK_DISABLED-NEXT: entry: -; CHECK_DISABLED-NEXT: [[C:%.*]] = add i32 [[A]], [[B]] -; CHECK_DISABLED-NEXT: ret i32 [[C]] +; NODEEP-LABEL: define {{[^@]+}}@inner4 +; NODEEP-SAME: (i32 [[A:%.*]], i32 [[B:%.*]]) { +; NODEEP-NEXT: entry: +; NODEEP-NEXT: [[C:%.*]] = add i32 [[A]], [[B]] +; NODEEP-NEXT: ret i32 [[C]] ; entry: %c = add i32 %a, %b @@ -73,7 +67,6 @@ ; TEST 5: This function has linkage `linkonce_odr` but is never called (num of use = 0), so there ; is no need to internalize this -; ; CHECK-NOT: inner5.internalized define linkonce_odr i32 @inner5(i32 %a, i32 %b) { ; CHECK-LABEL: define {{[^@]+}}@inner5 @@ -91,23 +84,22 @@ ; Since the inner2 cannot be internalized, there should be no change to its callsite ; Since the inner3 is internalized, the use of the original function should be replaced by the ; copied one -; define i32 @outer1() { -; CHECK_DISABLED-LABEL: define {{[^@]+}}@outer1() { -; CHECK_DISABLED-NEXT: entry: -; CHECK_DISABLED-NEXT: [[RET1:%.*]] = call i32 @inner1(i32 noundef 1, i32 noundef 2) -; CHECK_DISABLED-NEXT: [[RET2:%.*]] = call i32 @inner2(i32 noundef 1, i32 noundef 2) -; CHECK_DISABLED-NEXT: [[RET3:%.*]] = call i32 @inner3(i32 [[RET1]], i32 [[RET2]]) -; CHECK_DISABLED-NEXT: [[RET4:%.*]] = call i32 @inner4(i32 [[RET3]], i32 [[RET3]]) -; CHECK_DISABLED-NEXT: ret i32 [[RET4]] -; -; CHECK_ENABLED-LABEL: define {{[^@]+}}@outer1() { -; CHECK_ENABLED-NEXT: entry: -; CHECK_ENABLED-NEXT: [[RET1:%.*]] = call i32 @inner1(i32 noundef 1, i32 noundef 2) -; CHECK_ENABLED-NEXT: [[RET2:%.*]] = call i32 @inner2(i32 noundef 1, i32 noundef 2) -; CHECK_ENABLED-NEXT: [[RET3:%.*]] = call i32 @inner3.internalized(i32 [[RET1]], i32 [[RET2]]) -; CHECK_ENABLED-NEXT: [[RET4:%.*]] = call i32 @inner4.internalized(i32 [[RET3]], i32 [[RET3]]) -; CHECK_ENABLED-NEXT: ret i32 [[RET4]] +; NODEEP-LABEL: define {{[^@]+}}@outer1() { +; NODEEP-NEXT: entry: +; NODEEP-NEXT: [[RET1:%.*]] = call i32 @inner1(i32 noundef 1, i32 noundef 2) +; NODEEP-NEXT: [[RET2:%.*]] = call i32 @inner2(i32 noundef 1, i32 noundef 2) +; NODEEP-NEXT: [[RET3:%.*]] = call i32 @inner3(i32 [[RET1]], i32 [[RET2]]) +; NODEEP-NEXT: [[RET4:%.*]] = call i32 @inner4(i32 [[RET3]], i32 [[RET3]]) +; NODEEP-NEXT: ret i32 [[RET4]] +; +; DEEP-LABEL: define {{[^@]+}}@outer1() { +; DEEP-NEXT: entry: +; DEEP-NEXT: [[RET1:%.*]] = call i32 @inner1(i32 noundef 1, i32 noundef 2) +; DEEP-NEXT: [[RET2:%.*]] = call i32 @inner2(i32 noundef 1, i32 noundef 2) +; DEEP-NEXT: [[RET3:%.*]] = call i32 @inner3.internalized(i32 [[RET1]], i32 [[RET2]]) +; DEEP-NEXT: [[RET4:%.*]] = call i32 @inner4.internalized(i32 [[RET3]], i32 [[RET3]]) +; DEEP-NEXT: ret i32 [[RET4]] ; entry: %ret1 = call i32 @inner1(i32 1, i32 2) @@ -119,36 +111,34 @@ define linkonce_odr void @unused_arg(i8) { -; CHECK_DISABLED-LABEL: define {{[^@]+}}@unused_arg -; CHECK_DISABLED-SAME: (i8 [[TMP0:%.*]]) { -; CHECK_DISABLED-NEXT: unreachable +; NODEEP-LABEL: define {{[^@]+}}@unused_arg +; NODEEP-SAME: (i8 [[TMP0:%.*]]) { +; NODEEP-NEXT: unreachable ; unreachable } define void @unused_arg_caller() { -; CHECK_DISABLED-LABEL: define {{[^@]+}}@unused_arg_caller() { -; CHECK_DISABLED-NEXT: call void @unused_arg(i8 noundef 0) -; CHECK_DISABLED-NEXT: ret void -; ; CHECK_ENABLED: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; CHECK_ENABLED-LABEL: define {{[^@]+}}@unused_arg_caller -; CHECK_ENABLED-SAME: () #[[ATTR1:[0-9]+]] { -; CHECK_ENABLED-NEXT: unreachable -; ; IS__CGSCC_____ENABLED: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn -; IS__CGSCC_____ENABLED-LABEL: define {{[^@]+}}@unused_arg_caller -; IS__CGSCC_____ENABLED-SAME: () #[[ATTR2:[0-9]+]] { -; IS__CGSCC_____ENABLED-NEXT: unreachable +; NODEEP-LABEL: define {{[^@]+}}@unused_arg_caller() { +; NODEEP-NEXT: call void @unused_arg(i8 noundef 0) +; NODEEP-NEXT: ret void +; +; DEEP: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; DEEP-LABEL: define {{[^@]+}}@unused_arg_caller +; DEEP-SAME: () #[[ATTR1:[0-9]+]] { +; DEEP-NEXT: unreachable +; call void @unused_arg(i8 0) ret void } ; Don't crash on linkonce_odr hidden functions define linkonce_odr hidden void @__clang_call_terminate() { -; CHECK_DISABLED-LABEL: define {{[^@]+}}@__clang_call_terminate() { -; CHECK_DISABLED-NEXT: call void @__clang_call_terminate() -; CHECK_DISABLED-NEXT: unreachable +; NODEEP-LABEL: define {{[^@]+}}@__clang_call_terminate() { +; NODEEP-NEXT: call void @__clang_call_terminate() +; NODEEP-NEXT: unreachable ; call void @__clang_call_terminate() unreachable @@ -157,8 +147,11 @@ ; IS__CGSCC_____ENABLED: attributes #[[ATTR0:[0-9]+]] = { nofree nosync nounwind readnone willreturn } ; IS__CGSCC_____ENABLED: attributes #[[ATTR1:[0-9]+]] = { nofree noreturn nosync nounwind readnone willreturn } ; IS__CGSCC_____ENABLED: attributes #[[ATTR2]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } -;. ; CHECK_ENABLED: attributes #[[ATTR0:[0-9]+]] = { nofree nosync nounwind readnone willreturn } ; CHECK_ENABLED: attributes #[[ATTR1]] = { nofree noreturn nosync nounwind readnone willreturn } ; CHECK_ENABLED: attributes #[[ATTR2:[0-9]+]] = { nounwind readnone } ;. +; DEEP: attributes #[[ATTR0:[0-9]+]] = { nofree nosync nounwind readnone willreturn } +; DEEP: attributes #[[ATTR1]] = { nofree noreturn nosync nounwind readnone willreturn } +; DEEP: attributes #[[ATTR2:[0-9]+]] = { nounwind readnone } +;. diff --git a/llvm/test/Transforms/Attributor/liveness.ll b/llvm/test/Transforms/Attributor/liveness.ll --- a/llvm/test/Transforms/Attributor/liveness.ll +++ b/llvm/test/Transforms/Attributor/liveness.ll @@ -1,9 +1,7 @@ ; 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 +; 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,MODULE ; 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 +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; NOT_CGSCC___: @dead_with_blockaddress_users.l = constant [2 x i8*] [i8* inttoptr (i32 1 to i8*), i8* inttoptr (i32 1 to i8*)] ; IS__CGSCC___: @dead_with_blockaddress_users.l = constant [2 x i8*] [i8* blockaddress(@dead_with_blockaddress_users, %lab0), i8* blockaddress(@dead_with_blockaddress_users, %end)] @@ -27,32 +25,32 @@ ; and nothing should be deduced for it. ;. -; NOT_CGSCC_NPM: @[[DEAD_WITH_BLOCKADDRESS_USERS_L:[a-zA-Z0-9_$"\\.-]+]] = constant [2 x i8*] [i8* inttoptr (i32 1 to i8*), i8* inttoptr (i32 1 to i8*)] -; NOT_CGSCC_NPM: @[[A1:[a-zA-Z0-9_$"\\.-]+]] = common global i8 0, align 8 -; NOT_CGSCC_NPM: @[[A2:[a-zA-Z0-9_$"\\.-]+]] = common global i8 0, align 16 -; NOT_CGSCC_NPM: @[[E:[a-zA-Z0-9_$"\\.-]+]] = global %struct.a* null -; NOT_CGSCC_NPM: @[[P:[a-zA-Z0-9_$"\\.-]+]] = global i8 0 +; MODULE: @[[DEAD_WITH_BLOCKADDRESS_USERS_L:[a-zA-Z0-9_$"\\.-]+]] = constant [2 x i8*] [i8* inttoptr (i32 1 to i8*), i8* inttoptr (i32 1 to i8*)] +; MODULE: @[[A1:[a-zA-Z0-9_$"\\.-]+]] = common global i8 0, align 8 +; MODULE: @[[A2:[a-zA-Z0-9_$"\\.-]+]] = common global i8 0, align 16 +; MODULE: @[[E:[a-zA-Z0-9_$"\\.-]+]] = global %struct.a* null +; MODULE: @[[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 +; 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:%.*]])] +; CGSCC: @[[A1:[a-zA-Z0-9_$"\\.-]+]] = common global i8 0, align 8 +; CGSCC: @[[A2:[a-zA-Z0-9_$"\\.-]+]] = common global i8 0, align 16 +; CGSCC: @[[E:[a-zA-Z0-9_$"\\.-]+]] = global %struct.a* null +; CGSCC: @[[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]] +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@dead_internal_func +; CGSCC-SAME: () #[[ATTR6:[0-9]+]] { +; CGSCC-NEXT: br label [[TMP2:%.*]] +; CGSCC: 1: +; CGSCC-NEXT: ret i32 undef +; CGSCC: 2: +; CGSCC-NEXT: [[TMP3:%.*]] = phi i32 [ [[TMP6:%.*]], [[TMP2]] ], [ 1, [[TMP0:%.*]] ] +; CGSCC-NEXT: [[TMP4:%.*]] = phi i32 [ [[TMP5:%.*]], [[TMP2]] ], [ 1, [[TMP0]] ] +; CGSCC-NEXT: [[TMP5]] = mul nsw i32 [[TMP3]], [[TMP4]] +; CGSCC-NEXT: [[TMP6]] = add nuw nsw i32 [[TMP3]], 1 +; CGSCC-NEXT: [[TMP7:%.*]] = icmp eq i32 [[TMP3]], 10 +; CGSCC-NEXT: br i1 [[TMP7]], label [[TMP1:%.*]], label [[TMP2]] ; %2 = icmp slt i32 %0, 1 br i1 %2, label %3, label %5 @@ -71,27 +69,27 @@ } define i32 @volatile_load(i32*) norecurse nounwind uwtable { -; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nounwind uwtable willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@volatile_load -; NOT_CGSCC_NPM-SAME: (i32* nofree align 4 [[TMP0:%.*]]) #[[ATTR6:[0-9]+]] { -; 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]] +; MODULE: Function Attrs: argmemonly nofree norecurse nounwind uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@volatile_load +; MODULE-SAME: (i32* nofree align 4 [[TMP0:%.*]]) #[[ATTR6:[0-9]+]] { +; MODULE-NEXT: [[TMP2:%.*]] = load volatile i32, i32* [[TMP0]], align 4 +; MODULE-NEXT: ret i32 [[TMP2]] +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nounwind uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@volatile_load +; CGSCC-SAME: (i32* nofree align 4 [[TMP0:%.*]]) #[[ATTR7:[0-9]+]] { +; CGSCC-NEXT: [[TMP2:%.*]] = load volatile i32, i32* [[TMP0]], align 4 +; CGSCC-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@internal_load +; CGSCC-SAME: () #[[ATTR8:[0-9]+]] { +; CGSCC-NEXT: ret i32 undef ; %2 = load i32, i32* %0, align 4 ret i32 %2 @@ -142,37 +140,37 @@ ; dead block and check if it is deduced. define i32 @dead_block_present(i32 %a, i32* %ptr1) #0 { -; NOT_CGSCC_NPM: Function Attrs: nosync -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@dead_block_present -; NOT_CGSCC_NPM-SAME: (i32 [[A:%.*]], i32* nocapture nofree readnone [[PTR1:%.*]]) #[[ATTR7:[0-9]+]] { -; NOT_CGSCC_NPM-NEXT: entry: -; NOT_CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp eq i32 [[A]], 0 -; NOT_CGSCC_NPM-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] -; NOT_CGSCC_NPM: cond.true: -; NOT_CGSCC_NPM-NEXT: call void @no_return_call() #[[ATTR3]] -; NOT_CGSCC_NPM-NEXT: unreachable -; NOT_CGSCC_NPM: cond.false: -; NOT_CGSCC_NPM-NEXT: call void @normal_call() -; NOT_CGSCC_NPM-NEXT: [[CALL1:%.*]] = call i32 @bar() -; NOT_CGSCC_NPM-NEXT: br label [[COND_END:%.*]] -; 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]] +; MODULE: Function Attrs: nosync +; MODULE-LABEL: define {{[^@]+}}@dead_block_present +; MODULE-SAME: (i32 [[A:%.*]], i32* nocapture nofree readnone [[PTR1:%.*]]) #[[ATTR7:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[CMP:%.*]] = icmp eq i32 [[A]], 0 +; MODULE-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] +; MODULE: cond.true: +; MODULE-NEXT: call void @no_return_call() #[[ATTR3]] +; MODULE-NEXT: unreachable +; MODULE: cond.false: +; MODULE-NEXT: call void @normal_call() +; MODULE-NEXT: [[CALL1:%.*]] = call i32 @bar() +; MODULE-NEXT: br label [[COND_END:%.*]] +; MODULE: cond.end: +; MODULE-NEXT: ret i32 [[CALL1]] +; +; CGSCC: Function Attrs: nosync +; CGSCC-LABEL: define {{[^@]+}}@dead_block_present +; CGSCC-SAME: (i32 [[A:%.*]], i32* nocapture nofree readnone [[PTR1:%.*]]) #[[ATTR9:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[CMP:%.*]] = icmp eq i32 [[A]], 0 +; CGSCC-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] +; CGSCC: cond.true: +; CGSCC-NEXT: call void @no_return_call() #[[ATTR3]] +; CGSCC-NEXT: unreachable +; CGSCC: cond.false: +; CGSCC-NEXT: call void @normal_call() +; CGSCC-NEXT: [[CALL1:%.*]] = call i32 @bar() +; CGSCC-NEXT: br label [[COND_END:%.*]] +; CGSCC: cond.end: +; CGSCC-NEXT: ret i32 [[CALL1]] ; entry: %cmp = icmp eq i32 %a, 0 @@ -518,23 +516,17 @@ ; 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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@ub +; MODULE-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]]) #[[ATTR8:[0-9]+]] { +; MODULE-NEXT: store i32 0, i32* undef, align 4294967296 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@ub +; CGSCC-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]]) #[[ATTR10:[0-9]+]] { +; CGSCC-NEXT: store i32 0, i32* undef, align 4294967296 +; CGSCC-NEXT: ret void ; %poison = sub nuw i32 0, 1 ; Results in a poison value. %still_poison = and i32 %poison, 0 ; 0, but also poison. @@ -544,21 +536,21 @@ } define void @inf_loop() #0 { -; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@inf_loop -; NOT_CGSCC_NPM-SAME: () #[[ATTR9:[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 -; 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]] +; MODULE: Function Attrs: nofree noreturn nosync nounwind readnone +; MODULE-LABEL: define {{[^@]+}}@inf_loop +; MODULE-SAME: () #[[ATTR9:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: br label [[WHILE_BODY:%.*]] +; MODULE: while.body: +; MODULE-NEXT: br label [[WHILE_BODY]] +; +; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind readnone +; CGSCC-LABEL: define {{[^@]+}}@inf_loop +; CGSCC-SAME: () #[[ATTR11:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br label [[WHILE_BODY:%.*]] +; CGSCC: while.body: +; CGSCC-NEXT: br label [[WHILE_BODY]] ; entry: br label %while.body @@ -608,17 +600,17 @@ } define void @rec() #0 { -; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@rec -; NOT_CGSCC_NPM-SAME: () #[[ATTR10:[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 {{[^@]+}}@rec -; IS__CGSCC____-SAME: () #[[ATTR12:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: unreachable +; MODULE: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@rec +; MODULE-SAME: () #[[ATTR10:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: unreachable +; +; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@rec +; CGSCC-SAME: () #[[ATTR12:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: unreachable ; entry: call void @rec() @@ -630,31 +622,31 @@ ; and unreachable should be put after call to @rec(). define i32 @test6(i32, i32) #0 { -; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test6 -; NOT_CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR10]] { -; NOT_CGSCC_NPM-NEXT: unreachable -; NOT_CGSCC_NPM: cond.if: -; NOT_CGSCC_NPM-NEXT: unreachable -; NOT_CGSCC_NPM: cond.elseif: -; NOT_CGSCC_NPM-NEXT: unreachable -; NOT_CGSCC_NPM: cond.else: -; NOT_CGSCC_NPM-NEXT: unreachable -; 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 +; MODULE: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test6 +; MODULE-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR10]] { +; MODULE-NEXT: unreachable +; MODULE: cond.if: +; MODULE-NEXT: unreachable +; MODULE: cond.elseif: +; MODULE-NEXT: unreachable +; MODULE: cond.else: +; MODULE-NEXT: unreachable +; MODULE: cond.end: +; MODULE-NEXT: unreachable +; +; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test6 +; CGSCC-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR12]] { +; CGSCC-NEXT: unreachable +; CGSCC: cond.if: +; CGSCC-NEXT: unreachable +; CGSCC: cond.elseif: +; CGSCC-NEXT: unreachable +; CGSCC: cond.else: +; CGSCC-NEXT: unreachable +; CGSCC: cond.end: +; CGSCC-NEXT: unreachable ; call void @rec() %3 = icmp sgt i32 %0, %1 @@ -721,17 +713,14 @@ } ; SCC test -; ; char a1 __attribute__((aligned(8))); ; char a2 __attribute__((aligned(16))); -; ; char* f1(char* a ){ ; return a?a:f2(&a1); ; } ; char* f2(char* a){ ; return a?f1(a):f3(&a2); ; } -; ; char* f3(char* a){ ; return a?&a1: f1(&a2); ; } @@ -740,16 +729,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]] +; CGSCC-LABEL: define {{[^@]+}}@f1 +; CGSCC-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr { +; CGSCC-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP0]], null +; CGSCC-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] +; CGSCC: 3: +; CGSCC-NEXT: [[TMP4:%.*]] = tail call i8* @f2(i8* nonnull @a1) +; CGSCC-NEXT: br label [[TMP5]] +; CGSCC: 5: +; CGSCC-NEXT: [[TMP6:%.*]] = phi i8* [ [[TMP4]], [[TMP3]] ], [ [[TMP0]], [[TMP1:%.*]] ] +; CGSCC-NEXT: ret i8* [[TMP6]] ; %2 = icmp eq i8* %0, null br i1 %2, label %3, label %5 @@ -764,19 +753,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]] +; CGSCC-LABEL: define {{[^@]+}}@f2 +; CGSCC-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr { +; CGSCC-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP0]], null +; CGSCC-NEXT: br i1 [[TMP2]], label [[TMP5:%.*]], label [[TMP3:%.*]] +; CGSCC: 3: +; CGSCC-NEXT: [[TMP4:%.*]] = tail call i8* @f1(i8* nonnull [[TMP0]]) +; CGSCC-NEXT: br label [[TMP7:%.*]] +; CGSCC: 5: +; CGSCC-NEXT: [[TMP6:%.*]] = tail call i8* @f3(i8* nonnull @a2) +; CGSCC-NEXT: br label [[TMP7]] +; CGSCC: 7: +; CGSCC-NEXT: [[TMP8:%.*]] = phi i8* [ [[TMP4]], [[TMP3]] ], [ [[TMP6]], [[TMP5]] ] +; CGSCC-NEXT: ret i8* [[TMP8]] ; %2 = icmp eq i8* %0, null br i1 %2, label %5, label %3 @@ -796,16 +785,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]] +; CGSCC-LABEL: define {{[^@]+}}@f3 +; CGSCC-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr { +; CGSCC-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP0]], null +; CGSCC-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] +; CGSCC: 3: +; CGSCC-NEXT: [[TMP4:%.*]] = tail call i8* @f1(i8* nonnull @a2) +; CGSCC-NEXT: br label [[TMP5]] +; CGSCC: 5: +; CGSCC-NEXT: [[TMP6:%.*]] = phi i8* [ [[TMP4]], [[TMP3]] ], [ @a1, [[TMP1:%.*]] ] +; CGSCC-NEXT: ret i8* [[TMP6]] ; %2 = icmp eq i8* %0, null br i1 %2, label %3, label %5 @@ -821,19 +810,19 @@ declare void @sink() nofree nosync nounwind willreturn define void @test_unreachable() { -; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test_unreachable -; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14:[0-9]+]] -; NOT_CGSCC_NPM-NEXT: call void @test_unreachable() #[[ATTR0]] -; NOT_CGSCC_NPM-NEXT: unreachable +; MODULE: Function Attrs: nofree noreturn nosync nounwind +; MODULE-LABEL: define {{[^@]+}}@test_unreachable +; MODULE-SAME: () #[[ATTR0]] { +; MODULE-NEXT: call void @sink() #[[ATTR14:[0-9]+]] +; MODULE-NEXT: call void @test_unreachable() #[[ATTR0]] +; MODULE-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 +; CGSCC: Function Attrs: nofree noreturn nosync nounwind +; CGSCC-LABEL: define {{[^@]+}}@test_unreachable +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17:[0-9]+]] +; CGSCC-NEXT: call void @test_unreachable() #[[ATTR0]] +; CGSCC-NEXT: unreachable ; call void @sink() call void @test_unreachable() @@ -881,63 +870,63 @@ ret void } define internal void @middle() { -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@middle() { -; NOT_CGSCC_NPM-NEXT: bb0: -; NOT_CGSCC_NPM-NEXT: call void @non_dead_b0() #[[ATTR11:[0-9]+]] -; NOT_CGSCC_NPM-NEXT: call void @non_dead_b1() #[[ATTR11]] -; NOT_CGSCC_NPM-NEXT: call void @non_dead_b2() #[[ATTR11]] -; NOT_CGSCC_NPM-NEXT: call void @non_dead_b3() #[[ATTR11]] -; NOT_CGSCC_NPM-NEXT: br label [[BB1:%.*]] -; NOT_CGSCC_NPM: bb1: -; NOT_CGSCC_NPM-NEXT: call void @non_dead_b4() #[[ATTR11]] -; NOT_CGSCC_NPM-NEXT: call void @non_dead_b5() #[[ATTR11]] -; NOT_CGSCC_NPM-NEXT: call void @non_dead_b6() #[[ATTR11]] -; NOT_CGSCC_NPM-NEXT: call void @non_dead_b7() #[[ATTR11]] -; NOT_CGSCC_NPM-NEXT: br label [[BB2:%.*]] -; NOT_CGSCC_NPM: bb2: -; NOT_CGSCC_NPM-NEXT: call void @non_dead_b8() #[[ATTR11]] -; NOT_CGSCC_NPM-NEXT: call void @non_dead_b9() #[[ATTR11]] -; NOT_CGSCC_NPM-NEXT: call void @non_dead_b10() #[[ATTR11]] -; NOT_CGSCC_NPM-NEXT: call void @non_dead_b11() #[[ATTR11]] -; NOT_CGSCC_NPM-NEXT: br label [[BB3:%.*]] -; NOT_CGSCC_NPM: bb3: -; NOT_CGSCC_NPM-NEXT: call void @non_dead_b12() #[[ATTR11]] -; NOT_CGSCC_NPM-NEXT: call void @non_dead_b13() #[[ATTR11]] -; NOT_CGSCC_NPM-NEXT: call void @non_dead_b14() #[[ATTR11]] -; NOT_CGSCC_NPM-NEXT: call void @non_dead_b15() #[[ATTR11]] -; NOT_CGSCC_NPM-NEXT: br label [[BB4:%.*]] -; NOT_CGSCC_NPM: bb4: -; 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 +; MODULE-LABEL: define {{[^@]+}}@middle() { +; MODULE-NEXT: bb0: +; MODULE-NEXT: call void @non_dead_b0() #[[ATTR11:[0-9]+]] +; MODULE-NEXT: call void @non_dead_b1() #[[ATTR11]] +; MODULE-NEXT: call void @non_dead_b2() #[[ATTR11]] +; MODULE-NEXT: call void @non_dead_b3() #[[ATTR11]] +; MODULE-NEXT: br label [[BB1:%.*]] +; MODULE: bb1: +; MODULE-NEXT: call void @non_dead_b4() #[[ATTR11]] +; MODULE-NEXT: call void @non_dead_b5() #[[ATTR11]] +; MODULE-NEXT: call void @non_dead_b6() #[[ATTR11]] +; MODULE-NEXT: call void @non_dead_b7() #[[ATTR11]] +; MODULE-NEXT: br label [[BB2:%.*]] +; MODULE: bb2: +; MODULE-NEXT: call void @non_dead_b8() #[[ATTR11]] +; MODULE-NEXT: call void @non_dead_b9() #[[ATTR11]] +; MODULE-NEXT: call void @non_dead_b10() #[[ATTR11]] +; MODULE-NEXT: call void @non_dead_b11() #[[ATTR11]] +; MODULE-NEXT: br label [[BB3:%.*]] +; MODULE: bb3: +; MODULE-NEXT: call void @non_dead_b12() #[[ATTR11]] +; MODULE-NEXT: call void @non_dead_b13() #[[ATTR11]] +; MODULE-NEXT: call void @non_dead_b14() #[[ATTR11]] +; MODULE-NEXT: call void @non_dead_b15() #[[ATTR11]] +; MODULE-NEXT: br label [[BB4:%.*]] +; MODULE: bb4: +; MODULE-NEXT: call void @non_exact2() +; MODULE-NEXT: ret void +; +; CGSCC-LABEL: define {{[^@]+}}@middle() { +; CGSCC-NEXT: bb0: +; CGSCC-NEXT: call void @non_dead_b0() #[[ATTR17]] +; CGSCC-NEXT: call void @non_dead_b1() #[[ATTR17]] +; CGSCC-NEXT: call void @non_dead_b2() #[[ATTR17]] +; CGSCC-NEXT: call void @non_dead_b3() #[[ATTR17]] +; CGSCC-NEXT: br label [[BB1:%.*]] +; CGSCC: bb1: +; CGSCC-NEXT: call void @non_dead_b4() #[[ATTR17]] +; CGSCC-NEXT: call void @non_dead_b5() #[[ATTR17]] +; CGSCC-NEXT: call void @non_dead_b6() #[[ATTR17]] +; CGSCC-NEXT: call void @non_dead_b7() #[[ATTR17]] +; CGSCC-NEXT: br label [[BB2:%.*]] +; CGSCC: bb2: +; CGSCC-NEXT: call void @non_dead_b8() #[[ATTR17]] +; CGSCC-NEXT: call void @non_dead_b9() #[[ATTR17]] +; CGSCC-NEXT: call void @non_dead_b10() #[[ATTR17]] +; CGSCC-NEXT: call void @non_dead_b11() #[[ATTR17]] +; CGSCC-NEXT: br label [[BB3:%.*]] +; CGSCC: bb3: +; CGSCC-NEXT: call void @non_dead_b12() #[[ATTR17]] +; CGSCC-NEXT: call void @non_dead_b13() #[[ATTR17]] +; CGSCC-NEXT: call void @non_dead_b14() #[[ATTR17]] +; CGSCC-NEXT: call void @non_dead_b15() #[[ATTR17]] +; CGSCC-NEXT: br label [[BB4:%.*]] +; CGSCC: bb4: +; CGSCC-NEXT: call void @non_exact2() +; CGSCC-NEXT: ret void ; bb0: call void @non_dead_b0() @@ -1050,1033 +1039,1033 @@ } define internal void @non_dead_a0() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a0 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_a0 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_a0 +; CGSCC-SAME: () #[[ATTR13:[0-9]+]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_a1() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a1 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_a1 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_a1 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_a2() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a2 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_a2 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_a2 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_a3() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a3 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_a3 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_a3 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_a4() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a4 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_a4 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_a4 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_a5() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a5 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_a5 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_a5 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_a6() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a6 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_a6 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_a6 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_a7() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a7 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_a7 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_a7 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_a8() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a8 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_a8 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_a8 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_a9() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a9 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_a9 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_a9 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_a10() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a10 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_a10 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_a10 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_a11() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a11 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_a11 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_a11 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_a12() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a12 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_a12 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_a12 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_a13() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a13 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_a13 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_a13 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_a14() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a14 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_a14 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_a14 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_a15() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_a15 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_a15 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_a15 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_b0() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b0 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_b0 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_b0 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_b1() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b1 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_b1 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_b1 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_b2() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b2 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_b2 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_b2 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_b3() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b3 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_b3 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_b3 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_b4() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b4 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_b4 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_b4 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_b5() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b5 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_b5 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_b5 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_b6() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b6 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_b6 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_b6 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_b7() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b7 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_b7 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_b7 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_b8() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b8 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_b8 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_b8 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_b9() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b9 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_b9 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_b9 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_b10() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b10 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_b10 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_b10 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_b11() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b11 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_b11 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_b11 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_b12() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b12 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_b12 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_b12 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_b13() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b13 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_b13 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_b13 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_b14() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b14 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_b14 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_b14 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_b15() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_b15 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_b15 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_b15 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_c0() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c0 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_c0 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_c0 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_c1() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c1 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_c1 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_c1 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_c2() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c2 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_c2 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_c2 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_c3() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c3 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_c3 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_c3 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_c4() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c4 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_c4 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_c4 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_c5() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c5 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_c5 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_c5 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_c6() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c6 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_c6 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_c6 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_c7() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c7 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_c7 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_c7 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_c8() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c8 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_c8 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_c8 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_c9() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c9 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_c9 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_c9 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_c10() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c10 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_c10 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_c10 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_c11() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c11 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_c11 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_c11 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_c12() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c12 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_c12 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_c12 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_c13() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c13 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_c13 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_c13 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_c14() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c14 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_c14 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_c14 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_c15() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_c15 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_c15 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_c15 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_d0() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d0 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_d0 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_d0 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_d1() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d1 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_d1 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_d1 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_d2() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d2 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_d2 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_d2 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_d3() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d3 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_d3 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_d3 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_d4() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d4 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_d4 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_d4 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_d5() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d5 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_d5 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_d5 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_d6() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d6 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_d6 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_d6 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_d7() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d7 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_d7 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_d7 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_d8() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d8 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_d8 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_d8 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_d9() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d9 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_d9 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_d9 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_d10() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d10 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_d10 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_d10 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_d11() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d11 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_d11 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_d11 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_d12() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d12 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_d12 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_d12 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_d13() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d13 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_d13 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_d13 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_d14() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d14 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_d14 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_d14 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @non_dead_d15() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@non_dead_d15 -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@non_dead_d15 +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_dead_d15 +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-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 +; CGSCC-LABEL: define {{[^@]+}}@dead_e0() { +; CGSCC-NEXT: call void @dead_e1() +; CGSCC-NEXT: ret void ; define internal void @dead_e1() { call void @dead_e2() ret void } define internal void @dead_e2() { ret void } @@ -2130,34 +2119,34 @@ } define internal void @useless_arg_sink(i32* %a) { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@useless_arg_sink -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@useless_arg_sink +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-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 +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@useless_arg_sink +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @sink() ret void } define internal void @useless_arg_almost_sink(i32* %a) { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@useless_arg_almost_sink -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; 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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@useless_arg_almost_sink +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: call void @useless_arg_sink() #[[ATTR11]] +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@useless_arg_almost_sink +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @useless_arg_sink() #[[ATTR17]] +; CGSCC-NEXT: ret void ; call void @useless_arg_sink(i32* %a) ret void @@ -2197,33 +2186,33 @@ ; FIXME: We should fold terminators. define internal i32 @switch_default(i64 %i) nounwind { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@switch_default -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; NOT_CGSCC_NPM-NEXT: entry: -; NOT_CGSCC_NPM-NEXT: switch i64 0, label [[SW_DEFAULT:%.*]] [ -; NOT_CGSCC_NPM-NEXT: i64 3, label [[RETURN:%.*]] -; NOT_CGSCC_NPM-NEXT: i64 10, label [[RETURN]] -; NOT_CGSCC_NPM-NEXT: ] -; NOT_CGSCC_NPM: sw.default: -; NOT_CGSCC_NPM-NEXT: call void @sink() #[[ATTR14]] -; NOT_CGSCC_NPM-NEXT: ret i32 undef -; NOT_CGSCC_NPM: return: -; NOT_CGSCC_NPM-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@switch_default -; IS__CGSCC____-SAME: () #[[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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@switch_default +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: switch i64 0, label [[SW_DEFAULT:%.*]] [ +; MODULE-NEXT: i64 3, label [[RETURN:%.*]] +; MODULE-NEXT: i64 10, label [[RETURN]] +; MODULE-NEXT: ] +; MODULE: sw.default: +; MODULE-NEXT: call void @sink() #[[ATTR14]] +; MODULE-NEXT: ret i32 undef +; MODULE: return: +; MODULE-NEXT: unreachable +; +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@switch_default +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: switch i64 0, label [[SW_DEFAULT:%.*]] [ +; CGSCC-NEXT: i64 3, label [[RETURN:%.*]] +; CGSCC-NEXT: i64 10, label [[RETURN]] +; CGSCC-NEXT: ] +; CGSCC: sw.default: +; CGSCC-NEXT: call void @sink() #[[ATTR17]] +; CGSCC-NEXT: ret i32 undef +; CGSCC: return: +; CGSCC-NEXT: unreachable ; entry: switch i64 %i, label %sw.default [ @@ -2240,35 +2229,35 @@ } define i32 @switch_default_caller() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@switch_default_caller -; NOT_CGSCC_NPM-SAME: () #[[ATTR11]] { -; 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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@switch_default_caller +; MODULE-SAME: () #[[ATTR11]] { +; MODULE-NEXT: [[CALL2:%.*]] = tail call i32 @switch_default() #[[ATTR11]] +; MODULE-NEXT: ret i32 123 +; +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@switch_default_caller +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: [[CALL2:%.*]] = tail call i32 @switch_default() #[[ATTR17]] +; CGSCC-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@switch_default_dead +; CGSCC-SAME: () #[[ATTR6]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: switch i64 0, label [[SW_DEFAULT:%.*]] [ +; CGSCC-NEXT: i64 3, label [[RETURN:%.*]] +; CGSCC-NEXT: i64 10, label [[RETURN]] +; CGSCC-NEXT: ] +; CGSCC: sw.default: +; CGSCC-NEXT: ret i32 undef +; CGSCC: return: +; CGSCC-NEXT: unreachable ; entry: switch i64 %i, label %sw.default [ @@ -2284,15 +2273,15 @@ } define i32 @switch_default_dead_caller() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@switch_default_dead_caller -; NOT_CGSCC_NPM-SAME: () #[[ATTR12:[0-9]+]] { -; NOT_CGSCC_NPM-NEXT: ret i32 123 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@switch_default_dead_caller +; MODULE-SAME: () #[[ATTR12:[0-9]+]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@switch_default_dead_caller +; CGSCC-SAME: () #[[ATTR6]] { +; CGSCC-NEXT: ret i32 123 ; %call2 = tail call i32 @switch_default_dead(i64 0) ret i32 %call2 @@ -2309,57 +2298,57 @@ } ; FIXME: We have to prevent the propagation of %fp in the new pm CGSCC pass until the CallGraphUpdater can handle the new call edge. define internal void @call_via_pointer_with_dead_args_internal_a(i32* %a, i32* %b, void (i32*, i32*, i32*, i64, i32**)* %fp) { -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@call_via_pointer_with_dead_args_internal_a -; NOT_CGSCC_NPM-SAME: (i32* [[A:%.*]], i32* noundef nonnull align 128 dereferenceable(4) [[B:%.*]]) { -; 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 +; MODULE-LABEL: define {{[^@]+}}@call_via_pointer_with_dead_args_internal_a +; MODULE-SAME: (i32* [[A:%.*]], i32* noundef nonnull align 128 dereferenceable(4) [[B:%.*]]) { +; MODULE-NEXT: call void @called_via_pointer(i32* [[A]], i32* nonnull align 128 dereferenceable(4) [[B]], i32* [[A]], i64 -1, i32** null) +; MODULE-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 +; CGSCC-LABEL: define {{[^@]+}}@call_via_pointer_with_dead_args_internal_a +; CGSCC-SAME: (i32* [[A:%.*]], i32* noundef nonnull align 128 dereferenceable(4) [[B:%.*]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef nonnull [[FP:%.*]]) { +; CGSCC-NEXT: call void [[FP]](i32* [[A]], i32* nonnull align 128 dereferenceable(4) [[B]], i32* [[A]], i64 -1, i32** null) +; CGSCC-NEXT: ret void ; call void %fp(i32* %a, i32* %b, i32* %a, i64 -1, i32** null) ret void } define internal void @call_via_pointer_with_dead_args_internal_b(i32* %a, i32* %b, void (i32*, i32*, i32*, i64, i32**)* %fp) { -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@call_via_pointer_with_dead_args_internal_b -; NOT_CGSCC_NPM-SAME: (i32* [[A:%.*]], i32* noundef nonnull align 128 dereferenceable(4) [[B:%.*]]) { -; 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 +; MODULE-LABEL: define {{[^@]+}}@call_via_pointer_with_dead_args_internal_b +; MODULE-SAME: (i32* [[A:%.*]], i32* noundef nonnull align 128 dereferenceable(4) [[B:%.*]]) { +; MODULE-NEXT: call void @called_via_pointer_internal_2(i32* [[A]], i32* nonnull align 128 dereferenceable(4) [[B]], i32* [[A]], i64 -1, i32** null) +; MODULE-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 +; CGSCC-LABEL: define {{[^@]+}}@call_via_pointer_with_dead_args_internal_b +; CGSCC-SAME: (i32* [[A:%.*]], i32* noundef nonnull align 128 dereferenceable(4) [[B:%.*]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef nonnull [[FP:%.*]]) { +; CGSCC-NEXT: call void [[FP]](i32* [[A]], i32* nonnull align 128 dereferenceable(4) [[B]], i32* [[A]], i64 -1, i32** null) +; CGSCC-NEXT: ret void ; call void %fp(i32* %a, i32* %b, i32* %a, i64 -1, i32** null) ret void } define void @call_via_pointer_with_dead_args_caller(i32* %a, i32* %b) { -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@call_via_pointer_with_dead_args_caller -; NOT_CGSCC_NPM-SAME: (i32* [[A:%.*]], i32* [[B:%.*]]) { -; NOT_CGSCC_NPM-NEXT: [[PTR1:%.*]] = alloca i32, align 128 -; NOT_CGSCC_NPM-NEXT: [[PTR2:%.*]] = alloca i32, align 128 -; NOT_CGSCC_NPM-NEXT: [[PTR3:%.*]] = alloca i32, align 128 -; NOT_CGSCC_NPM-NEXT: [[PTR4:%.*]] = alloca i32, align 128 -; NOT_CGSCC_NPM-NEXT: call void @call_via_pointer_with_dead_args(i32* [[A]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR1]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef @called_via_pointer) -; NOT_CGSCC_NPM-NEXT: call void @call_via_pointer_with_dead_args(i32* [[A]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR2]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef @called_via_pointer_internal_1) -; NOT_CGSCC_NPM-NEXT: call void @call_via_pointer_with_dead_args_internal_a(i32* [[B]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR3]]) -; 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 +; MODULE-LABEL: define {{[^@]+}}@call_via_pointer_with_dead_args_caller +; MODULE-SAME: (i32* [[A:%.*]], i32* [[B:%.*]]) { +; MODULE-NEXT: [[PTR1:%.*]] = alloca i32, align 128 +; MODULE-NEXT: [[PTR2:%.*]] = alloca i32, align 128 +; MODULE-NEXT: [[PTR3:%.*]] = alloca i32, align 128 +; MODULE-NEXT: [[PTR4:%.*]] = alloca i32, align 128 +; MODULE-NEXT: call void @call_via_pointer_with_dead_args(i32* [[A]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR1]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef @called_via_pointer) +; MODULE-NEXT: call void @call_via_pointer_with_dead_args(i32* [[A]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR2]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef @called_via_pointer_internal_1) +; MODULE-NEXT: call void @call_via_pointer_with_dead_args_internal_a(i32* [[B]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR3]]) +; MODULE-NEXT: call void @call_via_pointer_with_dead_args_internal_b(i32* [[B]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR4]]) +; MODULE-NEXT: ret void +; +; CGSCC-LABEL: define {{[^@]+}}@call_via_pointer_with_dead_args_caller +; CGSCC-SAME: (i32* [[A:%.*]], i32* [[B:%.*]]) { +; CGSCC-NEXT: [[PTR1:%.*]] = alloca i32, align 128 +; CGSCC-NEXT: [[PTR2:%.*]] = alloca i32, align 128 +; CGSCC-NEXT: [[PTR3:%.*]] = alloca i32, align 128 +; CGSCC-NEXT: [[PTR4:%.*]] = alloca i32, align 128 +; 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) +; 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) +; 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) +; 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) +; CGSCC-NEXT: ret void ; %ptr1 = alloca i32, align 128 %ptr2 = alloca i32, align 128 @@ -2415,36 +2404,19 @@ ; 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] +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone +; CGSCC-LABEL: define {{[^@]+}}@dead_with_blockaddress_users +; CGSCC-SAME: () #[[ATTR14:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br label [[INDIRECTGOTO:%.*]] +; CGSCC: lab0: +; CGSCC-NEXT: [[INDVAR_NEXT:%.*]] = add i32 [[INDVAR:%.*]], 1 +; CGSCC-NEXT: br label [[INDIRECTGOTO]] +; CGSCC: end: +; CGSCC-NEXT: ret void +; CGSCC: indirectgoto: +; CGSCC-NEXT: [[INDVAR]] = phi i32 [ [[INDVAR_NEXT]], [[LAB0:%.*]] ], [ 0, [[ENTRY:%.*]] ] +; CGSCC-NEXT: indirectbr i8* undef, [label [[LAB0]], label %end] ; entry: br label %indirectgoto @@ -2473,59 +2445,59 @@ @e = global %struct.a* null define i32 @main() { -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@main() { -; NOT_CGSCC_NPM-NEXT: entry: -; NOT_CGSCC_NPM-NEXT: [[F:%.*]] = alloca i32, align 4 -; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND_0:%.*]] -; NOT_CGSCC_NPM: for.cond.0: -; NOT_CGSCC_NPM-NEXT: [[G_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY_0:%.*]] ] -; NOT_CGSCC_NPM-NEXT: [[CMP_0:%.*]] = icmp ult i32 [[G_0]], 100 -; NOT_CGSCC_NPM-NEXT: br i1 [[CMP_0]], label [[FOR_BODY_0]], label [[FOR_END_0:%.*]] -; NOT_CGSCC_NPM: for.body.0: -; NOT_CGSCC_NPM-NEXT: [[INC]] = add nuw nsw i32 [[G_0]], 1 -; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND_0]] -; NOT_CGSCC_NPM: for.end.0: -; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i8* @malloc(i64 noundef 8) -; NOT_CGSCC_NPM-NEXT: store i8* [[CALL]], i8** bitcast (%struct.a** @e to i8**), align 8 -; NOT_CGSCC_NPM-NEXT: [[B:%.*]] = bitcast i8* [[CALL]] to %struct.a** -; NOT_CGSCC_NPM-NEXT: store %struct.a* null, %struct.a** [[B]], align 8 -; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND_1:%.*]] -; NOT_CGSCC_NPM: for.cond.1: -; NOT_CGSCC_NPM-NEXT: [[G_1:%.*]] = phi i32 [ 0, [[FOR_END_0]] ], [ [[INC6:%.*]], [[FOR_BODY_1:%.*]] ] -; NOT_CGSCC_NPM-NEXT: [[CMP_1:%.*]] = icmp ult i32 [[G_1]], 100 -; NOT_CGSCC_NPM-NEXT: br i1 [[CMP_1]], label [[FOR_BODY_1]], label [[FOR_END_1:%.*]] -; NOT_CGSCC_NPM: for.body.1: -; NOT_CGSCC_NPM-NEXT: [[CALL4:%.*]] = call i32 (i32*, ...) bitcast (i32 (i32)* @h to i32 (i32*, ...)*)(i32* nonnull [[F]]) -; NOT_CGSCC_NPM-NEXT: [[INC6]] = add nuw nsw i32 [[G_1]], 1 -; NOT_CGSCC_NPM-NEXT: br label [[FOR_COND_1]] -; 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 +; MODULE-LABEL: define {{[^@]+}}@main() { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[F:%.*]] = alloca i32, align 4 +; MODULE-NEXT: br label [[FOR_COND_0:%.*]] +; MODULE: for.cond.0: +; MODULE-NEXT: [[G_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY_0:%.*]] ] +; MODULE-NEXT: [[CMP_0:%.*]] = icmp ult i32 [[G_0]], 100 +; MODULE-NEXT: br i1 [[CMP_0]], label [[FOR_BODY_0]], label [[FOR_END_0:%.*]] +; MODULE: for.body.0: +; MODULE-NEXT: [[INC]] = add nuw nsw i32 [[G_0]], 1 +; MODULE-NEXT: br label [[FOR_COND_0]] +; MODULE: for.end.0: +; MODULE-NEXT: [[CALL:%.*]] = call i8* @malloc(i64 noundef 8) +; MODULE-NEXT: store i8* [[CALL]], i8** bitcast (%struct.a** @e to i8**), align 8 +; MODULE-NEXT: [[B:%.*]] = bitcast i8* [[CALL]] to %struct.a** +; MODULE-NEXT: store %struct.a* null, %struct.a** [[B]], align 8 +; MODULE-NEXT: br label [[FOR_COND_1:%.*]] +; MODULE: for.cond.1: +; MODULE-NEXT: [[G_1:%.*]] = phi i32 [ 0, [[FOR_END_0]] ], [ [[INC6:%.*]], [[FOR_BODY_1:%.*]] ] +; MODULE-NEXT: [[CMP_1:%.*]] = icmp ult i32 [[G_1]], 100 +; MODULE-NEXT: br i1 [[CMP_1]], label [[FOR_BODY_1]], label [[FOR_END_1:%.*]] +; MODULE: for.body.1: +; MODULE-NEXT: [[CALL4:%.*]] = call i32 (i32*, ...) bitcast (i32 (i32)* @h to i32 (i32*, ...)*)(i32* nonnull [[F]]) +; MODULE-NEXT: [[INC6]] = add nuw nsw i32 [[G_1]], 1 +; MODULE-NEXT: br label [[FOR_COND_1]] +; MODULE: for.end.1: +; MODULE-NEXT: ret i32 0 +; +; CGSCC-LABEL: define {{[^@]+}}@main() { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br label [[FOR_COND_0:%.*]] +; CGSCC: for.cond.0: +; CGSCC-NEXT: [[G_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY_0:%.*]] ] +; CGSCC-NEXT: [[CMP_0:%.*]] = icmp ult i32 [[G_0]], 100 +; CGSCC-NEXT: br i1 [[CMP_0]], label [[FOR_BODY_0]], label [[FOR_END_0:%.*]] +; CGSCC: for.body.0: +; CGSCC-NEXT: [[INC]] = add nuw nsw i32 [[G_0]], 1 +; CGSCC-NEXT: br label [[FOR_COND_0]] +; CGSCC: for.end.0: +; CGSCC-NEXT: [[CALL:%.*]] = call i8* @malloc(i64 noundef 8) +; CGSCC-NEXT: store i8* [[CALL]], i8** bitcast (%struct.a** @e to i8**), align 8 +; CGSCC-NEXT: [[B:%.*]] = bitcast i8* [[CALL]] to %struct.a** +; CGSCC-NEXT: store %struct.a* null, %struct.a** [[B]], align 8 +; CGSCC-NEXT: br label [[FOR_COND_1:%.*]] +; CGSCC: for.cond.1: +; CGSCC-NEXT: [[G_1:%.*]] = phi i32 [ 0, [[FOR_END_0]] ], [ [[INC6:%.*]], [[FOR_BODY_1:%.*]] ] +; CGSCC-NEXT: [[CMP_1:%.*]] = icmp ult i32 [[G_1]], 100 +; CGSCC-NEXT: br i1 [[CMP_1]], label [[FOR_BODY_1]], label [[FOR_END_1:%.*]] +; CGSCC: for.body.1: +; CGSCC-NEXT: [[INC6]] = add nuw nsw i32 [[G_1]], 1 +; CGSCC-NEXT: br label [[FOR_COND_1]] +; CGSCC: for.end.1: +; CGSCC-NEXT: ret i32 0 ; entry: %f = alloca i32 @@ -2564,15 +2536,15 @@ declare noalias i8* @malloc(i64) define i32 @h(i32 %i) { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@h -; NOT_CGSCC_NPM-SAME: (i32 [[I:%.*]]) #[[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: ret i32 0 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@h +; MODULE-SAME: (i32 [[I:%.*]]) #[[ATTR12]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@h +; CGSCC-SAME: (i32 [[I:%.*]]) #[[ATTR6]] { +; CGSCC-NEXT: ret i32 0 ; ret i32 0 } @@ -2583,41 +2555,41 @@ @p = global i8 0 define void @bad_gep() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@bad_gep -; NOT_CGSCC_NPM-SAME: () #[[ATTR12]] { -; NOT_CGSCC_NPM-NEXT: entry: -; NOT_CGSCC_NPM-NEXT: [[N:%.*]] = alloca i8, align 1 -; NOT_CGSCC_NPM-NEXT: [[M:%.*]] = alloca i8, align 1 -; NOT_CGSCC_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 1, i8* noalias nocapture nofree noundef nonnull dereferenceable(1) [[N]]) #[[ATTR15:[0-9]+]] -; NOT_CGSCC_NPM-NEXT: br label [[EXIT:%.*]] -; NOT_CGSCC_NPM: while.body: -; 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: exit: -; 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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@bad_gep +; MODULE-SAME: () #[[ATTR12]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[N:%.*]] = alloca i8, align 1 +; MODULE-NEXT: [[M:%.*]] = alloca i8, align 1 +; MODULE-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 1, i8* noalias nocapture nofree noundef nonnull dereferenceable(1) [[N]]) #[[ATTR15:[0-9]+]] +; MODULE-NEXT: br label [[EXIT:%.*]] +; MODULE: while.body: +; MODULE-NEXT: unreachable +; MODULE: if.then: +; MODULE-NEXT: unreachable +; MODULE: if.end: +; MODULE-NEXT: unreachable +; MODULE: exit: +; MODULE-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1, i8* noalias nocapture nofree noundef nonnull dereferenceable(1) [[N]]) #[[ATTR15]] +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@bad_gep +; CGSCC-SAME: () #[[ATTR15:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[N:%.*]] = alloca i8, align 1 +; CGSCC-NEXT: [[M:%.*]] = alloca i8, align 1 +; CGSCC-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 1, i8* noalias nocapture nofree noundef nonnull dereferenceable(1) [[N]]) #[[ATTR18:[0-9]+]] +; CGSCC-NEXT: br label [[EXIT:%.*]] +; CGSCC: while.body: +; CGSCC-NEXT: unreachable +; CGSCC: if.then: +; CGSCC-NEXT: unreachable +; CGSCC: if.end: +; CGSCC-NEXT: unreachable +; CGSCC: exit: +; CGSCC-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1, i8* noalias nocapture nofree noundef nonnull dereferenceable(1) [[N]]) #[[ATTR18]] +; CGSCC-NEXT: ret void ; entry: %n = alloca i8 @@ -2650,40 +2622,40 @@ declare void @llvm.lifetime.start.p0i8(i64 %0, i8* %1) declare void @llvm.lifetime.end.p0i8(i64 %0, i8* %1) ;. -; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree noreturn nosync nounwind } -; NOT_CGSCC_NPM: attributes #[[ATTR1:[0-9]+]] = { readnone } -; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { nounwind } -; NOT_CGSCC_NPM: attributes #[[ATTR3]] = { noreturn nounwind } -; NOT_CGSCC_NPM: attributes #[[ATTR4]] = { noreturn } -; NOT_CGSCC_NPM: attributes #[[ATTR5]] = { nosync readnone } -; NOT_CGSCC_NPM: attributes #[[ATTR6]] = { argmemonly nofree norecurse nounwind uwtable willreturn } -; NOT_CGSCC_NPM: attributes #[[ATTR7]] = { nosync } -; NOT_CGSCC_NPM: attributes #[[ATTR8:[0-9]+]] = { 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 } -; NOT_CGSCC_NPM: attributes #[[ATTR12]] = { nofree nosync nounwind readnone willreturn } -; NOT_CGSCC_NPM: attributes #[[ATTR13:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } -; NOT_CGSCC_NPM: attributes #[[ATTR14]] = { nounwind willreturn } -; NOT_CGSCC_NPM: attributes #[[ATTR15]] = { willreturn } +; MODULE: attributes #[[ATTR0]] = { nofree noreturn nosync nounwind } +; MODULE: attributes #[[ATTR1:[0-9]+]] = { readnone } +; MODULE: attributes #[[ATTR2]] = { nounwind } +; MODULE: attributes #[[ATTR3]] = { noreturn nounwind } +; MODULE: attributes #[[ATTR4]] = { noreturn } +; MODULE: attributes #[[ATTR5]] = { nosync readnone } +; MODULE: attributes #[[ATTR6]] = { argmemonly nofree norecurse nounwind uwtable willreturn } +; MODULE: attributes #[[ATTR7]] = { nosync } +; MODULE: attributes #[[ATTR8]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; MODULE: attributes #[[ATTR9]] = { nofree noreturn nosync nounwind readnone } +; MODULE: attributes #[[ATTR10]] = { nofree noreturn nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR11]] = { nofree nosync nounwind willreturn } +; MODULE: attributes #[[ATTR12]] = { nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR13:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } +; MODULE: attributes #[[ATTR14]] = { nounwind willreturn } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { nofree noreturn nosync nounwind } +; CGSCC: attributes #[[ATTR1:[0-9]+]] = { readnone } +; CGSCC: attributes #[[ATTR2]] = { nounwind } +; CGSCC: attributes #[[ATTR3]] = { noreturn nounwind } +; CGSCC: attributes #[[ATTR4]] = { noreturn } +; CGSCC: attributes #[[ATTR5]] = { nosync readnone } +; CGSCC: attributes #[[ATTR6]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR7]] = { argmemonly nofree norecurse nounwind uwtable willreturn } +; CGSCC: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind readnone uwtable willreturn } +; CGSCC: attributes #[[ATTR9]] = { nosync } +; CGSCC: attributes #[[ATTR10]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; CGSCC: attributes #[[ATTR11]] = { nofree norecurse noreturn nosync nounwind readnone } +; CGSCC: attributes #[[ATTR12]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR13]] = { nofree nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR14]] = { nofree norecurse nosync nounwind readnone } +; CGSCC: attributes #[[ATTR15]] = { nofree nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR16:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR17]] = { nounwind willreturn } +; CGSCC: attributes #[[ATTR18]] = { willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/liveness_chains.ll b/llvm/test/Transforms/Attributor/liveness_chains.ll --- a/llvm/test/Transforms/Attributor/liveness_chains.ll +++ b/llvm/test/Transforms/Attributor/liveness_chains.ll @@ -1,23 +1,21 @@ ; 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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; Make sure we need a single iteration to determine the chains are dead/alive. 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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@chain_dead +; MODULE-SAME: (i32 [[ARG:%.*]]) #[[ATTR1:[0-9]+]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@chain_dead +; CGSCC-SAME: (i32 [[ARG:%.*]]) #[[ATTR1:[0-9]+]] { +; CGSCC-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 } +; MODULE: attributes #[[ATTR0]] = { nounwind readonly } +; MODULE: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nounwind readonly } -; IS__CGSCC____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR0]] = { nounwind readonly } +; CGSCC: 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,8 +1,6 @@ ; 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 +; 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,MODULE +; 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,CGSCC declare i64 @subfn(i8*) #0 @@ -11,20 +9,12 @@ 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 +25,15 @@ 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 +44,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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC 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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test1 +; MODULE-SAME: (i32 [[A:%.*]], i32 [[LENGTH:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: br label [[LOOP:%.*]] +; MODULE: loop: +; MODULE-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ] +; MODULE-NEXT: br label [[BACKEDGE]] +; MODULE: backedge: +; MODULE-NEXT: [[IV_NEXT]] = add nsw i32 [[IV]], 1 +; MODULE-NEXT: [[CONT:%.*]] = icmp slt i32 [[IV_NEXT]], 400 +; MODULE-NEXT: br i1 [[CONT]], label [[LOOP]], label [[EXIT:%.*]] +; MODULE: exit: +; MODULE-NEXT: ret i8 0 ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test1 -; IS__TUNIT_NPM-SAME: (i32 [[A:%.*]], i32 [[LENGTH:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: br label [[LOOP:%.*]] -; IS__TUNIT_NPM: loop: -; IS__TUNIT_NPM-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ] -; IS__TUNIT_NPM-NEXT: br label [[BACKEDGE]] -; IS__TUNIT_NPM: backedge: -; IS__TUNIT_NPM-NEXT: [[IV_NEXT]] = add nsw i32 [[IV]], 1 -; IS__TUNIT_NPM-NEXT: [[CONT:%.*]] = icmp slt i32 [[IV_NEXT]], 400 -; IS__TUNIT_NPM-NEXT: br i1 [[CONT]], label [[LOOP]], label [[EXIT:%.*]] -; IS__TUNIT_NPM: exit: -; IS__TUNIT_NPM-NEXT: ret i8 0 -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test1 -; IS__CGSCC_OPM-SAME: (i32 [[A:%.*]], i32 [[LENGTH:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[LOOP:%.*]] -; IS__CGSCC_OPM: loop: -; IS__CGSCC_OPM-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ] -; IS__CGSCC_OPM-NEXT: [[CND:%.*]] = icmp sge i32 [[IV]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[CND]], label [[BACKEDGE]], label [[EXIT:%.*]] -; IS__CGSCC_OPM: backedge: -; IS__CGSCC_OPM-NEXT: [[IV_NEXT]] = add nsw i32 [[IV]], 1 -; IS__CGSCC_OPM-NEXT: [[CONT:%.*]] = icmp slt i32 [[IV_NEXT]], 400 -; IS__CGSCC_OPM-NEXT: br i1 [[CONT]], label [[LOOP]], label [[EXIT]] -; IS__CGSCC_OPM: exit: -; IS__CGSCC_OPM-NEXT: ret i8 0 -; -; IS__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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test1 +; CGSCC-SAME: (i32 [[A:%.*]], i32 [[LENGTH:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br label [[LOOP:%.*]] +; CGSCC: loop: +; CGSCC-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ] +; CGSCC-NEXT: br label [[BACKEDGE]] +; CGSCC: backedge: +; CGSCC-NEXT: [[IV_NEXT]] = add nsw i32 [[IV]], 1 +; CGSCC-NEXT: [[CONT:%.*]] = icmp slt i32 [[IV_NEXT]], 400 +; CGSCC-NEXT: br i1 [[CONT]], label [[LOOP]], label [[EXIT:%.*]] +; CGSCC: exit: +; CGSCC-NEXT: ret i8 0 ; entry: br label %loop @@ -85,89 +51,45 @@ } 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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test2 +; MODULE-SAME: (i32 [[N:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: br label [[LOOP:%.*]] +; MODULE: loop: +; MODULE-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ] +; MODULE-NEXT: [[IV2:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[IV2_NEXT:%.*]], [[BACKEDGE]] ] +; MODULE-NEXT: [[CND2:%.*]] = icmp sgt i32 [[IV2]], 0 +; MODULE-NEXT: br i1 [[CND2]], label [[BACKEDGE]], label [[EXIT:%.*]] +; MODULE: backedge: +; MODULE-NEXT: [[IV_NEXT]] = add nsw i32 [[IV]], 1 +; MODULE-NEXT: [[IV2_NEXT]] = sub nsw i32 [[IV2]], 1 +; MODULE-NEXT: [[CONT1:%.*]] = icmp slt i32 [[IV_NEXT]], 400 +; MODULE-NEXT: [[CONT2:%.*]] = icmp sgt i32 [[IV2_NEXT]], 0 +; MODULE-NEXT: [[CONT:%.*]] = and i1 [[CONT1]], [[CONT2]] +; MODULE-NEXT: br i1 [[CONT]], label [[LOOP]], label [[EXIT]] +; MODULE: exit: +; MODULE-NEXT: ret i8 0 ; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test2 -; IS__CGSCC_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[LOOP:%.*]] -; IS__CGSCC_OPM: loop: -; IS__CGSCC_OPM-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ] -; IS__CGSCC_OPM-NEXT: [[IV2:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[IV2_NEXT:%.*]], [[BACKEDGE]] ] -; IS__CGSCC_OPM-NEXT: [[CND1:%.*]] = icmp sge i32 [[IV]], 0 -; IS__CGSCC_OPM-NEXT: [[CND2:%.*]] = icmp sgt i32 [[IV2]], 0 -; IS__CGSCC_OPM-NEXT: [[CND:%.*]] = and i1 [[CND1]], [[CND2]] -; IS__CGSCC_OPM-NEXT: br i1 [[CND]], label [[BACKEDGE]], label [[EXIT:%.*]] -; IS__CGSCC_OPM: backedge: -; IS__CGSCC_OPM-NEXT: [[IV_NEXT]] = add nsw i32 [[IV]], 1 -; IS__CGSCC_OPM-NEXT: [[IV2_NEXT]] = sub nsw i32 [[IV2]], 1 -; IS__CGSCC_OPM-NEXT: [[CONT1:%.*]] = icmp slt i32 [[IV_NEXT]], 400 -; IS__CGSCC_OPM-NEXT: [[CONT2:%.*]] = icmp sgt i32 [[IV2_NEXT]], 0 -; IS__CGSCC_OPM-NEXT: [[CONT:%.*]] = and i1 [[CONT1]], [[CONT2]] -; IS__CGSCC_OPM-NEXT: br i1 [[CONT]], label [[LOOP]], label [[EXIT]] -; IS__CGSCC_OPM: exit: -; IS__CGSCC_OPM-NEXT: ret i8 0 -; -; IS__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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test2 +; CGSCC-SAME: (i32 [[N:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br label [[LOOP:%.*]] +; CGSCC: loop: +; CGSCC-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE:%.*]] ] +; CGSCC-NEXT: [[IV2:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[IV2_NEXT:%.*]], [[BACKEDGE]] ] +; CGSCC-NEXT: [[CND2:%.*]] = icmp sgt i32 [[IV2]], 0 +; CGSCC-NEXT: br i1 [[CND2]], label [[BACKEDGE]], label [[EXIT:%.*]] +; CGSCC: backedge: +; CGSCC-NEXT: [[IV_NEXT]] = add nsw i32 [[IV]], 1 +; CGSCC-NEXT: [[IV2_NEXT]] = sub nsw i32 [[IV2]], 1 +; CGSCC-NEXT: [[CONT1:%.*]] = icmp slt i32 [[IV_NEXT]], 400 +; CGSCC-NEXT: [[CONT2:%.*]] = icmp sgt i32 [[IV2_NEXT]], 0 +; CGSCC-NEXT: [[CONT:%.*]] = and i1 [[CONT1]], [[CONT2]] +; CGSCC-NEXT: br i1 [[CONT]], label [[LOOP]], label [[EXIT]] +; CGSCC: exit: +; CGSCC-NEXT: ret i8 0 ; entry: br label %loop @@ -195,46 +117,25 @@ ; 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 +216,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 } +; MODULE: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR1:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } +; MODULE: attributes #[[ATTR2]] = { nounwind } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR1:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR2]] = { nounwind } +; CGSCC: 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,49 @@ ; 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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; 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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test-ashr +; MODULE-SAME: (i32 [[C:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: chk65: +; MODULE-NEXT: [[CMP:%.*]] = icmp sgt i32 [[C]], 65 +; MODULE-NEXT: br i1 [[CMP]], label [[RETURN:%.*]], label [[CHK0:%.*]] +; MODULE: chk0: +; MODULE-NEXT: [[CMP1:%.*]] = icmp slt i32 [[C]], 0 +; MODULE-NEXT: br i1 [[CMP]], label [[RETURN]], label [[BB_IF:%.*]] +; MODULE: bb_if: +; MODULE-NEXT: [[ASHR_VAL:%.*]] = ashr exact i32 [[C]], 2 +; MODULE-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[ASHR_VAL]], 15 +; MODULE-NEXT: br i1 [[CMP2]], label [[BB_THEN:%.*]], label [[RETURN]] +; MODULE: bb_then: +; MODULE-NEXT: [[DOT:%.*]] = select i1 true, i32 3, i32 2 +; MODULE-NEXT: br label [[RETURN]] +; MODULE: return: +; MODULE-NEXT: [[RETVAL:%.*]] = phi i32 [ 0, [[CHK65:%.*]] ], [ 1, [[CHK0]] ], [ [[DOT]], [[BB_THEN]] ], [ 4, [[BB_IF]] ] +; MODULE-NEXT: ret i32 [[RETVAL]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test-ashr -; IS__TUNIT_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: chk65: -; IS__TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[C]], 65 -; IS__TUNIT_NPM-NEXT: br i1 [[CMP]], label [[RETURN:%.*]], label [[CHK0:%.*]] -; IS__TUNIT_NPM: chk0: -; IS__TUNIT_NPM-NEXT: [[CMP1:%.*]] = icmp slt i32 [[C]], 0 -; IS__TUNIT_NPM-NEXT: br i1 [[CMP]], label [[RETURN]], label [[BB_IF:%.*]] -; IS__TUNIT_NPM: bb_if: -; IS__TUNIT_NPM-NEXT: [[ASHR_VAL:%.*]] = ashr exact i32 [[C]], 2 -; IS__TUNIT_NPM-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[ASHR_VAL]], 15 -; IS__TUNIT_NPM-NEXT: br i1 [[CMP2]], label [[BB_THEN:%.*]], label [[RETURN]] -; IS__TUNIT_NPM: bb_then: -; IS__TUNIT_NPM-NEXT: [[DOT:%.*]] = select i1 true, i32 3, i32 2 -; IS__TUNIT_NPM-NEXT: br label [[RETURN]] -; IS__TUNIT_NPM: return: -; IS__TUNIT_NPM-NEXT: [[RETVAL:%.*]] = phi i32 [ 0, [[CHK65:%.*]] ], [ 1, [[CHK0]] ], [ [[DOT]], [[BB_THEN]] ], [ 4, [[BB_IF]] ] -; IS__TUNIT_NPM-NEXT: ret i32 [[RETVAL]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test-ashr -; IS__CGSCC_OPM-SAME: (i32 [[C:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: chk65: -; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[C]], 65 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[RETURN:%.*]], label [[CHK0:%.*]] -; IS__CGSCC_OPM: chk0: -; IS__CGSCC_OPM-NEXT: [[CMP1:%.*]] = icmp slt i32 [[C]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[RETURN]], label [[BB_IF:%.*]] -; IS__CGSCC_OPM: bb_if: -; IS__CGSCC_OPM-NEXT: [[ASHR_VAL:%.*]] = ashr exact i32 [[C]], 2 -; IS__CGSCC_OPM-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[ASHR_VAL]], 15 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP2]], label [[BB_THEN:%.*]], label [[RETURN]] -; IS__CGSCC_OPM: bb_then: -; IS__CGSCC_OPM-NEXT: [[CMP3:%.*]] = icmp eq i32 [[ASHR_VAL]], 16 -; IS__CGSCC_OPM-NEXT: [[DOT:%.*]] = select i1 [[CMP3]], i32 3, i32 2 -; IS__CGSCC_OPM-NEXT: br label [[RETURN]] -; IS__CGSCC_OPM: return: -; IS__CGSCC_OPM-NEXT: [[RETVAL:%.*]] = phi i32 [ 0, [[CHK65:%.*]] ], [ 1, [[CHK0]] ], [ [[DOT]], [[BB_THEN]] ], [ 4, [[BB_IF]] ] -; IS__CGSCC_OPM-NEXT: ret i32 [[RETVAL]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test-ashr -; IS__CGSCC_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: chk65: -; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[C]], 65 -; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[RETURN:%.*]], label [[CHK0:%.*]] -; IS__CGSCC_NPM: chk0: -; IS__CGSCC_NPM-NEXT: [[CMP1:%.*]] = icmp slt i32 [[C]], 0 -; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[RETURN]], label [[BB_IF:%.*]] -; IS__CGSCC_NPM: bb_if: -; IS__CGSCC_NPM-NEXT: [[ASHR_VAL:%.*]] = ashr exact i32 [[C]], 2 -; IS__CGSCC_NPM-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[ASHR_VAL]], 15 -; IS__CGSCC_NPM-NEXT: br i1 [[CMP2]], label [[BB_THEN:%.*]], label [[RETURN]] -; IS__CGSCC_NPM: bb_then: -; IS__CGSCC_NPM-NEXT: [[DOT:%.*]] = select i1 true, i32 3, i32 2 -; IS__CGSCC_NPM-NEXT: br label [[RETURN]] -; IS__CGSCC_NPM: return: -; IS__CGSCC_NPM-NEXT: [[RETVAL:%.*]] = phi i32 [ 0, [[CHK65:%.*]] ], [ 1, [[CHK0]] ], [ [[DOT]], [[BB_THEN]] ], [ 4, [[BB_IF]] ] -; IS__CGSCC_NPM-NEXT: ret i32 [[RETVAL]] +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test-ashr +; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: chk65: +; CGSCC-NEXT: [[CMP:%.*]] = icmp sgt i32 [[C]], 65 +; CGSCC-NEXT: br i1 [[CMP]], label [[RETURN:%.*]], label [[CHK0:%.*]] +; CGSCC: chk0: +; CGSCC-NEXT: [[CMP1:%.*]] = icmp slt i32 [[C]], 0 +; CGSCC-NEXT: br i1 [[CMP]], label [[RETURN]], label [[BB_IF:%.*]] +; CGSCC: bb_if: +; CGSCC-NEXT: [[ASHR_VAL:%.*]] = ashr exact i32 [[C]], 2 +; CGSCC-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[ASHR_VAL]], 15 +; CGSCC-NEXT: br i1 [[CMP2]], label [[BB_THEN:%.*]], label [[RETURN]] +; CGSCC: bb_then: +; CGSCC-NEXT: [[DOT:%.*]] = select i1 true, i32 3, i32 2 +; CGSCC-NEXT: br label [[RETURN]] +; CGSCC: return: +; CGSCC-NEXT: [[RETVAL:%.*]] = phi i32 [ 0, [[CHK65:%.*]] ], [ 1, [[CHK0]] ], [ [[DOT]], [[BB_THEN]] ], [ 4, [[BB_IF]] ] +; CGSCC-NEXT: ret i32 [[RETVAL]] ; chk65: %cmp = icmp sgt i32 %c, 65 @@ -112,7 +68,7 @@ ret i32 %retval } ;. -; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0:[0-9]+]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: 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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" @G = external dso_local global i32, align 4 @@ -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]] +; MODULE: Function Attrs: inaccessiblemem_or_argmemonly +; MODULE-LABEL: define {{[^@]+}}@internal_argmem_only_rec +; MODULE-SAME: (i32* nocapture nofree [[ARG:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[CALL:%.*]] = call noalias i8* @internal_argmem_only_rec_1(i32* nocapture nofree align 4 [[ARG]]) +; MODULE-NEXT: ret i8* [[CALL]] +; +; CGSCC: Function Attrs: inaccessiblemem_or_argmemonly +; CGSCC-LABEL: define {{[^@]+}}@internal_argmem_only_rec +; CGSCC-SAME: (i32* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[CALL:%.*]] = call noalias i8* @internal_argmem_only_rec_1(i32* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[ARG]]) +; CGSCC-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]] +; MODULE: Function Attrs: inaccessiblemem_or_argmemonly +; MODULE-LABEL: define {{[^@]+}}@internal_argmem_only_rec_1 +; MODULE-SAME: (i32* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[TMP:%.*]] = load i32, i32* [[ARG]], align 4 +; MODULE-NEXT: [[CMP:%.*]] = icmp eq i32 [[TMP]], 0 +; MODULE-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; MODULE: if.then: +; MODULE-NEXT: br label [[RETURN:%.*]] +; MODULE: if.end: +; MODULE-NEXT: [[TMP1:%.*]] = load i32, i32* [[ARG]], align 4 +; MODULE-NEXT: [[CMP1:%.*]] = icmp eq i32 [[TMP1]], 1 +; MODULE-NEXT: br i1 [[CMP1]], label [[IF_THEN2:%.*]], label [[IF_END3:%.*]] +; MODULE: if.then2: +; MODULE-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, i32* [[ARG]], i64 -1 +; MODULE-NEXT: [[CALL:%.*]] = call noalias i8* @internal_argmem_only_rec_2(i32* nocapture nofree nonnull align 4 dereferenceable(4) [[ADD_PTR]]) +; MODULE-NEXT: br label [[RETURN]] +; MODULE: if.end3: +; MODULE-NEXT: [[TMP2:%.*]] = load i32, i32* [[ARG]], align 4 +; MODULE-NEXT: [[CONV:%.*]] = sext i32 [[TMP2]] to i64 +; MODULE-NEXT: [[CALL4:%.*]] = call noalias i8* @malloc(i64 [[CONV]]) +; MODULE-NEXT: br label [[RETURN]] +; MODULE: return: +; MODULE-NEXT: [[RETVAL_0:%.*]] = phi i8* [ null, [[IF_THEN]] ], [ [[CALL]], [[IF_THEN2]] ], [ [[CALL4]], [[IF_END3]] ] +; MODULE-NEXT: ret i8* [[RETVAL_0]] +; +; CGSCC: Function Attrs: inaccessiblemem_or_argmemonly +; CGSCC-LABEL: define {{[^@]+}}@internal_argmem_only_rec_1 +; CGSCC-SAME: (i32* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[TMP:%.*]] = load i32, i32* [[ARG]], align 4 +; CGSCC-NEXT: [[CMP:%.*]] = icmp eq i32 [[TMP]], 0 +; CGSCC-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; CGSCC: if.then: +; CGSCC-NEXT: br label [[RETURN:%.*]] +; CGSCC: if.end: +; CGSCC-NEXT: [[TMP1:%.*]] = load i32, i32* [[ARG]], align 4 +; CGSCC-NEXT: [[CMP1:%.*]] = icmp eq i32 [[TMP1]], 1 +; CGSCC-NEXT: br i1 [[CMP1]], label [[IF_THEN2:%.*]], label [[IF_END3:%.*]] +; CGSCC: if.then2: +; CGSCC-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, i32* [[ARG]], i64 -1 +; CGSCC-NEXT: [[CALL:%.*]] = call noalias i8* @internal_argmem_only_rec_2(i32* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[ADD_PTR]]) +; CGSCC-NEXT: br label [[RETURN]] +; CGSCC: if.end3: +; CGSCC-NEXT: [[TMP2:%.*]] = load i32, i32* [[ARG]], align 4 +; CGSCC-NEXT: [[CONV:%.*]] = sext i32 [[TMP2]] to i64 +; CGSCC-NEXT: [[CALL4:%.*]] = call noalias i8* @malloc(i64 [[CONV]]) +; CGSCC-NEXT: br label [[RETURN]] +; CGSCC: return: +; CGSCC-NEXT: [[RETVAL_0:%.*]] = phi i8* [ null, [[IF_THEN]] ], [ [[CALL]], [[IF_THEN2]] ], [ [[CALL4]], [[IF_END3]] ] +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@callerE +; MODULE-SAME: (i8* nocapture nofree readnone [[ARG:%.*]]) #[[ATTR5:[0-9]+]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@callerE +; CGSCC-SAME: (i8* nocapture nofree readnone [[ARG:%.*]]) #[[ATTR5:[0-9]+]] { +; CGSCC-NEXT: ret void ; call void @llvm.lifetime.start.p0i8(i64 4, i8* %arg) ret void @@ -433,129 +431,128 @@ 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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@write_global +; MODULE-SAME: () #[[ATTR6:[0-9]+]] { +; MODULE-NEXT: store i32 0, i32* @G, align 4 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@write_global +; CGSCC-SAME: () #[[ATTR6:[0-9]+]] { +; CGSCC-NEXT: store i32 0, i32* @G, align 4 +; CGSCC-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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@write_global_via_arg +; MODULE-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[GPTR:%.*]]) #[[ATTR7:[0-9]+]] { +; MODULE-NEXT: store i32 0, i32* [[GPTR]], align 4 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@write_global_via_arg +; CGSCC-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[GPTR:%.*]]) #[[ATTR7:[0-9]+]] { +; CGSCC-NEXT: store i32 0, i32* [[GPTR]], align 4 +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@write_global_via_arg_internal +; MODULE-SAME: () #[[ATTR6]] { +; MODULE-NEXT: store i32 0, i32* @G, align 4 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@write_global_via_arg_internal +; CGSCC-SAME: () #[[ATTR6]] { +; CGSCC-NEXT: store i32 0, i32* @G, align 4 +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@writeonly_global +; MODULE-SAME: () #[[ATTR6]] { +; MODULE-NEXT: call void @write_global() #[[ATTR6]] +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@writeonly_global +; CGSCC-SAME: () #[[ATTR6]] { +; CGSCC-NEXT: call void @write_global() #[[ATTR10:[0-9]+]] +; CGSCC-NEXT: ret void ; call void @write_global() ret void } define void @writeonly_global_via_arg() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@writeonly_global_via_arg +; MODULE-SAME: () #[[ATTR6]] { +; MODULE-NEXT: call void @write_global_via_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) @G) #[[ATTR6]] +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@writeonly_global_via_arg +; CGSCC-SAME: () #[[ATTR6]] { +; CGSCC-NEXT: call void @write_global_via_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) @G) #[[ATTR10]] +; CGSCC-NEXT: ret void ; call void @write_global_via_arg(i32* @G) ret void } 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 -; -; 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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@writeonly_global_via_arg_internal +; MODULE-SAME: () #[[ATTR6]] { +; MODULE-NEXT: call void @write_global_via_arg_internal() #[[ATTR6]] +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@writeonly_global_via_arg_internal +; CGSCC-SAME: () #[[ATTR6]] { +; CGSCC-NEXT: call void @write_global_via_arg_internal() #[[ATTR10]] +; CGSCC-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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind writeonly +; MODULE-LABEL: define {{[^@]+}}@recursive_not_readnone +; MODULE-SAME: (i8* nocapture nofree writeonly [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8:[0-9]+]] { +; MODULE-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 +; MODULE-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; MODULE: t: +; MODULE-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]+]] +; MODULE-NEXT: ret i8 1 +; MODULE: f: +; MODULE-NEXT: store i8 1, i8* [[PTR]], align 1 +; MODULE-NEXT: ret i8 0 +; +; CGSCC: Function Attrs: argmemonly nofree nosync nounwind writeonly +; CGSCC-LABEL: define {{[^@]+}}@recursive_not_readnone +; CGSCC-SAME: (i8* nocapture nofree writeonly [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8:[0-9]+]] { +; CGSCC-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 +; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; CGSCC: t: +; 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]+]] +; CGSCC-NEXT: ret i8 1 +; CGSCC: f: +; CGSCC-NEXT: store i8 1, i8* [[PTR]], align 1 +; CGSCC-NEXT: ret i8 0 ; %alloc = alloca i8 br i1 %c, label %t, label %f @@ -569,29 +566,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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind writeonly +; MODULE-LABEL: define {{[^@]+}}@recursive_not_readnone_internal +; MODULE-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8]] { +; MODULE-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 +; MODULE-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; MODULE: t: +; MODULE-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR10]], !range [[RNG0]] +; MODULE-NEXT: ret i8 1 +; MODULE: f: +; MODULE-NEXT: store i8 1, i8* [[PTR]], align 1 +; MODULE-NEXT: ret i8 0 +; +; CGSCC: Function Attrs: argmemonly nofree nosync nounwind writeonly +; CGSCC-LABEL: define {{[^@]+}}@recursive_not_readnone_internal +; CGSCC-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8]] { +; CGSCC-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 +; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; CGSCC: t: +; 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]] +; CGSCC-NEXT: ret i8 1 +; CGSCC: f: +; CGSCC-NEXT: store i8 1, i8* [[PTR]], align 1 +; CGSCC-NEXT: ret i8 0 ; %alloc = alloca i8 br i1 %c, label %t, label %f @@ -605,19 +602,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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone +; MODULE-LABEL: define {{[^@]+}}@readnone_caller +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR9:[0-9]+]] { +; MODULE-NEXT: [[A:%.*]] = alloca i8, align 1 +; MODULE-NEXT: [[R:%.*]] = call noundef i8 @recursive_not_readnone_internal(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[A]], i1 [[C]]) #[[ATTR10]], !range [[RNG0]] +; MODULE-NEXT: ret i8 [[R]] +; +; CGSCC: Function Attrs: nofree nosync nounwind readnone +; CGSCC-LABEL: define {{[^@]+}}@readnone_caller +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR9:[0-9]+]] { +; CGSCC-NEXT: [[A:%.*]] = alloca i8, align 1 +; 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]] +; CGSCC-NEXT: ret i8 [[R]] ; %a = alloca i8 %r = call i8 @recursive_not_readnone_internal(i8* %a, i1 %c) @@ -625,29 +622,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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind writeonly +; MODULE-LABEL: define {{[^@]+}}@recursive_readnone_internal2 +; MODULE-SAME: (i8* nocapture nofree nonnull writeonly [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8]] { +; MODULE-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 +; MODULE-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; MODULE: t: +; MODULE-NEXT: [[TMP1:%.*]] = call i8 @recursive_readnone_internal2(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR10]], !range [[RNG0]] +; MODULE-NEXT: ret i8 1 +; MODULE: f: +; MODULE-NEXT: store i8 1, i8* [[PTR]], align 1 +; MODULE-NEXT: ret i8 0 +; +; CGSCC: Function Attrs: argmemonly nofree nosync nounwind writeonly +; CGSCC-LABEL: define {{[^@]+}}@recursive_readnone_internal2 +; CGSCC-SAME: (i8* nocapture nofree nonnull writeonly [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8]] { +; CGSCC-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 +; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; CGSCC: t: +; CGSCC-NEXT: [[TMP1:%.*]] = call i8 @recursive_readnone_internal2(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR11]], !range [[RNG0]] +; CGSCC-NEXT: ret i8 1 +; CGSCC: f: +; CGSCC-NEXT: store i8 1, i8* [[PTR]], align 1 +; CGSCC-NEXT: ret i8 0 ; %alloc = alloca i8 br i1 %c, label %t, label %f @@ -661,46 +658,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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone +; MODULE-LABEL: define {{[^@]+}}@readnone_caller2 +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR9]] { +; MODULE-NEXT: [[R:%.*]] = call noundef i8 @recursive_readnone_internal2(i8* undef, i1 [[C]]) #[[ATTR10]], !range [[RNG0]] +; MODULE-NEXT: ret i8 [[R]] +; +; CGSCC: Function Attrs: nofree nosync nounwind readnone +; CGSCC-LABEL: define {{[^@]+}}@readnone_caller2 +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR9]] { +; CGSCC-NEXT: [[R:%.*]] = call noundef i8 @recursive_readnone_internal2(i8* undef, i1 [[C]]) #[[ATTR12]], !range [[RNG0]] +; CGSCC-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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind writeonly +; MODULE-LABEL: define {{[^@]+}}@recursive_not_readnone_internal3 +; MODULE-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8]] { +; MODULE-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 +; MODULE-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; MODULE: t: +; MODULE-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal3(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR10]], !range [[RNG0]] +; MODULE-NEXT: ret i8 1 +; MODULE: f: +; MODULE-NEXT: store i8 1, i8* [[PTR]], align 1 +; MODULE-NEXT: ret i8 0 +; +; CGSCC: Function Attrs: argmemonly nofree nosync nounwind writeonly +; CGSCC-LABEL: define {{[^@]+}}@recursive_not_readnone_internal3 +; CGSCC-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8]] { +; CGSCC-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 +; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; CGSCC: t: +; 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]] +; CGSCC-NEXT: ret i8 1 +; CGSCC: f: +; CGSCC-NEXT: store i8 1, i8* [[PTR]], align 1 +; CGSCC-NEXT: ret i8 0 ; %alloc = alloca i8 br i1 %c, label %t, label %f @@ -714,19 +711,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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone +; MODULE-LABEL: define {{[^@]+}}@readnone_caller3 +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR9]] { +; MODULE-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 +; MODULE-NEXT: [[R:%.*]] = call noundef i8 @recursive_not_readnone_internal3(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 [[C]]) #[[ATTR10]], !range [[RNG0]] +; MODULE-NEXT: ret i8 [[R]] +; +; CGSCC: Function Attrs: nofree nosync nounwind readnone +; CGSCC-LABEL: define {{[^@]+}}@readnone_caller3 +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR9]] { +; CGSCC-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 +; 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]] +; CGSCC-NEXT: ret i8 [[R]] ; %alloc = alloca i8 %r = call i8 @recursive_not_readnone_internal3(i8* %alloc, i1 %c) @@ -734,64 +731,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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@argmemonly_before_ipconstprop +; MODULE-SAME: () #[[ATTR6]] { +; MODULE-NEXT: store i32 0, i32* @G, align 4 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@argmemonly_before_ipconstprop +; CGSCC-SAME: () #[[ATTR6]] { +; CGSCC-NEXT: store i32 0, i32* @G, align 4 +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@argmemonky_caller +; MODULE-SAME: () #[[ATTR6]] { +; MODULE-NEXT: call void @argmemonly_before_ipconstprop() #[[ATTR6]] +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@argmemonky_caller +; CGSCC-SAME: () #[[ATTR6]] { +; CGSCC-NEXT: call void @argmemonly_before_ipconstprop() #[[ATTR10]] +; CGSCC-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 } +; MODULE: attributes #[[ATTR0]] = { inaccessiblememonly } +; MODULE: attributes #[[ATTR1]] = { inaccessiblemem_or_argmemonly } +; MODULE: attributes #[[ATTR2]] = { readnone } +; MODULE: attributes #[[ATTR3]] = { argmemonly } +; MODULE: attributes #[[ATTR4:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } +; MODULE: attributes #[[ATTR5]] = { nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR6]] = { nofree nosync nounwind willreturn writeonly } +; MODULE: attributes #[[ATTR7]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; MODULE: attributes #[[ATTR8]] = { argmemonly nofree nosync nounwind writeonly } +; MODULE: attributes #[[ATTR9]] = { nofree nosync nounwind readnone } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { inaccessiblememonly } +; CGSCC: attributes #[[ATTR1]] = { inaccessiblemem_or_argmemonly } +; CGSCC: attributes #[[ATTR2]] = { readnone } +; CGSCC: attributes #[[ATTR3]] = { argmemonly } +; CGSCC: attributes #[[ATTR4:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR6]] = { nofree norecurse nosync nounwind willreturn writeonly } +; CGSCC: attributes #[[ATTR7]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; CGSCC: attributes #[[ATTR8]] = { argmemonly nofree nosync nounwind writeonly } +; CGSCC: attributes #[[ATTR9]] = { nofree nosync nounwind readnone } +; CGSCC: attributes #[[ATTR10]] = { nounwind willreturn writeonly } +; CGSCC: attributes #[[ATTR11]] = { nofree nosync nounwind writeonly } +; CGSCC: 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,40 +1,35 @@ ; 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 -; +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; Mostly check we do not crash on these uses define internal void @internal(void (i8*)* %fp) { +; MODULE-LABEL: define {{[^@]+}}@internal +; MODULE-SAME: (void (i8*)* nonnull [[FP:%.*]]) { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[A:%.*]] = alloca i32, align 4 +; MODULE-NEXT: call void @foo(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR1:[0-9]+]] +; MODULE-NEXT: call void [[FP]](i8* bitcast (void (i32*)* @foo to i8*)) +; MODULE-NEXT: call void @callback1(void (i32*)* noundef nonnull @foo) +; MODULE-NEXT: call void @callback2(void (i8*)* noundef bitcast (void (i32*)* @foo to void (i8*)*)) +; MODULE-NEXT: call void @callback2(void (i8*)* nonnull [[FP]]) +; MODULE-NEXT: [[TMP1:%.*]] = bitcast i32* [[A]] to i8* +; MODULE-NEXT: call void [[FP]](i8* [[TMP1]]) +; MODULE-NEXT: ret void ; -; -; 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 -; -; 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 +; CGSCC-LABEL: define {{[^@]+}}@internal +; CGSCC-SAME: (void (i8*)* noundef nonnull [[FP:%.*]]) { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[A:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: [[TMP:%.*]] = bitcast i32* [[A]] to i8* +; CGSCC-NEXT: call void @foo(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR1:[0-9]+]] +; CGSCC-NEXT: call void [[FP]](i8* bitcast (void (i32*)* @foo to i8*)) +; CGSCC-NEXT: call void @callback1(void (i32*)* noundef nonnull @foo) +; CGSCC-NEXT: call void @callback2(void (i8*)* noundef bitcast (void (i32*)* @foo to void (i8*)*)) +; CGSCC-NEXT: call void @callback2(void (i8*)* noundef nonnull [[FP]]) +; CGSCC-NEXT: [[TMP1:%.*]] = bitcast i32* [[A]] to i8* +; CGSCC-NEXT: call void [[FP]](i8* [[TMP1]]) +; CGSCC-NEXT: ret void ; entry: %a = alloca i32, align 4 @@ -50,35 +45,33 @@ } define void @external(void (i8*)* %fp) { +; MODULE-LABEL: define {{[^@]+}}@external +; MODULE-SAME: (void (i8*)* [[FP:%.*]]) { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[A:%.*]] = alloca i32, align 4 +; MODULE-NEXT: call void @foo(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR1]] +; MODULE-NEXT: call void @callback1(void (i32*)* noundef nonnull @foo) +; MODULE-NEXT: call void @callback2(void (i8*)* noundef bitcast (void (i32*)* @foo to void (i8*)*)) +; MODULE-NEXT: call void @callback2(void (i8*)* [[FP]]) +; MODULE-NEXT: call void [[FP]](i8* bitcast (void (i32*)* @foo to i8*)) +; MODULE-NEXT: [[TMP1:%.*]] = bitcast i32* [[A]] to i8* +; MODULE-NEXT: call void [[FP]](i8* [[TMP1]]) +; MODULE-NEXT: call void @internal(void (i8*)* nonnull [[FP]]) +; MODULE-NEXT: ret void ; -; -; 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 -; -; 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 +; CGSCC-LABEL: define {{[^@]+}}@external +; CGSCC-SAME: (void (i8*)* [[FP:%.*]]) { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[A:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: call void @foo(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR1]] +; CGSCC-NEXT: call void @callback1(void (i32*)* noundef nonnull @foo) +; CGSCC-NEXT: call void @callback2(void (i8*)* noundef bitcast (void (i32*)* @foo to void (i8*)*)) +; CGSCC-NEXT: call void @callback2(void (i8*)* [[FP]]) +; CGSCC-NEXT: call void [[FP]](i8* bitcast (void (i32*)* @foo to i8*)) +; CGSCC-NEXT: [[TMP1:%.*]] = bitcast i32* [[A]] to i8* +; CGSCC-NEXT: call void [[FP]](i8* [[TMP1]]) +; CGSCC-NEXT: call void @internal(void (i8*)* noundef nonnull [[FP]]) +; CGSCC-NEXT: ret void ; entry: %a = alloca i32, align 4 @@ -95,20 +88,19 @@ } define internal void @foo(i32* %a) { +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@foo +; MODULE-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: store i32 0, i32* [[A]], align 4 +; MODULE-NEXT: ret void ; -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@foo -; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: store i32 0, i32* [[A]], align 4 -; IS__TUNIT____-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@foo -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR0:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: store i32 0, i32* [[A]], align 4 -; IS__CGSCC____-NEXT: ret void +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@foo +; CGSCC-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: store i32 0, i32* [[A]], align 4 +; CGSCC-NEXT: ret void ; entry: store i32 0, i32* %a @@ -118,9 +110,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 } +; MODULE: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; CGSCC: 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 @@ -122,8 +121,6 @@ ret i16 %p2 } -; CHECK-LABEL: declare {{[^@]+}}@func6 -; CHECK-SAME: (i8*) declare void @func6(i8*) ;. ; CHECK: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } 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,9 +1,7 @@ ; 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 -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,MODULE ; 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 +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; TEST 1 - negative. @@ -46,15 +44,15 @@ } define void @nocapture(i8* %a){ -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@nocapture -; NOT_CGSCC_NPM-SAME: (i8* nocapture nofree readnone [[A:%.*]]) #[[ATTR0:[0-9]+]] { -; NOT_CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@nocapture +; MODULE-SAME: (i8* nocapture nofree readnone [[A:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@nocapture +; CGSCC-SAME: (i8* nocapture nofree readnone [[A:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: ret void ; ret void } @@ -95,12 +93,10 @@ ; TEST 4 ; void *baz(); ; void *foo(int a); -; ; void *bar() { ; foo(0); ; return baz(); ; } -; ; void *foo(int a) { ; if (a) ; bar(); @@ -149,30 +145,30 @@ ; Returning global pointer. Should not be noalias. define i8** @getter() { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@getter -; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { -; NOT_CGSCC_NPM-NEXT: ret i8** @G +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@getter +; MODULE-SAME: () #[[ATTR0]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@getter +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: ret i8** @G ; ret i8** @G } ; Returning global pointer. Should not be noalias. define i8** @calle1(){ -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@calle1 -; NOT_CGSCC_NPM-SAME: () #[[ATTR0]] { -; NOT_CGSCC_NPM-NEXT: ret i8** @G +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@calle1 +; MODULE-SAME: () #[[ATTR0]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@calle1 +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: ret i8** @G ; %1 = call i8** @getter() ret i8** %1 @@ -331,13 +327,13 @@ ret void } define void @test10(i8* noalias %a) { +; FIXME: missing noalias ; CHECK-LABEL: define {{[^@]+}}@test10 ; CHECK-SAME: (i8* noalias [[A:%.*]]) { ; CHECK-NEXT: tail call void @test10_helper_1(i8* [[A]]) ; CHECK-NEXT: tail call void @test10_helper_2(i8* noalias [[A]]) ; CHECK-NEXT: ret void ; -; FIXME: missing noalias tail call void @test10_helper_1(i8* %a) tail call void @test10_helper_2(i8* %a) @@ -383,6 +379,8 @@ } define void @test12_2(){ +; FIXME: This should be @use_nocapture(i8* noalias [[A]]) +; FIXME: This should be @use_nocapture(i8* noalias nocapture [[A]]) ; CHECK-LABEL: define {{[^@]+}}@test12_2() { ; CHECK-NEXT: [[A:%.*]] = tail call noalias i8* @malloc(i64 noundef 4) ; CHECK-NEXT: tail call void @use_nocapture(i8* noalias nocapture [[A]]) @@ -391,8 +389,6 @@ ; CHECK-NEXT: tail call void @use_nocapture(i8* nocapture [[A]]) ; CHECK-NEXT: ret void ; -; FIXME: This should be @use_nocapture(i8* noalias [[A]]) -; FIXME: This should be @use_nocapture(i8* noalias nocapture [[A]]) %A = tail call noalias i8* @malloc(i64 4) tail call void @use_nocapture(i8* %A) tail call void @use_nocapture(i8* %A) @@ -414,27 +410,15 @@ } 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 +449,11 @@ } 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 +462,11 @@ } 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* @@ -517,40 +479,40 @@ ; TEST 14 i2p casts define internal i32 @p2i(i32* %arg) { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@p2i -; NOT_CGSCC_NPM-SAME: (i32* noalias nofree readnone [[ARG:%.*]]) #[[ATTR0]] { -; NOT_CGSCC_NPM-NEXT: [[P2I:%.*]] = ptrtoint i32* [[ARG]] to i32 -; NOT_CGSCC_NPM-NEXT: ret i32 [[P2I]] -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@p2i -; IS__CGSCC____-SAME: (i32* noalias nofree readnone [[ARG:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: [[P2I:%.*]] = ptrtoint i32* [[ARG]] to i32 -; IS__CGSCC____-NEXT: ret i32 [[P2I]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@p2i +; MODULE-SAME: (i32* noalias nofree readnone [[ARG:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[P2I:%.*]] = ptrtoint i32* [[ARG]] to i32 +; MODULE-NEXT: ret i32 [[P2I]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@p2i +; CGSCC-SAME: (i32* noalias nofree readnone [[ARG:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[P2I:%.*]] = ptrtoint i32* [[ARG]] to i32 +; CGSCC-NEXT: ret i32 [[P2I]] ; %p2i = ptrtoint i32* %arg to i32 ret i32 %p2i } define i32 @i2p(i32* %arg) { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind readonly willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@i2p -; NOT_CGSCC_NPM-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { -; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = call i32 @p2i(i32* noalias nofree readnone [[ARG]]) #[[ATTR0]] -; NOT_CGSCC_NPM-NEXT: [[I2P:%.*]] = inttoptr i32 [[C]] to i8* -; NOT_CGSCC_NPM-NEXT: [[BC:%.*]] = bitcast i8* [[I2P]] to i32* -; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32 @ret(i32* nocapture nofree readonly align 4 [[BC]]) #[[ATTR4]] -; NOT_CGSCC_NPM-NEXT: 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]] +; MODULE: Function Attrs: nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@i2p +; MODULE-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { +; MODULE-NEXT: [[C:%.*]] = call i32 @p2i(i32* noalias nofree readnone [[ARG]]) #[[ATTR0]] +; MODULE-NEXT: [[I2P:%.*]] = inttoptr i32 [[C]] to i8* +; MODULE-NEXT: [[BC:%.*]] = bitcast i8* [[I2P]] to i32* +; MODULE-NEXT: [[CALL:%.*]] = call i32 @ret(i32* nocapture nofree readonly align 4 [[BC]]) #[[ATTR4]] +; MODULE-NEXT: ret i32 [[CALL]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@i2p +; CGSCC-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { +; CGSCC-NEXT: [[C:%.*]] = call i32 @p2i(i32* noalias nofree readnone [[ARG]]) #[[ATTR10:[0-9]+]] +; CGSCC-NEXT: [[I2P:%.*]] = inttoptr i32 [[C]] to i8* +; CGSCC-NEXT: [[BC:%.*]] = bitcast i8* [[I2P]] to i32* +; CGSCC-NEXT: [[CALL:%.*]] = call i32 @ret(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[BC]]) #[[ATTR11:[0-9]+]] +; CGSCC-NEXT: ret i32 [[CALL]] ; %c = call i32 @p2i(i32* %arg) %i2p = inttoptr i32 %c to i8* @@ -559,17 +521,17 @@ ret i32 %call } define internal i32 @ret(i32* %arg) { -; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@ret -; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR5:[0-9]+]] { -; NOT_CGSCC_NPM-NEXT: [[L:%.*]] = load i32, i32* [[ARG]], align 4 -; NOT_CGSCC_NPM-NEXT: ret i32 [[L]] -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@ret -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR5:[0-9]+]] { -; IS__CGSCC____-NEXT: [[L:%.*]] = load i32, i32* [[ARG]], align 4 -; IS__CGSCC____-NEXT: ret i32 [[L]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@ret +; MODULE-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR5:[0-9]+]] { +; MODULE-NEXT: [[L:%.*]] = load i32, i32* [[ARG]], align 4 +; MODULE-NEXT: ret i32 [[L]] +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@ret +; CGSCC-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR5:[0-9]+]] { +; CGSCC-NEXT: [[L:%.*]] = load i32, i32* [[ARG]], align 4 +; CGSCC-NEXT: ret i32 [[L]] ; %l = load i32, i32* %arg ret i32 %l @@ -585,29 +547,29 @@ ; Function Attrs: nounwind optsize define internal fastcc double @strtox(i8* %s, i8** %p, i32 %prec) unnamed_addr { -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@strtox -; NOT_CGSCC_NPM-SAME: (i8* [[S:%.*]]) unnamed_addr { -; NOT_CGSCC_NPM-NEXT: entry: -; NOT_CGSCC_NPM-NEXT: [[F:%.*]] = alloca [[STRUCT__IO_FILE:%.*]], align 8 -; NOT_CGSCC_NPM-NEXT: [[TMP0:%.*]] = bitcast %struct._IO_FILE* [[F]] to i8* -; NOT_CGSCC_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 144, i8* nocapture nofree noundef nonnull align 8 dereferenceable(240) [[TMP0]]) #[[ATTR10:[0-9]+]] -; NOT_CGSCC_NPM-NEXT: [[CALL:%.*]] = call i32 bitcast (i32 (...)* @sh_fromstring to i32 (%struct._IO_FILE*, i8*)*)(%struct._IO_FILE* nonnull align 8 dereferenceable(240) [[F]], i8* [[S]]) -; NOT_CGSCC_NPM-NEXT: call void @__shlim(%struct._IO_FILE* noundef nonnull align 8 dereferenceable(240) [[F]], i64 noundef 0) -; NOT_CGSCC_NPM-NEXT: [[CALL1:%.*]] = call double @__floatscan(%struct._IO_FILE* noundef nonnull align 8 dereferenceable(240) [[F]], i32 noundef 1, i32 noundef 1) -; NOT_CGSCC_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 144, i8* nocapture nofree noundef nonnull align 8 dereferenceable(240) [[TMP0]]) -; NOT_CGSCC_NPM-NEXT: ret double [[CALL1]] -; -; IS__CGSCC____-LABEL: define {{[^@]+}}@strtox -; IS__CGSCC____-SAME: (i8* [[S:%.*]]) unnamed_addr { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[F:%.*]] = alloca [[STRUCT__IO_FILE:%.*]], align 8 -; IS__CGSCC____-NEXT: [[TMP0:%.*]] = bitcast %struct._IO_FILE* [[F]] to i8* -; IS__CGSCC____-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 144, i8* nocapture nofree noundef nonnull align 8 dereferenceable(240) [[TMP0]]) #[[ATTR12:[0-9]+]] -; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32 bitcast (i32 (...)* @sh_fromstring to i32 (%struct._IO_FILE*, i8*)*)(%struct._IO_FILE* nonnull align 8 dereferenceable(240) [[F]], i8* [[S]]) -; IS__CGSCC____-NEXT: call void @__shlim(%struct._IO_FILE* noundef nonnull align 8 dereferenceable(240) [[F]], i64 noundef 0) -; IS__CGSCC____-NEXT: [[CALL1:%.*]] = call double @__floatscan(%struct._IO_FILE* noundef nonnull align 8 dereferenceable(240) [[F]], i32 noundef 1, i32 noundef 1) -; IS__CGSCC____-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 144, i8* nocapture nofree noundef nonnull align 8 dereferenceable(240) [[TMP0]]) -; IS__CGSCC____-NEXT: ret double [[CALL1]] +; MODULE-LABEL: define {{[^@]+}}@strtox +; MODULE-SAME: (i8* [[S:%.*]]) unnamed_addr { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[F:%.*]] = alloca [[STRUCT__IO_FILE:%.*]], align 8 +; MODULE-NEXT: [[TMP0:%.*]] = bitcast %struct._IO_FILE* [[F]] to i8* +; MODULE-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 144, i8* nocapture nofree noundef nonnull align 8 dereferenceable(240) [[TMP0]]) #[[ATTR10:[0-9]+]] +; MODULE-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]]) +; MODULE-NEXT: call void @__shlim(%struct._IO_FILE* noundef nonnull align 8 dereferenceable(240) [[F]], i64 noundef 0) +; MODULE-NEXT: [[CALL1:%.*]] = call double @__floatscan(%struct._IO_FILE* noundef nonnull align 8 dereferenceable(240) [[F]], i32 noundef 1, i32 noundef 1) +; MODULE-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 144, i8* nocapture nofree noundef nonnull align 8 dereferenceable(240) [[TMP0]]) +; MODULE-NEXT: ret double [[CALL1]] +; +; CGSCC-LABEL: define {{[^@]+}}@strtox +; CGSCC-SAME: (i8* [[S:%.*]]) unnamed_addr { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[F:%.*]] = alloca [[STRUCT__IO_FILE:%.*]], align 8 +; CGSCC-NEXT: [[TMP0:%.*]] = bitcast %struct._IO_FILE* [[F]] to i8* +; CGSCC-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 144, i8* nocapture nofree noundef nonnull align 8 dereferenceable(240) [[TMP0]]) #[[ATTR12:[0-9]+]] +; 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]]) +; CGSCC-NEXT: call void @__shlim(%struct._IO_FILE* noundef nonnull align 8 dereferenceable(240) [[F]], i64 noundef 0) +; CGSCC-NEXT: [[CALL1:%.*]] = call double @__floatscan(%struct._IO_FILE* noundef nonnull align 8 dereferenceable(240) [[F]], i32 noundef 1, i32 noundef 1) +; CGSCC-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 144, i8* nocapture nofree noundef nonnull align 8 dereferenceable(240) [[TMP0]]) +; CGSCC-NEXT: ret double [[CALL1]] ; entry: %f = alloca %struct._IO_FILE, align 8 @@ -655,63 +617,63 @@ @alias_of_p = external global i32* define void @make_alias(i32* %p) { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@make_alias -; NOT_CGSCC_NPM-SAME: (i32* nofree writeonly [[P:%.*]]) #[[ATTR7:[0-9]+]] { -; NOT_CGSCC_NPM-NEXT: store i32* [[P]], i32** @alias_of_p, align 8 -; NOT_CGSCC_NPM-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@make_alias -; IS__CGSCC____-SAME: (i32* nofree writeonly [[P:%.*]]) #[[ATTR7:[0-9]+]] { -; IS__CGSCC____-NEXT: store i32* [[P]], i32** @alias_of_p, align 8 -; IS__CGSCC____-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@make_alias +; MODULE-SAME: (i32* nofree writeonly [[P:%.*]]) #[[ATTR7:[0-9]+]] { +; MODULE-NEXT: store i32* [[P]], i32** @alias_of_p, align 8 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@make_alias +; CGSCC-SAME: (i32* nofree writeonly [[P:%.*]]) #[[ATTR7:[0-9]+]] { +; CGSCC-NEXT: store i32* [[P]], i32** @alias_of_p, align 8 +; CGSCC-NEXT: ret void ; store i32* %p, i32** @alias_of_p ret void } define void @only_store(i32* %p) { -; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@only_store -; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR8:[0-9]+]] { -; NOT_CGSCC_NPM-NEXT: store i32 0, i32* [[P]], align 4 -; NOT_CGSCC_NPM-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@only_store -; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR8:[0-9]+]] { -; IS__CGSCC____-NEXT: store i32 0, i32* [[P]], align 4 -; IS__CGSCC____-NEXT: ret void +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@only_store +; MODULE-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR8:[0-9]+]] { +; MODULE-NEXT: store i32 0, i32* [[P]], align 4 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@only_store +; CGSCC-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR8:[0-9]+]] { +; CGSCC-NEXT: store i32 0, i32* [[P]], align 4 +; CGSCC-NEXT: ret void ; store i32 0, i32* %p ret void } define void @test15_caller(i32* noalias %p, i32 %c) { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test15_caller -; NOT_CGSCC_NPM-SAME: (i32* noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { -; NOT_CGSCC_NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C]], 0 -; NOT_CGSCC_NPM-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] -; NOT_CGSCC_NPM: if.then: -; NOT_CGSCC_NPM-NEXT: tail call void @only_store(i32* noalias nocapture nofree writeonly align 4 [[P]]) #[[ATTR7]] -; NOT_CGSCC_NPM-NEXT: br label [[IF_END]] -; NOT_CGSCC_NPM: if.end: -; NOT_CGSCC_NPM-NEXT: tail call void @make_alias(i32* nofree writeonly [[P]]) #[[ATTR7]] -; NOT_CGSCC_NPM-NEXT: 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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@test15_caller +; MODULE-SAME: (i32* noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { +; MODULE-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C]], 0 +; MODULE-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] +; MODULE: if.then: +; MODULE-NEXT: tail call void @only_store(i32* noalias nocapture nofree writeonly align 4 [[P]]) #[[ATTR7]] +; MODULE-NEXT: br label [[IF_END]] +; MODULE: if.end: +; MODULE-NEXT: tail call void @make_alias(i32* nofree writeonly [[P]]) #[[ATTR7]] +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@test15_caller +; CGSCC-SAME: (i32* noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { +; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C]], 0 +; CGSCC-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] +; CGSCC: if.then: +; CGSCC-NEXT: tail call void @only_store(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13:[0-9]+]] +; CGSCC-NEXT: br label [[IF_END]] +; CGSCC: if.end: +; CGSCC-NEXT: tail call void @make_alias(i32* nofree writeonly [[P]]) #[[ATTR13]] +; CGSCC-NEXT: ret void ; %tobool = icmp eq i32 %c, 0 br i1 %tobool, label %if.end, label %if.then @@ -727,7 +689,6 @@ } ; Test 16 -; ; __attribute__((noinline)) static void test16_sub(int * restrict p, int c1, int c2) { ; if (c1) { ; only_store(p); @@ -740,47 +701,46 @@ ; void test16_caller(int * restrict p, int c) { ; test16_sub(p, c, c); ; } -; ; FIXME: this should be tail @only_store(i32* noalias %p) ; when test16_caller is called, c1 always equals to c2. (Note that linkage is internal) ; Therefore, only one of the two conditions of if statementes will be fulfilled. define internal void @test16_sub(i32* noalias %p, i32 %c1, i32 %c2) { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test16_sub -; NOT_CGSCC_NPM-SAME: (i32* noalias nofree writeonly [[P:%.*]], i32 [[C1:%.*]], i32 [[C2:%.*]]) #[[ATTR7]] { -; NOT_CGSCC_NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C1]], 0 -; NOT_CGSCC_NPM-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] -; NOT_CGSCC_NPM: if.then: -; NOT_CGSCC_NPM-NEXT: tail call void @only_store(i32* noalias nocapture nofree writeonly align 4 [[P]]) #[[ATTR7]] -; NOT_CGSCC_NPM-NEXT: tail call void @make_alias(i32* nofree writeonly align 4 [[P]]) #[[ATTR7]] -; NOT_CGSCC_NPM-NEXT: br label [[IF_END]] -; NOT_CGSCC_NPM: if.end: -; NOT_CGSCC_NPM-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C2]], 0 -; NOT_CGSCC_NPM-NEXT: br i1 [[TOBOOL1]], label [[IF_THEN2:%.*]], label [[IF_END3:%.*]] -; NOT_CGSCC_NPM: if.then2: -; NOT_CGSCC_NPM-NEXT: tail call void @only_store(i32* nocapture nofree writeonly align 4 [[P]]) #[[ATTR7]] -; NOT_CGSCC_NPM-NEXT: br label [[IF_END3]] -; 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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@test16_sub +; MODULE-SAME: (i32* noalias nofree writeonly [[P:%.*]], i32 [[C1:%.*]], i32 [[C2:%.*]]) #[[ATTR7]] { +; MODULE-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C1]], 0 +; MODULE-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] +; MODULE: if.then: +; MODULE-NEXT: tail call void @only_store(i32* noalias nocapture nofree writeonly align 4 [[P]]) #[[ATTR7]] +; MODULE-NEXT: tail call void @make_alias(i32* nofree writeonly align 4 [[P]]) #[[ATTR7]] +; MODULE-NEXT: br label [[IF_END]] +; MODULE: if.end: +; MODULE-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C2]], 0 +; MODULE-NEXT: br i1 [[TOBOOL1]], label [[IF_THEN2:%.*]], label [[IF_END3:%.*]] +; MODULE: if.then2: +; MODULE-NEXT: tail call void @only_store(i32* nocapture nofree writeonly align 4 [[P]]) #[[ATTR7]] +; MODULE-NEXT: br label [[IF_END3]] +; MODULE: if.end3: +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@test16_sub +; CGSCC-SAME: (i32* noalias nofree writeonly [[P:%.*]], i32 [[C1:%.*]], i32 [[C2:%.*]]) #[[ATTR7]] { +; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C1]], 0 +; CGSCC-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] +; CGSCC: if.then: +; CGSCC-NEXT: tail call void @only_store(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]] +; CGSCC-NEXT: tail call void @make_alias(i32* nofree nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]] +; CGSCC-NEXT: br label [[IF_END]] +; CGSCC: if.end: +; CGSCC-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C2]], 0 +; CGSCC-NEXT: br i1 [[TOBOOL1]], label [[IF_THEN2:%.*]], label [[IF_END3:%.*]] +; CGSCC: if.then2: +; CGSCC-NEXT: tail call void @only_store(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]] +; CGSCC-NEXT: br label [[IF_END3]] +; CGSCC: if.end3: +; CGSCC-NEXT: ret void ; %tobool = icmp eq i32 %c1, 0 br i1 %tobool, label %if.end, label %if.then @@ -803,26 +763,24 @@ } define void @test16_caller(i32* %p, i32 %c) { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test16_caller -; NOT_CGSCC_NPM-SAME: (i32* nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { -; NOT_CGSCC_NPM-NEXT: tail call void @test16_sub(i32* noalias nofree writeonly [[P]], i32 [[C]], i32 [[C]]) #[[ATTR7]] -; NOT_CGSCC_NPM-NEXT: ret void -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@test16_caller -; IS__CGSCC____-SAME: (i32* nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { -; IS__CGSCC____-NEXT: tail call void @test16_sub(i32* noalias nofree writeonly [[P]], i32 [[C]], i32 [[C]]) #[[ATTR13]] -; IS__CGSCC____-NEXT: ret void +; MODULE: Function Attrs: nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@test16_caller +; MODULE-SAME: (i32* nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { +; MODULE-NEXT: tail call void @test16_sub(i32* noalias nofree writeonly [[P]], i32 [[C]], i32 [[C]]) #[[ATTR7]] +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@test16_caller +; CGSCC-SAME: (i32* nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { +; CGSCC-NEXT: tail call void @test16_sub(i32* noalias nofree writeonly [[P]], i32 [[C]], i32 [[C]]) #[[ATTR13]] +; CGSCC-NEXT: ret void ; tail call void @test16_sub(i32* %p, i32 %c, i32 %c) ret void } ; test 17 -; ; only_store is not called after make_alias is called. -; ; void test17_caller(int* p, int c) { ; if(c) { ; make_alias(p); @@ -839,35 +797,35 @@ ; } define void @test17_caller(i32* noalias %p, i32 %c) { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test17_caller -; NOT_CGSCC_NPM-SAME: (i32* noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { -; NOT_CGSCC_NPM-NEXT: entry: -; NOT_CGSCC_NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C]], 0 -; NOT_CGSCC_NPM-NEXT: br i1 [[TOBOOL]], label [[L1:%.*]], label [[L2:%.*]] -; NOT_CGSCC_NPM: l1: -; NOT_CGSCC_NPM-NEXT: tail call void @make_alias(i32* nofree writeonly [[P]]) #[[ATTR7]] -; NOT_CGSCC_NPM-NEXT: br label [[L3:%.*]] -; NOT_CGSCC_NPM: l2: -; NOT_CGSCC_NPM-NEXT: tail call void @only_store(i32* nocapture nofree writeonly align 4 [[P]]) #[[ATTR7]] -; NOT_CGSCC_NPM-NEXT: br label [[L3]] -; 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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@test17_caller +; MODULE-SAME: (i32* noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C]], 0 +; MODULE-NEXT: br i1 [[TOBOOL]], label [[L1:%.*]], label [[L2:%.*]] +; MODULE: l1: +; MODULE-NEXT: tail call void @make_alias(i32* nofree writeonly [[P]]) #[[ATTR7]] +; MODULE-NEXT: br label [[L3:%.*]] +; MODULE: l2: +; MODULE-NEXT: tail call void @only_store(i32* nocapture nofree writeonly align 4 [[P]]) #[[ATTR7]] +; MODULE-NEXT: br label [[L3]] +; MODULE: l3: +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@test17_caller +; CGSCC-SAME: (i32* noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C]], 0 +; CGSCC-NEXT: br i1 [[TOBOOL]], label [[L1:%.*]], label [[L2:%.*]] +; CGSCC: l1: +; CGSCC-NEXT: tail call void @make_alias(i32* nofree writeonly [[P]]) #[[ATTR13]] +; CGSCC-NEXT: br label [[L3:%.*]] +; CGSCC: l2: +; CGSCC-NEXT: tail call void @only_store(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]] +; CGSCC-NEXT: br label [[L3]] +; CGSCC: l3: +; CGSCC-NEXT: ret void ; entry: %tobool = icmp eq i32 %c, 0 @@ -897,46 +855,46 @@ ; } define void @noreturn() { -; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@noreturn -; NOT_CGSCC_NPM-SAME: () #[[ATTR9:[0-9]+]] { -; NOT_CGSCC_NPM-NEXT: unreachable +; MODULE: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@noreturn +; MODULE-SAME: () #[[ATTR9:[0-9]+]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@noreturn +; CGSCC-SAME: () #[[ATTR9:[0-9]+]] { +; CGSCC-NEXT: unreachable ; call void @noreturn() ret void } define void @test18_caller(i32* noalias %p, i32 %c) { -; NOT_CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test18_caller -; NOT_CGSCC_NPM-SAME: (i32* noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { -; NOT_CGSCC_NPM-NEXT: entry: -; NOT_CGSCC_NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C]], 0 -; NOT_CGSCC_NPM-NEXT: br i1 [[TOBOOL]], label [[L1:%.*]], label [[L2:%.*]] -; NOT_CGSCC_NPM: l1: -; NOT_CGSCC_NPM-NEXT: tail call void @make_alias(i32* nofree writeonly [[P]]) #[[ATTR7]] -; NOT_CGSCC_NPM-NEXT: unreachable -; NOT_CGSCC_NPM: l2: -; NOT_CGSCC_NPM-NEXT: tail call void @only_store(i32* nocapture nofree writeonly align 4 [[P]]) #[[ATTR7]] -; NOT_CGSCC_NPM-NEXT: 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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@test18_caller +; MODULE-SAME: (i32* noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C]], 0 +; MODULE-NEXT: br i1 [[TOBOOL]], label [[L1:%.*]], label [[L2:%.*]] +; MODULE: l1: +; MODULE-NEXT: tail call void @make_alias(i32* nofree writeonly [[P]]) #[[ATTR7]] +; MODULE-NEXT: unreachable +; MODULE: l2: +; MODULE-NEXT: tail call void @only_store(i32* nocapture nofree writeonly align 4 [[P]]) #[[ATTR7]] +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@test18_caller +; CGSCC-SAME: (i32* noalias nofree nonnull writeonly align 4 dereferenceable(4) [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C]], 0 +; CGSCC-NEXT: br i1 [[TOBOOL]], label [[L1:%.*]], label [[L2:%.*]] +; CGSCC: l1: +; CGSCC-NEXT: tail call void @make_alias(i32* nofree nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]] +; CGSCC-NEXT: unreachable +; CGSCC: l2: +; CGSCC-NEXT: tail call void @only_store(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]] +; CGSCC-NEXT: ret void ; entry: %tobool = icmp eq i32 %c, 0 @@ -952,30 +910,30 @@ ret void } ;. -; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -; NOT_CGSCC_NPM: attributes #[[ATTR1]] = { nounwind uwtable } -; NOT_CGSCC_NPM: attributes #[[ATTR2]] = { nounwind } -; NOT_CGSCC_NPM: attributes #[[ATTR3]] = { nounwind ssp uwtable } -; NOT_CGSCC_NPM: attributes #[[ATTR4]] = { nofree nosync nounwind readonly willreturn } -; NOT_CGSCC_NPM: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind readonly willreturn } -; NOT_CGSCC_NPM: attributes #[[ATTR6:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } -; NOT_CGSCC_NPM: attributes #[[ATTR7]] = { nofree nosync nounwind willreturn writeonly } -; NOT_CGSCC_NPM: attributes #[[ATTR8]] = { argmemonly nofree nosync nounwind willreturn writeonly } -; NOT_CGSCC_NPM: attributes #[[ATTR9]] = { nofree noreturn nosync nounwind readnone willreturn } -; NOT_CGSCC_NPM: attributes #[[ATTR10]] = { willreturn } +; MODULE: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR1]] = { nounwind uwtable } +; MODULE: attributes #[[ATTR2]] = { nounwind } +; MODULE: attributes #[[ATTR3]] = { nounwind ssp uwtable } +; MODULE: attributes #[[ATTR4]] = { nofree nosync nounwind readonly willreturn } +; MODULE: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind readonly willreturn } +; MODULE: attributes #[[ATTR6:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } +; MODULE: attributes #[[ATTR7]] = { nofree nosync nounwind willreturn writeonly } +; MODULE: attributes #[[ATTR8]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; MODULE: attributes #[[ATTR9]] = { nofree noreturn nosync nounwind readnone willreturn } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR1]] = { nounwind uwtable } +; CGSCC: attributes #[[ATTR2]] = { nounwind } +; CGSCC: attributes #[[ATTR3]] = { nounwind ssp uwtable } +; CGSCC: attributes #[[ATTR4]] = { nofree norecurse nosync nounwind readonly willreturn } +; CGSCC: attributes #[[ATTR5]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; CGSCC: attributes #[[ATTR6:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR7]] = { nofree norecurse nosync nounwind willreturn writeonly } +; CGSCC: attributes #[[ATTR8]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; CGSCC: attributes #[[ATTR9]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR10]] = { readnone willreturn } +; CGSCC: attributes #[[ATTR11]] = { readonly willreturn } +; CGSCC: attributes #[[ATTR12]] = { willreturn } +; CGSCC: 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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC @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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@c1 +; MODULE-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[Q:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-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]] +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@c1 +; CGSCC-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[Q:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@c2 +; MODULE-SAME: (i32* nofree writeonly [[Q:%.*]]) #[[ATTR1:[0-9]+]] { +; MODULE-NEXT: store i32* [[Q]], i32** @g, align 8 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@c2 +; CGSCC-SAME: (i32* nofree writeonly [[Q:%.*]]) #[[ATTR1:[0-9]+]] { +; CGSCC-NEXT: store i32* [[Q]], i32** @g, align 8 +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@c3 +; MODULE-SAME: (i32* nofree writeonly [[Q:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: call void @c2(i32* nofree writeonly [[Q]]) #[[ATTR1]] +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@c3 +; CGSCC-SAME: (i32* nofree writeonly [[Q:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: call void @c2(i32* nofree writeonly [[Q]]) #[[ATTR19:[0-9]+]] +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@c4 +; MODULE-SAME: (i32* nofree readnone [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 +; MODULE-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] +; MODULE-NEXT: [[BIT:%.*]] = trunc i32 [[TMP2]] to i1 +; MODULE-NEXT: br i1 [[BIT]], label [[L1:%.*]], label [[L0:%.*]] +; MODULE: l0: +; MODULE-NEXT: ret i1 false +; MODULE: l1: +; MODULE-NEXT: ret i1 true +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@c4 +; CGSCC-SAME: (i32* nofree readnone [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 +; CGSCC-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] +; CGSCC-NEXT: [[BIT:%.*]] = trunc i32 [[TMP2]] to i1 +; CGSCC-NEXT: br i1 [[BIT]], label [[L1:%.*]], label [[L0:%.*]] +; CGSCC: l0: +; CGSCC-NEXT: ret i1 false +; CGSCC: l1: +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@c4b +; MODULE-SAME: (i32* nocapture nofree readnone [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 +; MODULE-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] +; MODULE-NEXT: [[BIT:%.*]] = trunc i32 [[TMP2]] to i1 +; MODULE-NEXT: br i1 [[BIT]], label [[L1:%.*]], label [[L0:%.*]] +; MODULE: l0: +; MODULE-NEXT: ret i1 false +; MODULE: l1: +; MODULE-NEXT: ret i1 false +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@c4b +; CGSCC-SAME: (i32* nocapture nofree readnone [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 +; CGSCC-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] +; CGSCC-NEXT: [[BIT:%.*]] = trunc i32 [[TMP2]] to i1 +; CGSCC-NEXT: br i1 [[BIT]], label [[L1:%.*]], label [[L0:%.*]] +; CGSCC: l0: +; CGSCC-NEXT: ret i1 false +; CGSCC: l1: +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@c5 +; MODULE-SAME: (i32* nofree readonly [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR2:[0-9]+]] { +; MODULE-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 +; MODULE-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] +; MODULE-NEXT: [[BIT:%.*]] = and i32 [[TMP2]], 1 +; MODULE-NEXT: [[LOOKUP:%.*]] = getelementptr [2 x i1], [2 x i1]* @lookup_table, i32 0, i32 [[BIT]] +; MODULE-NEXT: [[VAL:%.*]] = load i1, i1* [[LOOKUP]], align 1 +; MODULE-NEXT: ret i1 [[VAL]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@c5 +; CGSCC-SAME: (i32* nofree readonly [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR2:[0-9]+]] { +; CGSCC-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 +; CGSCC-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] +; CGSCC-NEXT: [[BIT:%.*]] = and i32 [[TMP2]], 1 +; CGSCC-NEXT: [[LOOKUP:%.*]] = getelementptr [2 x i1], [2 x i1]* @lookup_table, i32 0, i32 [[BIT]] +; CGSCC-NEXT: [[VAL:%.*]] = load i1, i1* [[LOOKUP]], align 1 +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@lookup_bit +; MODULE-SAME: (i32* nofree readnone [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 +; MODULE-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] +; MODULE-NEXT: [[BIT:%.*]] = and i32 [[TMP2]], 1 +; MODULE-NEXT: [[LOOKUP:%.*]] = getelementptr [2 x i1], [2 x i1]* @lookup_table, i32 0, i32 [[BIT]] +; MODULE-NEXT: ret i1* [[LOOKUP]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@lookup_bit +; CGSCC-SAME: (i32* nofree readnone [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[TMP:%.*]] = ptrtoint i32* [[Q]] to i32 +; CGSCC-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] +; CGSCC-NEXT: [[BIT:%.*]] = and i32 [[TMP2]], 1 +; CGSCC-NEXT: [[LOOKUP:%.*]] = getelementptr [2 x i1], [2 x i1]* @lookup_table, i32 0, i32 [[BIT]] +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@c7 +; MODULE-SAME: (i32* nofree readonly [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR2]] { +; MODULE-NEXT: [[PTR:%.*]] = call i1* @lookup_bit(i32* noalias nofree readnone [[Q]], i32 [[BITNO]]) #[[ATTR17:[0-9]+]] +; MODULE-NEXT: [[VAL:%.*]] = load i1, i1* [[PTR]], align 1 +; MODULE-NEXT: ret i1 [[VAL]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@c7 +; CGSCC-SAME: (i32* nofree readonly [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: [[PTR:%.*]] = call i1* @lookup_bit(i32* noalias nofree readnone [[Q]], i32 [[BITNO]]) #[[ATTR20:[0-9]+]] +; CGSCC-NEXT: [[VAL:%.*]] = load i1, i1* [[PTR]], align 1 +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@nc1 +; MODULE-SAME: (i32* nofree [[Q:%.*]], i32* nocapture nofree [[P:%.*]], i1 [[B:%.*]]) #[[ATTR5:[0-9]+]] { +; MODULE-NEXT: e: +; MODULE-NEXT: br label [[L:%.*]] +; MODULE: l: +; MODULE-NEXT: [[Y:%.*]] = phi i32* [ [[Q]], [[E:%.*]] ] +; MODULE-NEXT: [[TMP2:%.*]] = select i1 [[B]], i32* [[P]], i32* [[Y]] +; MODULE-NEXT: [[VAL:%.*]] = load i32, i32* [[TMP2]], align 4 +; MODULE-NEXT: store i32 0, i32* [[P]], align 4 +; MODULE-NEXT: store i32* [[Y]], i32** @g, align 8 +; MODULE-NEXT: ret i32 [[VAL]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@nc1 +; CGSCC-SAME: (i32* nofree [[Q:%.*]], i32* nocapture nofree align 4 [[P:%.*]], i1 [[B:%.*]]) #[[ATTR5:[0-9]+]] { +; CGSCC-NEXT: e: +; CGSCC-NEXT: br label [[L:%.*]] +; CGSCC: l: +; CGSCC-NEXT: [[Y:%.*]] = phi i32* [ [[Q]], [[E:%.*]] ] +; CGSCC-NEXT: [[TMP2:%.*]] = select i1 [[B]], i32* [[P]], i32* [[Y]] +; CGSCC-NEXT: [[VAL:%.*]] = load i32, i32* [[TMP2]], align 4 +; CGSCC-NEXT: store i32 0, i32* [[P]], align 4 +; CGSCC-NEXT: store i32* [[Y]], i32** @g, align 8 +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@nc1_addrspace +; MODULE-SAME: (i32* nofree [[Q:%.*]], i32 addrspace(1)* nocapture nofree [[P:%.*]], i1 [[B:%.*]]) #[[ATTR5]] { +; MODULE-NEXT: e: +; MODULE-NEXT: br label [[L:%.*]] +; MODULE: l: +; MODULE-NEXT: [[X:%.*]] = phi i32 addrspace(1)* [ [[P]], [[E:%.*]] ] +; MODULE-NEXT: [[Y:%.*]] = phi i32* [ [[Q]], [[E]] ] +; MODULE-NEXT: [[TMP:%.*]] = addrspacecast i32 addrspace(1)* [[X]] to i32* +; MODULE-NEXT: [[TMP2:%.*]] = select i1 [[B]], i32* [[TMP]], i32* [[Y]] +; MODULE-NEXT: [[VAL:%.*]] = load i32, i32* [[TMP2]], align 4 +; MODULE-NEXT: store i32 0, i32* [[TMP]], align 4 +; MODULE-NEXT: store i32* [[Y]], i32** @g, align 8 +; MODULE-NEXT: ret i32 [[VAL]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@nc1_addrspace +; CGSCC-SAME: (i32* nofree [[Q:%.*]], i32 addrspace(1)* nocapture nofree [[P:%.*]], i1 [[B:%.*]]) #[[ATTR5]] { +; CGSCC-NEXT: e: +; CGSCC-NEXT: br label [[L:%.*]] +; CGSCC: l: +; CGSCC-NEXT: [[X:%.*]] = phi i32 addrspace(1)* [ [[P]], [[E:%.*]] ] +; CGSCC-NEXT: [[Y:%.*]] = phi i32* [ [[Q]], [[E]] ] +; CGSCC-NEXT: [[TMP:%.*]] = addrspacecast i32 addrspace(1)* [[X]] to i32* +; CGSCC-NEXT: [[TMP2:%.*]] = select i1 [[B]], i32* [[TMP]], i32* [[Y]] +; CGSCC-NEXT: [[VAL:%.*]] = load i32, i32* [[TMP2]], align 4 +; CGSCC-NEXT: store i32 0, i32* [[TMP]], align 4 +; CGSCC-NEXT: store i32* [[Y]], i32** @g, align 8 +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@nc2 +; MODULE-SAME: (i32* nocapture nofree [[P:%.*]], i32* nofree [[Q:%.*]]) #[[ATTR5]] { +; MODULE-NEXT: [[TMP1:%.*]] = call i32 @nc1(i32* nofree [[Q]], i32* nocapture nofree [[P]], i1 noundef false) #[[ATTR5]] +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@nc2 +; CGSCC-SAME: (i32* nocapture nofree align 4 [[P:%.*]], i32* nofree [[Q:%.*]]) #[[ATTR5]] { +; CGSCC-NEXT: [[TMP1:%.*]] = call i32 @nc1(i32* nofree [[Q]], i32* nocapture nofree align 4 [[P]], i1 noundef false) #[[ATTR16:[0-9]+]] +; CGSCC-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 +; MODULE: Function Attrs: argmemonly nounwind +; MODULE-LABEL: define {{[^@]+}}@nc4 +; MODULE-SAME: (i8* [[P:%.*]]) #[[ATTR6:[0-9]+]] { +; MODULE-NEXT: call void @external(i8* readonly [[P]]) #[[ATTR18:[0-9]+]] +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nounwind +; CGSCC-LABEL: define {{[^@]+}}@nc4 +; CGSCC-SAME: (i8* [[P:%.*]]) #[[ATTR6:[0-9]+]] { +; CGSCC-NEXT: call void @external(i8* readonly [[P]]) #[[ATTR21:[0-9]+]] +; CGSCC-NEXT: ret void ; call void @external(i8* %p) ret void @@ -396,27 +394,16 @@ } 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 +415,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 +; MODULE: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test2 +; MODULE-SAME: (i8* nocapture nofree readnone [[X2:%.*]]) #[[ATTR8:[0-9]+]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test2 +; CGSCC-SAME: (i8* nocapture nofree readnone [[X2:%.*]]) #[[ATTR8:[0-9]+]] { +; CGSCC-NEXT: unreachable ; call void @test2(i8* %x2) store i32* null, i32** @g @@ -444,15 +431,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 +; MODULE: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test3 +; MODULE-SAME: (i8* nocapture nofree readnone [[X3:%.*]], i8* nocapture nofree readnone [[Y3:%.*]], i8* nocapture nofree readnone [[Z3:%.*]]) #[[ATTR8]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test3 +; CGSCC-SAME: (i8* nocapture nofree readnone [[X3:%.*]], i8* nocapture nofree readnone [[Y3:%.*]], i8* nocapture nofree readnone [[Z3:%.*]]) #[[ATTR8]] { +; CGSCC-NEXT: unreachable ; call void @test3(i8* %z3, i8* %y3, i8* %x3) store i32* null, i32** @g @@ -473,27 +460,16 @@ } 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 +509,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 +; MODULE: Function Attrs: argmemonly nofree nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@test_cmpxchg +; MODULE-SAME: (i32* nocapture nofree noundef nonnull dereferenceable(4) [[P:%.*]]) #[[ATTR9:[0-9]+]] { +; MODULE-NEXT: [[TMP1:%.*]] = cmpxchg i32* [[P]], i32 0, i32 1 acquire monotonic, align 4 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@test_cmpxchg +; CGSCC-SAME: (i32* nocapture nofree noundef nonnull dereferenceable(4) [[P:%.*]]) #[[ATTR9:[0-9]+]] { +; CGSCC-NEXT: [[TMP1:%.*]] = cmpxchg i32* [[P]], i32 0, i32 1 acquire monotonic, align 4 +; CGSCC-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 +; MODULE: Function Attrs: argmemonly nofree nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@test_cmpxchg_ptr +; MODULE-SAME: (i32** nocapture nofree noundef nonnull dereferenceable(8) [[P:%.*]], i32* nofree [[Q:%.*]]) #[[ATTR9]] { +; MODULE-NEXT: [[TMP1:%.*]] = cmpxchg i32** [[P]], i32* null, i32* [[Q]] acquire monotonic, align 8 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@test_cmpxchg_ptr +; CGSCC-SAME: (i32** nocapture nofree noundef nonnull dereferenceable(8) [[P:%.*]], i32* nofree [[Q:%.*]]) #[[ATTR9]] { +; CGSCC-NEXT: [[TMP1:%.*]] = cmpxchg i32** [[P]], i32* null, i32* [[Q]] acquire monotonic, align 8 +; CGSCC-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 +; MODULE: Function Attrs: argmemonly nofree nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@test_atomicrmw +; MODULE-SAME: (i32* nocapture nofree noundef nonnull dereferenceable(4) [[P:%.*]]) #[[ATTR9]] { +; MODULE-NEXT: [[TMP1:%.*]] = atomicrmw add i32* [[P]], i32 1 seq_cst, align 4 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@test_atomicrmw +; CGSCC-SAME: (i32* nocapture nofree noundef nonnull dereferenceable(4) [[P:%.*]]) #[[ATTR9]] { +; CGSCC-NEXT: [[TMP1:%.*]] = atomicrmw add i32* [[P]], i32 1 seq_cst, align 4 +; CGSCC-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 +; MODULE: Function Attrs: argmemonly nofree nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@test_volatile +; MODULE-SAME: (i32* nofree align 4 [[X:%.*]]) #[[ATTR9]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[GEP:%.*]] = getelementptr i32, i32* [[X]], i64 1 +; MODULE-NEXT: store volatile i32 0, i32* [[GEP]], align 4 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@test_volatile +; CGSCC-SAME: (i32* nofree align 4 [[X:%.*]]) #[[ATTR9]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[GEP:%.*]] = getelementptr i32, i32* [[X]], i64 1 +; CGSCC-NEXT: store volatile i32 0, i32* [[GEP]], align 4 +; CGSCC-NEXT: ret void ; entry: %gep = getelementptr i32, i32* %x, i64 1 @@ -607,21 +583,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 +; MODULE: Function Attrs: inaccessiblemem_or_argmemonly nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@nocaptureLaunder +; MODULE-SAME: (i8* nocapture nofree [[P:%.*]]) #[[ATTR10:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[B:%.*]] = call i8* @llvm.launder.invariant.group.p0i8(i8* nofree [[P]]) #[[ATTR19:[0-9]+]] +; MODULE-NEXT: store i8 42, i8* [[B]], align 1 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: inaccessiblemem_or_argmemonly nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@nocaptureLaunder +; CGSCC-SAME: (i8* nocapture nofree [[P:%.*]]) #[[ATTR10:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[B:%.*]] = call i8* @llvm.launder.invariant.group.p0i8(i8* nofree [[P]]) #[[ATTR22:[0-9]+]] +; CGSCC-NEXT: store i8 42, i8* [[B]], align 1 +; CGSCC-NEXT: ret void ; entry: %b = call i8* @llvm.launder.invariant.group.p0i8(i8* %p) @@ -631,19 +607,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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@captureLaunder +; MODULE-SAME: (i8* nofree [[P:%.*]]) #[[ATTR5]] { +; MODULE-NEXT: [[B:%.*]] = call i8* @llvm.launder.invariant.group.p0i8(i8* nofree [[P]]) #[[ATTR19]] +; MODULE-NEXT: store i8* [[B]], i8** @g2, align 8 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@captureLaunder +; CGSCC-SAME: (i8* nofree [[P:%.*]]) #[[ATTR11:[0-9]+]] { +; CGSCC-NEXT: [[B:%.*]] = call i8* @llvm.launder.invariant.group.p0i8(i8* nofree [[P]]) #[[ATTR22]] +; CGSCC-NEXT: store i8* [[B]], i8** @g2, align 8 +; CGSCC-NEXT: ret void ; %b = call i8* @llvm.launder.invariant.group.p0i8(i8* %p) store i8* %b, i8** @g2 @@ -651,21 +627,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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@nocaptureStrip +; MODULE-SAME: (i8* nocapture nofree writeonly [[P:%.*]]) #[[ATTR11:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[B:%.*]] = call i8* @llvm.strip.invariant.group.p0i8(i8* noalias nofree readnone [[P]]) #[[ATTR20:[0-9]+]] +; MODULE-NEXT: store i8 42, i8* [[B]], align 1 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@nocaptureStrip +; CGSCC-SAME: (i8* nocapture nofree writeonly [[P:%.*]]) #[[ATTR12:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[B:%.*]] = call i8* @llvm.strip.invariant.group.p0i8(i8* noalias nofree readnone [[P]]) #[[ATTR20]] +; CGSCC-NEXT: store i8 42, i8* [[B]], align 1 +; CGSCC-NEXT: ret void ; entry: %b = call i8* @llvm.strip.invariant.group.p0i8(i8* %p) @@ -675,19 +651,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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@captureStrip +; MODULE-SAME: (i8* nofree writeonly [[P:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: [[B:%.*]] = call i8* @llvm.strip.invariant.group.p0i8(i8* noalias nofree readnone [[P]]) #[[ATTR20]] +; MODULE-NEXT: store i8* [[B]], i8** @g3, align 8 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@captureStrip +; CGSCC-SAME: (i8* nofree writeonly [[P:%.*]]) #[[ATTR13:[0-9]+]] { +; CGSCC-NEXT: [[B:%.*]] = call i8* @llvm.strip.invariant.group.p0i8(i8* noalias nofree readnone [[P]]) #[[ATTR20]] +; CGSCC-NEXT: store i8* [[B]], i8** @g3, align 8 +; CGSCC-NEXT: ret void ; %b = call i8* @llvm.strip.invariant.group.p0i8(i8* %p) store i8* %b, i8** @g3 @@ -695,49 +671,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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@captureICmp +; MODULE-SAME: (i32* nofree readnone [[X:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[TMP1:%.*]] = icmp eq i32* [[X]], null +; MODULE-NEXT: ret i1 [[TMP1]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@captureICmp +; CGSCC-SAME: (i32* nofree readnone [[X:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[TMP1:%.*]] = icmp eq i32* [[X]], null +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@captureICmpRev +; MODULE-SAME: (i32* nofree readnone [[X:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[TMP1:%.*]] = icmp eq i32* null, [[X]] +; MODULE-NEXT: ret i1 [[TMP1]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@captureICmpRev +; CGSCC-SAME: (i32* nofree readnone [[X:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[TMP1:%.*]] = icmp eq i32* null, [[X]] +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@nocaptureInboundsGEPICmp +; MODULE-SAME: (i32* nocapture nofree readnone [[X:%.*]]) #[[ATTR0]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@nocaptureInboundsGEPICmp +; CGSCC-SAME: (i32* nocapture nofree readnone [[X:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: ret i1 false ; %1 = getelementptr inbounds i32, i32* %x, i32 5 %2 = bitcast i32* %1 to i8* @@ -746,15 +722,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@nocaptureInboundsGEPICmpRev +; MODULE-SAME: (i32* nocapture nofree readnone [[X:%.*]]) #[[ATTR0]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@nocaptureInboundsGEPICmpRev +; CGSCC-SAME: (i32* nocapture nofree readnone [[X:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: ret i1 true ; %1 = getelementptr inbounds i32, i32* %x, i32 5 %2 = bitcast i32* %1 to i8* @@ -763,19 +739,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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@nocaptureDereferenceableOrNullICmp +; MODULE-SAME: (i32* nocapture nofree readnone dereferenceable_or_null(4) [[X:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[TMP1:%.*]] = bitcast i32* [[X]] to i8* +; MODULE-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP1]], null +; MODULE-NEXT: ret i1 [[TMP2]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@nocaptureDereferenceableOrNullICmp +; CGSCC-SAME: (i32* nocapture nofree readnone dereferenceable_or_null(4) [[X:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[TMP1:%.*]] = bitcast i32* [[X]] to i8* +; CGSCC-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP1]], null +; CGSCC-NEXT: ret i1 [[TMP2]] ; %1 = bitcast i32* %x to i8* %2 = icmp eq i8* %1, null @@ -783,19 +759,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]] +; MODULE: Function Attrs: nofree nosync nounwind null_pointer_is_valid readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@captureDereferenceableOrNullICmp +; MODULE-SAME: (i32* nofree readnone dereferenceable_or_null(4) [[X:%.*]]) #[[ATTR12:[0-9]+]] { +; MODULE-NEXT: [[TMP1:%.*]] = bitcast i32* [[X]] to i8* +; MODULE-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP1]], null +; MODULE-NEXT: ret i1 [[TMP2]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@captureDereferenceableOrNullICmp +; CGSCC-SAME: (i32* nofree readnone dereferenceable_or_null(4) [[X:%.*]]) #[[ATTR14:[0-9]+]] { +; CGSCC-NEXT: [[TMP1:%.*]] = bitcast i32* [[X]] to i8* +; CGSCC-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP1]], null +; CGSCC-NEXT: ret i1 [[TMP2]] ; %1 = bitcast i32* %x to i8* %2 = icmp eq i8* %1, null @@ -848,17 +824,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 +; MODULE: Function Attrs: nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@ptr_uses +; MODULE-SAME: (i8* [[PTR:%.*]], i8* nocapture nofree noundef nonnull writeonly dereferenceable(1) [[WPTR:%.*]]) #[[ATTR14:[0-9]+]] { +; MODULE-NEXT: store i8 0, i8* [[WPTR]], align 1 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@ptr_uses +; CGSCC-SAME: (i8* [[PTR:%.*]], i8* nocapture nofree noundef nonnull writeonly dereferenceable(1) [[WPTR:%.*]]) #[[ATTR16]] { +; CGSCC-NEXT: store i8 0, i8* [[WPTR]], align 1 +; CGSCC-NEXT: ret void ; %call_ptr = call i8* @maybe_returned_ptr(i8* %ptr) %call_val = call i8 @maybe_returned_val(i8* %call_ptr) @@ -870,49 +846,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 } +; MODULE: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR1]] = { nofree nosync nounwind willreturn writeonly } +; MODULE: attributes #[[ATTR2]] = { nofree nosync nounwind readonly willreturn } +; MODULE: attributes #[[ATTR3]] = { readonly } +; MODULE: attributes #[[ATTR4]] = { nounwind readonly } +; MODULE: attributes #[[ATTR5]] = { nofree nosync nounwind willreturn } +; MODULE: attributes #[[ATTR6]] = { argmemonly nounwind } +; MODULE: attributes #[[ATTR7]] = { nofree nosync nounwind writeonly } +; MODULE: attributes #[[ATTR8]] = { nofree noreturn nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR9]] = { argmemonly nofree nounwind willreturn } +; MODULE: attributes #[[ATTR10]] = { inaccessiblemem_or_argmemonly nofree nosync nounwind willreturn } +; MODULE: attributes #[[ATTR11]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; MODULE: attributes #[[ATTR12]] = { nofree nosync nounwind null_pointer_is_valid readnone willreturn } +; MODULE: attributes #[[ATTR13:[0-9]+]] = { nounwind readonly willreturn } +; MODULE: attributes #[[ATTR14]] = { nounwind willreturn } +; MODULE: attributes #[[ATTR15:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind speculatable willreturn } +; MODULE: attributes #[[ATTR16:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } +; MODULE: attributes #[[ATTR17]] = { nofree nounwind readnone willreturn } +; MODULE: attributes #[[ATTR18]] = { nounwind } +; MODULE: attributes #[[ATTR19]] = { willreturn } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind willreturn writeonly } +; CGSCC: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readonly willreturn } +; CGSCC: attributes #[[ATTR3]] = { readonly } +; CGSCC: attributes #[[ATTR4]] = { nounwind readonly } +; CGSCC: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR6]] = { argmemonly nounwind } +; CGSCC: attributes #[[ATTR7]] = { nofree nosync nounwind writeonly } +; CGSCC: attributes #[[ATTR8]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR9]] = { argmemonly nofree norecurse nounwind willreturn } +; CGSCC: attributes #[[ATTR10]] = { inaccessiblemem_or_argmemonly nofree nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR11]] = { nofree nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR12]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; CGSCC: attributes #[[ATTR13]] = { nofree nosync nounwind willreturn writeonly } +; CGSCC: attributes #[[ATTR14]] = { nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn } +; CGSCC: attributes #[[ATTR15:[0-9]+]] = { nounwind readonly willreturn } +; CGSCC: attributes #[[ATTR16]] = { nounwind willreturn } +; CGSCC: attributes #[[ATTR17:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind speculatable willreturn } +; CGSCC: attributes #[[ATTR18:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } +; CGSCC: attributes #[[ATTR19]] = { nounwind willreturn writeonly } +; CGSCC: attributes #[[ATTR20]] = { readnone willreturn } +; CGSCC: attributes #[[ATTR21]] = { nounwind } +; CGSCC: 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,38 +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=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 -; +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; Test cases specifically designed for the "no-capture" argument attribute. ; We use FIXME's to indicate problems and missing attributes. -; target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" declare i32* @unknown() ; TEST comparison against NULL -; ; int is_null_return(int *p) { ; return p == 0; ; } -; ; 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]] +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@is_null_return +; MODULE-SAME: (i32* nofree readnone [[P:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[CMP:%.*]] = icmp eq i32* [[P]], null +; MODULE-NEXT: [[CONV:%.*]] = zext i1 [[CMP]] to i32 +; MODULE-NEXT: ret i32 [[CONV]] +; +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@is_null_return +; CGSCC-SAME: (i32* nofree readnone [[P:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[CMP:%.*]] = icmp eq i32* [[P]], null +; CGSCC-NEXT: [[CONV:%.*]] = zext i1 [[CMP]] to i32 +; CGSCC-NEXT: ret i32 [[CONV]] ; entry: %cmp = icmp eq i32* %p, null @@ -41,7 +35,6 @@ } ; TEST comparison against NULL in control flow -; ; int is_null_control(int *p) { ; if (p == 0) ; return 1; @@ -49,54 +42,53 @@ ; return 1; ; return 0; ; } -; ; 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]] +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@is_null_control +; MODULE-SAME: (i32* nofree [[P:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[RETVAL:%.*]] = alloca i32, align 4 +; MODULE-NEXT: [[CMP:%.*]] = icmp eq i32* [[P]], null +; MODULE-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; MODULE: if.then: +; MODULE-NEXT: store i32 1, i32* [[RETVAL]], align 4 +; MODULE-NEXT: br label [[RETURN:%.*]] +; MODULE: if.end: +; MODULE-NEXT: [[CMP1:%.*]] = icmp eq i32* null, [[P]] +; MODULE-NEXT: br i1 [[CMP1]], label [[IF_THEN2:%.*]], label [[IF_END3:%.*]] +; MODULE: if.then2: +; MODULE-NEXT: store i32 1, i32* [[RETVAL]], align 4 +; MODULE-NEXT: br label [[RETURN]] +; MODULE: if.end3: +; MODULE-NEXT: store i32 0, i32* [[RETVAL]], align 4 +; MODULE-NEXT: br label [[RETURN]] +; MODULE: return: +; MODULE-NEXT: [[TMP0:%.*]] = load i32, i32* [[RETVAL]], align 4 +; MODULE-NEXT: ret i32 [[TMP0]] +; +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@is_null_control +; CGSCC-SAME: (i32* nofree [[P:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[RETVAL:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: [[CMP:%.*]] = icmp eq i32* [[P]], null +; CGSCC-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; CGSCC: if.then: +; CGSCC-NEXT: store i32 1, i32* [[RETVAL]], align 4 +; CGSCC-NEXT: br label [[RETURN:%.*]] +; CGSCC: if.end: +; CGSCC-NEXT: [[CMP1:%.*]] = icmp eq i32* null, [[P]] +; CGSCC-NEXT: br i1 [[CMP1]], label [[IF_THEN2:%.*]], label [[IF_END3:%.*]] +; CGSCC: if.then2: +; CGSCC-NEXT: store i32 1, i32* [[RETVAL]], align 4 +; CGSCC-NEXT: br label [[RETURN]] +; CGSCC: if.end3: +; CGSCC-NEXT: store i32 0, i32* [[RETVAL]], align 4 +; CGSCC-NEXT: br label [[RETURN]] +; CGSCC: return: +; CGSCC-NEXT: [[TMP0:%.*]] = load i32, i32* [[RETVAL]], align 4 +; CGSCC-NEXT: ret i32 [[TMP0]] ; entry: %retval = alloca i32, align 4 @@ -125,24 +117,22 @@ } ; TEST singleton SCC -; ; double *srec0(double *a) { ; srec0(a); ; return 0; ; } -; 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 +; MODULE: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@srec0 +; MODULE-SAME: (double* nocapture nofree readnone [[A:%.*]]) #[[ATTR1:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: unreachable +; +; CGSCC: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@srec0 +; CGSCC-SAME: (double* nocapture nofree readnone [[A:%.*]]) #[[ATTR1:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: unreachable ; entry: %call = call double* @srec0(double* %a) @@ -150,7 +140,6 @@ } ; TEST singleton SCC with lots of nested recursive calls -; ; int* srec16(int* a) { ; return srec16(srec16(srec16(srec16( ; srec16(srec16(srec16(srec16( @@ -159,21 +148,19 @@ ; a ; )))))))))))))))); ; } -; ; 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 +; MODULE: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@srec16 +; MODULE-SAME: (i32* nocapture nofree readnone [[A:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: unreachable +; +; CGSCC: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@srec16 +; CGSCC-SAME: (i32* nocapture nofree readnone [[A:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: unreachable ; entry: %call = call i32* @srec16(i32* %a) @@ -196,15 +183,12 @@ } ; TEST SCC with various calls, casts, and comparisons agains NULL -; ; float *scc_A(int *a) { ; return (float*)(a ? (int*)scc_A((int*)scc_B((double*)scc_C((short*)a))) : a); ; } -; ; long *scc_B(double *a) { ; return (long*)(a ? scc_C((short*)scc_B((double*)scc_A((int*)a))) : a); ; } -; ; void *scc_C(short *a) { ; return scc_A((int*)(scc_A(a) ? scc_B((double*)a) : scc_C(a))); ; } @@ -353,12 +337,10 @@ ; TEST call to external function, marked no-capture -; ; void external_no_capture(int /* no-capture */ *p); ; void test_external_no_capture(int *p) { ; external_no_capture(p); ; } -; declare void @external_no_capture(i32* nocapture) define void @test_external_no_capture(i32* %p) #0 { @@ -375,11 +357,9 @@ } ; TEST call to external var-args function, marked no-capture -; ; void test_var_arg_call(char *p, int a) { ; printf(p, a); ; } -; define void @test_var_arg_call(i8* %p, i32 %a) #0 { ; CHECK: Function Attrs: noinline nounwind uwtable ; CHECK-LABEL: define {{[^@]+}}@test_var_arg_call @@ -397,27 +377,25 @@ ; TEST "captured" only through return -; ; long *not_captured_but_returned_0(long *a) { ; *a1 = 0; ; return a; ; } -; ; 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]] +; MODULE: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@not_captured_but_returned_0 +; MODULE-SAME: (i64* nofree noundef nonnull returned writeonly align 8 dereferenceable(8) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR4:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: store i64 0, i64* [[A]], align 8 +; MODULE-NEXT: ret i64* [[A]] +; +; CGSCC: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@not_captured_but_returned_0 +; CGSCC-SAME: (i64* nofree noundef nonnull returned writeonly align 8 dereferenceable(8) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR4:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: store i64 0, i64* [[A]], align 8 +; CGSCC-NEXT: ret i64* [[A]] ; entry: store i64 0, i64* %a, align 8 @@ -425,29 +403,27 @@ } ; TEST "captured" only through return -; ; long *not_captured_but_returned_1(long *a) { ; *(a+1) = 1; ; return a + 1; ; } -; ; 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]] +; MODULE: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@not_captured_but_returned_1 +; MODULE-SAME: (i64* nofree nonnull writeonly align 8 dereferenceable(16) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR4]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i64, i64* [[A]], i64 1 +; MODULE-NEXT: store i64 1, i64* [[ADD_PTR]], align 8 +; MODULE-NEXT: ret i64* [[ADD_PTR]] +; +; CGSCC: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@not_captured_but_returned_1 +; CGSCC-SAME: (i64* nofree nonnull writeonly align 8 dereferenceable(16) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i64, i64* [[A]], i64 1 +; CGSCC-NEXT: store i64 1, i64* [[ADD_PTR]], align 8 +; CGSCC-NEXT: ret i64* [[ADD_PTR]] ; entry: %add.ptr = getelementptr inbounds i64, i64* %a, i64 1 @@ -456,28 +432,26 @@ } ; TEST calls to "captured" only through return functions -; ; void test_not_captured_but_returned_calls(long *a) { ; not_captured_but_returned_0(a); ; not_captured_but_returned_1(a); ; } -; 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 +; MODULE: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@test_not_captured_but_returned_calls +; MODULE-SAME: (i64* nocapture nofree writeonly align 8 [[A:%.*]]) #[[ATTR4]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) #[[ATTR9:[0-9]+]] +; MODULE-NEXT: [[CALL1:%.*]] = call i64* @not_captured_but_returned_1(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) #[[ATTR9]] +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@test_not_captured_but_returned_calls +; CGSCC-SAME: (i64* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(16) [[A:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: entry: +; 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]+]] +; 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]] +; CGSCC-NEXT: ret void ; entry: %call = call i64* @not_captured_but_returned_0(i64* %a) @@ -486,26 +460,24 @@ } ; TEST "captured" only through transitive return -; ; long* negative_test_not_captured_but_returned_call_0a(long *a) { ; return not_captured_but_returned_0(a); ; } -; ; 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]] +; MODULE: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_0a +; MODULE-SAME: (i64* nofree returned writeonly align 8 "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR4]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) #[[ATTR9]] +; MODULE-NEXT: ret i64* [[A]] +; +; CGSCC: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_0a +; CGSCC-SAME: (i64* nofree noundef nonnull returned writeonly align 8 dereferenceable(8) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: entry: +; 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]] +; CGSCC-NEXT: ret i64* [[A]] ; entry: %call = call i64* @not_captured_but_returned_0(i64* %a) @@ -513,30 +485,28 @@ } ; TEST captured through write -; ; void negative_test_not_captured_but_returned_call_0b(long *a) { ; *a = (long)not_captured_but_returned_0(a); ; } -; ; 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 +; MODULE: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_0b +; MODULE-SAME: (i64* nofree writeonly align 8 [[A:%.*]]) #[[ATTR4]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) #[[ATTR9]] +; MODULE-NEXT: [[TMP0:%.*]] = ptrtoint i64* [[A]] to i64 +; MODULE-NEXT: store i64 [[TMP0]], i64* [[A]], align 8 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_0b +; CGSCC-SAME: (i64* nofree noundef nonnull writeonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: entry: +; 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]] +; CGSCC-NEXT: [[TMP0:%.*]] = ptrtoint i64* [[A]] to i64 +; CGSCC-NEXT: store i64 [[TMP0]], i64* [[A]], align 8 +; CGSCC-NEXT: ret void ; entry: %call = call i64* @not_captured_but_returned_0(i64* %a) @@ -546,26 +516,24 @@ } ; TEST "captured" only through transitive return -; ; long* negative_test_not_captured_but_returned_call_1a(long *a) { ; return not_captured_but_returned_1(a); ; } -; ; 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]] +; MODULE: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_1a +; MODULE-SAME: (i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR4]] { +; MODULE-NEXT: entry: +; MODULE-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]] +; MODULE-NEXT: ret i64* [[CALL]] +; +; CGSCC: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_1a +; CGSCC-SAME: (i64* nofree noundef nonnull writeonly align 8 dereferenceable(16) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: entry: +; 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]] +; CGSCC-NEXT: ret i64* [[CALL]] ; entry: %call = call i64* @not_captured_but_returned_1(i64* %a) @@ -573,30 +541,28 @@ } ; TEST captured through write -; ; void negative_test_not_captured_but_returned_call_1b(long *a) { ; *a = (long)not_captured_but_returned_1(a); ; } -; ; 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 +; MODULE: Function Attrs: nofree noinline nosync nounwind uwtable willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_1b +; MODULE-SAME: (i64* nofree writeonly align 8 [[A:%.*]]) #[[ATTR5:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[CALL:%.*]] = call align 8 i64* @not_captured_but_returned_1(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) #[[ATTR9]] +; MODULE-NEXT: [[TMP0:%.*]] = ptrtoint i64* [[CALL]] to i64 +; MODULE-NEXT: store i64 [[TMP0]], i64* [[CALL]], align 8 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind uwtable willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_1b +; CGSCC-SAME: (i64* nofree noundef nonnull writeonly align 8 dereferenceable(16) [[A:%.*]]) #[[ATTR5:[0-9]+]] { +; CGSCC-NEXT: entry: +; 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]] +; CGSCC-NEXT: [[TMP0:%.*]] = ptrtoint i64* [[CALL]] to i64 +; CGSCC-NEXT: store i64 [[TMP0]], i64* [[CALL]], align 8 +; CGSCC-NEXT: ret void ; entry: %call = call i64* @not_captured_but_returned_1(i64* %a) @@ -606,15 +572,12 @@ } ; TEST return argument or unknown call result -; ; int* ret_arg_or_unknown(int* b) { ; if (b == 0) ; return b; ; return unknown(); ; } -; ; Verify we do *not* assume b is returned or not captured. -; define i32* @ret_arg_or_unknown(i32* %b) #0 { ; CHECK: Function Attrs: noinline nounwind uwtable @@ -675,7 +638,6 @@ ; TEST not captured by readonly external function -; declare i32* @readonly_unknown(i32*, i32*) readonly define void @not_captured_by_readonly_call(i32* %b) #0 { @@ -693,9 +655,7 @@ ; TEST not captured by readonly external function if return chain is known -; ; Make sure the returned flag on %r is strong enough to justify nocapture on %b but **not** on %r. -; define i32* @not_captured_by_readonly_call_not_returned_either1(i32* %b, i32* returned %r) { ; CHECK: Function Attrs: nounwind readonly ; CHECK-LABEL: define {{[^@]+}}@not_captured_by_readonly_call_not_returned_either1 @@ -783,25 +743,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 } +; MODULE: attributes #[[ATTR0]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; MODULE: attributes #[[ATTR1]] = { nofree noinline noreturn nosync nounwind readnone uwtable willreturn } +; MODULE: attributes #[[ATTR2]] = { nofree nosync nounwind readnone } +; MODULE: attributes #[[ATTR3]] = { noinline nounwind uwtable } +; MODULE: attributes #[[ATTR4]] = { argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly } +; MODULE: attributes #[[ATTR5]] = { nofree noinline nosync nounwind uwtable willreturn writeonly } +; MODULE: attributes #[[ATTR6]] = { readonly } +; MODULE: attributes #[[ATTR7]] = { noinline nounwind readonly uwtable } +; MODULE: attributes #[[ATTR8]] = { nounwind readonly } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } +; CGSCC: attributes #[[ATTR1]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn } +; CGSCC: attributes #[[ATTR2]] = { nofree nosync nounwind readnone } +; CGSCC: attributes #[[ATTR3]] = { noinline nounwind uwtable } +; CGSCC: attributes #[[ATTR4]] = { argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly } +; CGSCC: attributes #[[ATTR5]] = { nofree noinline norecurse nosync nounwind uwtable willreturn writeonly } +; CGSCC: attributes #[[ATTR6]] = { readonly } +; CGSCC: attributes #[[ATTR7]] = { noinline nounwind readonly uwtable } +; CGSCC: attributes #[[ATTR8]] = { nounwind readonly } +; CGSCC: 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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC %"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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@f1 +; MODULE-SAME: () #[[ATTR0:[0-9]+]] align 2 { +; MODULE-NEXT: entry: +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@f1 +; CGSCC-SAME: () #[[ATTR0:[0-9]+]] align 2 { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[REF_TMP:%.*]] = alloca [[A:%.*]], align 8 +; CGSCC-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@f2 +; CGSCC-SAME: () #[[ATTR0]] align 2 { +; CGSCC-NEXT: entry: +; CGSCC-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@f3 +; CGSCC-SAME: () #[[ATTR0]] align 2 { +; CGSCC-NEXT: entry: +; CGSCC-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@f4 +; CGSCC-SAME: () #[[ATTR0]] align 2 { +; CGSCC-NEXT: entry: +; CGSCC-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@f5 +; CGSCC-SAME: () #[[ATTR0]] align 2 { +; CGSCC-NEXT: entry: +; CGSCC-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 } +; MODULE: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: 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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC 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 +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@only_return +; MODULE-SAME: () #[[ATTR3:[0-9]+]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@only_return +; CGSCC-SAME: () #[[ATTR3:[0-9]+]] { +; CGSCC-NEXT: ret void ; ret void } @@ -111,30 +109,30 @@ define void @mutual_recursion1() #0 { -; NOT_CGSCC_NPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@mutual_recursion1 -; NOT_CGSCC_NPM-SAME: () #[[ATTR4:[0-9]+]] { -; NOT_CGSCC_NPM-NEXT: unreachable +; MODULE: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@mutual_recursion1 +; MODULE-SAME: () #[[ATTR4:[0-9]+]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@mutual_recursion1 +; CGSCC-SAME: () #[[ATTR4:[0-9]+]] { +; CGSCC-NEXT: unreachable ; call void @mutual_recursion2() ret void } define void @mutual_recursion2() #0 { -; NOT_CGSCC_NPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@mutual_recursion2 -; NOT_CGSCC_NPM-SAME: () #[[ATTR4]] { -; NOT_CGSCC_NPM-NEXT: unreachable +; MODULE: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@mutual_recursion2 +; MODULE-SAME: () #[[ATTR4]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@mutual_recursion2 +; CGSCC-SAME: () #[[ATTR4]] { +; CGSCC-NEXT: unreachable ; call void @mutual_recursion1() ret void @@ -190,19 +188,18 @@ ; CHECK: Function Attrs: nofree noinline nounwind readnone uwtable -; CHECK-NEXT: declare void @nofree_function() 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 +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@call_nofree_function +; MODULE-SAME: () #[[ATTR3]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@call_nofree_function +; CGSCC-SAME: () #[[ATTR3]] { +; CGSCC-NEXT: ret void ; tail call void @nofree_function() ret void @@ -213,7 +210,6 @@ ; CHECK: Function Attrs: noinline nounwind uwtable -; CHECK-NEXT: declare void @maybe_free() declare void @maybe_free() #0 @@ -248,36 +244,35 @@ ; TEST 10 (positive case) ; Call intrinsic function ; CHECK: Function Attrs: nofree nosync nounwind readnone speculatable willreturn -; CHECK-NEXT: declare float @llvm.floor.f32(float) 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 +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@call_floor +; MODULE-SAME: (float [[A:%.*]]) #[[ATTR3]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@call_floor +; CGSCC-SAME: (float [[A:%.*]]) #[[ATTR3]] { +; CGSCC-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]] +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@call_floor2 +; MODULE-SAME: (float [[A:%.*]]) #[[ATTR3]] { +; MODULE-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) #[[ATTR11:[0-9]+]] +; MODULE-NEXT: ret float [[C]] +; +; CGSCC: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@call_floor2 +; CGSCC-SAME: (float [[A:%.*]]) #[[ATTR7:[0-9]+]] { +; CGSCC-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) #[[ATTR12:[0-9]+]] +; CGSCC-NEXT: ret float [[C]] ; %c = tail call float @llvm.floor.f32(float %a) ret float %c @@ -287,30 +282,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 +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@f1 +; MODULE-SAME: () #[[ATTR3]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@f1 +; CGSCC-SAME: () #[[ATTR3]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@f2 +; MODULE-SAME: () #[[ATTR3]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@f2 +; CGSCC-SAME: () #[[ATTR3]] { +; CGSCC-NEXT: ret void ; tail call void @f1() ret void @@ -318,21 +313,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]] +; MODULE: Function Attrs: nofree nounwind +; MODULE-LABEL: define {{[^@]+}}@test12 +; MODULE-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR7:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[TMP0:%.*]] = load double, double* [[A]], align 8 +; MODULE-NEXT: [[CALL:%.*]] = tail call double @cos(double [[TMP0]]) #[[ATTR2]] +; MODULE-NEXT: ret double [[CALL]] +; +; CGSCC: Function Attrs: nofree nounwind +; CGSCC-LABEL: define {{[^@]+}}@test12 +; CGSCC-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR8:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[TMP0:%.*]] = load double, double* [[A]], align 8 +; CGSCC-NEXT: [[CALL:%.*]] = tail call double @cos(double [[TMP0]]) #[[ATTR2]] +; CGSCC-NEXT: ret double [[CALL]] ; entry: %0 = load double, double* %a, align 8 @@ -375,35 +370,23 @@ ; UTC_ARGS: --enable define void @nonnull_assume_pos(i8* %arg1, i8* %arg2, i8* %arg3, i8* %arg4) { -; ATTRIBUTOR-LABEL: define {{[^@]+}}@nonnull_assume_pos -; ATTRIBUTOR-SAME: (i8* nofree [[ARG1:%.*]], i8* [[ARG2:%.*]], i8* nofree [[ARG3:%.*]], i8* [[ARG4:%.*]]) -; ATTRIBUTOR-NEXT: call void @llvm.assume(i1 true) #11 [ "nofree"(i8* [[ARG1]]), "nofree"(i8* [[ARG3]]) ] -; 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 -; -; 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 +; MODULE-LABEL: define {{[^@]+}}@nonnull_assume_pos +; MODULE-SAME: (i8* nofree [[ARG1:%.*]], i8* [[ARG2:%.*]], i8* nofree [[ARG3:%.*]], i8* [[ARG4:%.*]]) { +; MODULE-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR12:[0-9]+]] [ "nofree"(i8* [[ARG1]]), "nofree"(i8* [[ARG3]]) ] +; MODULE-NEXT: call void @unknown(i8* nofree [[ARG1]], i8* [[ARG2]], i8* nofree [[ARG3]], i8* [[ARG4]]) +; MODULE-NEXT: ret void +; +; CGSCC-LABEL: define {{[^@]+}}@nonnull_assume_pos +; CGSCC-SAME: (i8* nofree [[ARG1:%.*]], i8* [[ARG2:%.*]], i8* nofree [[ARG3:%.*]], i8* [[ARG4:%.*]]) { +; CGSCC-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR13:[0-9]+]] [ "nofree"(i8* [[ARG1]]), "nofree"(i8* [[ARG3]]) ] +; CGSCC-NEXT: call void @unknown(i8* nofree [[ARG1]], i8* [[ARG2]], i8* nofree [[ARG3]], i8* [[ARG4]]) +; CGSCC-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) ret void } define void @nonnull_assume_neg(i8* %arg1, i8* %arg2, i8* %arg3, i8* %arg4) { -; ATTRIBUTOR-LABEL: define {{[^@]+}}@nonnull_assume_neg -; ATTRIBUTOR-SAME: (i8* [[ARG1:%.*]], i8* [[ARG2:%.*]], i8* [[ARG3:%.*]], i8* [[ARG4:%.*]]) -; ATTRIBUTOR-NEXT: call void @unknown(i8* [[ARG1]], i8* [[ARG2]], i8* [[ARG3]], i8* [[ARG4]]) -; ATTRIBUTOR-NEXT: call void @llvm.assume(i1 true) [ "nofree"(i8* [[ARG1]]), "nofree"(i8* [[ARG3]]) ] -; ATTRIBUTOR-NEXT: ret void -; ; CHECK-LABEL: define {{[^@]+}}@nonnull_assume_neg ; CHECK-SAME: (i8* [[ARG1:%.*]], i8* [[ARG2:%.*]], i8* [[ARG3:%.*]], i8* [[ARG4:%.*]]) { ; CHECK-NEXT: call void @unknown(i8* [[ARG1]], i8* [[ARG2]], i8* [[ARG3]], i8* [[ARG4]]) @@ -415,21 +398,6 @@ ret void } define void @nonnull_assume_call(i8* %arg1, i8* %arg2, i8* %arg3, i8* %arg4) { -; ATTRIBUTOR-LABEL: define {{[^@]+}}@nonnull_assume_call -; ATTRIBUTOR-SAME: (i8* [[ARG1:%.*]], i8* [[ARG2:%.*]], i8* [[ARG3:%.*]], i8* [[ARG4:%.*]]) -; ATTRIBUTOR-NEXT: call void @unknown(i8* [[ARG1]], i8* [[ARG2]], i8* [[ARG3]], i8* [[ARG4]]) -; ATTRIBUTOR-NEXT: call void @use_i8_ptr(i8* noalias readnone [[ARG1]]) -; ATTRIBUTOR-NEXT: call void @use_i8_ptr(i8* noalias readnone [[ARG2]]) -; ATTRIBUTOR-NEXT: call void @llvm.assume(i1 true) [ "nofree"(i8* [[ARG1]]), "nofree"(i8* [[ARG3]]) ] -; ATTRIBUTOR-NEXT: call void @use_i8_ptr(i8* noalias nofree readnone [[ARG3]]) -; ATTRIBUTOR-NEXT: call void @use_i8_ptr(i8* noalias readnone [[ARG4]]) -; ATTRIBUTOR-NEXT: call void @use_i8_ptr_ret(i8* noalias nofree readnone [[ARG1]]) -; ATTRIBUTOR-NEXT: call void @use_i8_ptr_ret(i8* noalias readnone [[ARG2]]) -; ATTRIBUTOR-NEXT: call void @llvm.assume(i1 true) [ "nofree"(i8* [[ARG1]]), "nofree"(i8* [[ARG4]]) ] -; ATTRIBUTOR-NEXT: call void @use_i8_ptr_ret(i8* noalias nofree readnone [[ARG3]]) -; ATTRIBUTOR-NEXT: call void @use_i8_ptr_ret(i8* noalias nofree readnone [[ARG4]]) -; ATTRIBUTOR-NEXT: ret void -; ; CHECK-LABEL: define {{[^@]+}}@nonnull_assume_call ; CHECK-SAME: (i8* [[ARG1:%.*]], i8* [[ARG2:%.*]], i8* [[ARG3:%.*]], i8* [[ARG4:%.*]]) { ; CHECK-NEXT: call void @unknown(i8* [[ARG1]], i8* [[ARG2]], i8* [[ARG3]], i8* [[ARG4]]) @@ -469,47 +437,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 } -;. -; 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 } +; MODULE: attributes #[[ATTR0]] = { nounwind } +; MODULE: attributes #[[ATTR1]] = { noinline nounwind uwtable } +; MODULE: attributes #[[ATTR2]] = { nobuiltin nounwind } +; MODULE: attributes #[[ATTR3]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; MODULE: attributes #[[ATTR4]] = { nofree noinline noreturn nosync nounwind readnone uwtable willreturn } +; MODULE: attributes #[[ATTR5:[0-9]+]] = { nofree noinline nounwind readnone uwtable } +; MODULE: attributes #[[ATTR6:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } +; MODULE: attributes #[[ATTR7]] = { nofree nounwind } +; MODULE: attributes #[[ATTR8:[0-9]+]] = { nobuiltin nofree nounwind } +; MODULE: attributes #[[ATTR9:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } +; MODULE: attributes #[[ATTR10:[0-9]+]] = { nounwind willreturn } +; MODULE: attributes #[[ATTR11]] = { readnone willreturn } +; MODULE: attributes #[[ATTR12]] = { willreturn } ;. -; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nounwind } -; IS__CGSCC_NPM: attributes #[[ATTR1]] = { noinline nounwind uwtable } -; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nobuiltin nounwind } -; IS__CGSCC_NPM: attributes #[[ATTR3]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } -; IS__CGSCC_NPM: attributes #[[ATTR4]] = { 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 } +; CGSCC: attributes #[[ATTR0]] = { nounwind } +; CGSCC: attributes #[[ATTR1]] = { noinline nounwind uwtable } +; CGSCC: attributes #[[ATTR2]] = { nobuiltin nounwind } +; CGSCC: attributes #[[ATTR3]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } +; CGSCC: attributes #[[ATTR4]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn } +; CGSCC: attributes #[[ATTR5:[0-9]+]] = { nofree noinline nounwind readnone uwtable } +; CGSCC: attributes #[[ATTR6:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } +; CGSCC: attributes #[[ATTR7]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; CGSCC: attributes #[[ATTR8]] = { nofree nounwind } +; CGSCC: attributes #[[ATTR9:[0-9]+]] = { nobuiltin nofree nounwind } +; CGSCC: attributes #[[ATTR10:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR11:[0-9]+]] = { nounwind willreturn } +; CGSCC: attributes #[[ATTR12]] = { readnone willreturn } +; CGSCC: 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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" @@ -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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test2 +; MODULE-SAME: (i8* nofree nonnull readnone returned "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1:[0-9]+]] { +; MODULE-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]] +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test2 +; CGSCC-SAME: (i8* nofree nonnull readnone returned "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1:[0-9]+]] { +; CGSCC-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,14 @@ ; 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: @@ -144,30 +111,30 @@ ; nonnull if neither can ever return null. (In this case, they ; just never return period.) define i8* @test4_helper() { -; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test4_helper -; NOT_CGSCC_NPM-SAME: () #[[ATTR2:[0-9]+]] { -; NOT_CGSCC_NPM-NEXT: unreachable +; MODULE: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test4_helper +; MODULE-SAME: () #[[ATTR2:[0-9]+]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test4_helper +; CGSCC-SAME: () #[[ATTR2:[0-9]+]] { +; CGSCC-NEXT: unreachable ; %ret = call i8* @test4() ret i8* %ret } define i8* @test4() { -; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test4 -; NOT_CGSCC_NPM-SAME: () #[[ATTR2]] { -; NOT_CGSCC_NPM-NEXT: unreachable +; MODULE: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test4 +; MODULE-SAME: () #[[ATTR2]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test4 +; CGSCC-SAME: () #[[ATTR2]] { +; CGSCC-NEXT: unreachable ; %ret = call i8* @test4_helper() ret i8* %ret @@ -176,32 +143,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test5_helper +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] +; MODULE: rec: +; MODULE-NEXT: br label [[END]] +; MODULE: end: +; MODULE-NEXT: ret i8* null +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test5_helper +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] +; CGSCC: rec: +; CGSCC-NEXT: br label [[END]] +; CGSCC: end: +; CGSCC-NEXT: ret i8* null ; br i1 %c, label %rec, label %end rec: @@ -212,20 +170,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test5 +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test5 +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: ret i8* null ; %ret = call i8* @test5_helper(i1 %c) ret i8* %ret @@ -233,28 +186,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 +230,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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test7 +; MODULE-SAME: (i8* nofree readnone returned "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { +; MODULE-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]] +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test7 +; CGSCC-SAME: (i8* nofree readnone returned "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test8 +; MODULE-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: [[B:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 1 +; MODULE-NEXT: ret i8* [[B]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test8 +; CGSCC-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: [[B:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 1 +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test9 +; MODULE-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]], i64 [[N:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: [[B:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 [[N]] +; MODULE-NEXT: ret i8* [[B]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test9 +; CGSCC-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]], i64 [[N:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: [[B:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 [[N]] +; CGSCC-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 +339,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() @@ -427,22 +353,13 @@ ret void } define internal void @test13(i8* %a, i8* %b, i8* %c) { -; -; NOT_CGSCC_OPM: Function Attrs: nounwind -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test13 -; NOT_CGSCC_OPM-SAME: (i8* noalias nocapture nofree nonnull readnone [[A:%.*]], i8* noalias nocapture nofree readnone [[B:%.*]], i8* noalias nocapture nofree readnone [[C:%.*]]) #[[ATTR4]] { -; 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 +383,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 +431,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 +445,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) @@ -584,7 +465,6 @@ ; CHECK-NEXT: tail call void @use1(i8* noundef nonnull dereferenceable(4) [[ARG]]) ; CHECK-NEXT: ret void ; - tail call void @use1(i8* dereferenceable(4) %arg) ret void } @@ -600,29 +480,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 @@ -641,36 +509,20 @@ ; fun1(nonnull %a) ; We can say that %a is nonnull define void @f17(i8* %a, i8 %c) { -; -; NOT_CGSCC_OPM: Function Attrs: nounwind willreturn -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@f17 -; NOT_CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]], i8 [[C:%.*]]) #[[ATTR6]] { -; 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 +548,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 +597,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: @@ -847,7 +660,6 @@ ; CHECK-NEXT: call void @use3(i8* nonnull [[C]], i8* nonnull [[A]], i8* nonnull [[B]]) ; CHECK-NEXT: ret void ; - call void @use3nonnull(i8* %b, i8* %c, i8* %a) call void @use3(i8* %c, i8* %a, i8* %b) ret void @@ -862,8 +674,6 @@ ; CHECK-NEXT: call void @use3(i8* [[C]], i8* [[B]], i8* nonnull [[A]]) ; CHECK-NEXT: ret void ; - - call void @use1nonnull(i8* %a) call void @use3(i8* %c, i8* %b, i8* %a) ret void @@ -879,9 +689,6 @@ ; CHECK-NEXT: call void @use1(i8* nonnull [[B]]) ; CHECK-NEXT: ret void ; - - - call void @use2nonnull(i8* %c, i8* %b) call void @use2(i8* %a, i8* %c) call void @use1(i8* %b) @@ -921,7 +728,6 @@ ; CHECK-NEXT: call void @use1nonnull(i8* nonnull [[A]]) ; CHECK-NEXT: ret i8 [[C]] ; - %c = load volatile i8, i8* %b call void @use1nonnull(i8* %a) ret i8 %c @@ -930,20 +736,12 @@ ; 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]] ; - - %ret = call i8 @use1safecall(i8* %a) call void @use1nonnull(i8* %a) ret i8 %ret @@ -954,31 +752,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 +781,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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@gep1 +; MODULE-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 1 +; MODULE-NEXT: ret i32* [[Q]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@gep1 +; CGSCC-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 1 +; CGSCC-NEXT: ret i32* [[Q]] ; %q = getelementptr inbounds i32, i32* %p, i32 1 ret i32* %q @@ -1014,40 +799,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]] +; MODULE: Function Attrs: nofree nosync nounwind null_pointer_is_valid readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@gep1_no_null_opt +; MODULE-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR8:[0-9]+]] { +; MODULE-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 1 +; MODULE-NEXT: ret i32* [[Q]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@gep1_no_null_opt +; CGSCC-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR8:[0-9]+]] { +; CGSCC-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 1 +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@gep2 +; MODULE-SAME: (i32 addrspace(3)* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32 addrspace(3)* [[P]], i32 1 +; MODULE-NEXT: ret i32 addrspace(3)* [[Q]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@gep2 +; CGSCC-SAME: (i32 addrspace(3)* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: [[Q:%.*]] = getelementptr inbounds i32, i32 addrspace(3)* [[P]], i32 1 +; CGSCC-NEXT: ret i32 addrspace(3)* [[Q]] ; %q = getelementptr inbounds i32, i32 addrspace(3)* %p, i32 1 ret i32 addrspace(3)* %q @@ -1055,39 +834,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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@as +; MODULE-SAME: (i32 addrspace(3)* nofree nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { +; MODULE-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]] +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@as +; CGSCC-SAME: (i32 addrspace(3)* nofree nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { +; CGSCC-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@g2 +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-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*) +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@g1 +; MODULE-SAME: () #[[ATTR1]] { +; MODULE-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*) +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@g1 +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-NEXT: ret i32* inttoptr (i64 4 to i32*) ; %c = call i32* @g2() ret i32* %c @@ -1095,17 +874,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 @@ -1113,16 +886,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,70 +897,44 @@ ; 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 } ; 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) @@ -1211,54 +952,21 @@ declare void @h(i32*) willreturn nounwind 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 @@ -1277,60 +985,23 @@ } define i32 @nonnull_exec_ctx_1b(i32* %a, i32 %b) { -; -; IS__TUNIT_OPM: Function Attrs: nounwind -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1b -; IS__TUNIT_OPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[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 @@ -1352,38 +1023,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 @@ -1402,42 +1056,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 +1097,22 @@ 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 +1135,22 @@ ; 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 +1175,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 @@ -1600,26 +1192,12 @@ } define void @nonnull_assume_pos(i8* %arg) { -; ATTRIBUTOR-LABEL: define {{[^@]+}}@nonnull_assume_pos -; ATTRIBUTOR-SAME: (i8* nocapture nofree nonnull readnone [[ARG:%.*]]) -; ATTRIBUTOR-NEXT: call void @llvm.assume(i1 true) #11 [ "nonnull"(i8* [[ARG]]) ] -; ATTRIBUTOR-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[ARG]]) -; 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) @@ -1627,42 +1205,17 @@ ret void } define void @nonnull_assume_neg(i8* %arg) { -; ATTRIBUTOR-LABEL: define {{[^@]+}}@nonnull_assume_neg -; ATTRIBUTOR-SAME: (i8* nocapture nofree readnone [[ARG:%.*]]) -; ATTRIBUTOR-NEXT: [[TMP1:%.*]] = call i8* @unknown() -; ATTRIBUTOR-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[ARG]]) -; ATTRIBUTOR-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(i8* [[ARG]]) ] -; ATTRIBUTOR-NEXT: call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[ARG]]) -; ATTRIBUTOR-NEXT: [[TMP2:%.*]] = call i8* @unknown() -; ATTRIBUTOR-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture nofree nonnull readnone [[ARG]]) -; ATTRIBUTOR-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(i8* [[ARG]]) ] -; ATTRIBUTOR-NEXT: call void @use_i8_ptr_ret(i8* noalias nocapture nofree nonnull readnone [[ARG]]) -; ATTRIBUTOR-NEXT: ret void -; -; -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_assume_neg -; NOT_CGSCC_OPM-SAME: (i8* nocapture nofree readnone [[ARG:%.*]]) { -; NOT_CGSCC_OPM-NEXT: [[TMP1:%.*]] = call i8* @unknown() -; 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 +1231,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*) +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@nonnull_function_ptr_1 +; MODULE-SAME: () #[[ATTR1]] { +; MODULE-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*) +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@nonnull_function_ptr_1 +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-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 +1247,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*) +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@nonnull_function_ptr_2 +; MODULE-SAME: () #[[ATTR1]] { +; MODULE-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*) +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@nonnull_function_ptr_2 +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-NEXT: ret i8* bitcast (i8* ()* @function_decl to i8*) ; %bc = bitcast i8*()* @function_decl to i8* ret i8* %bc @@ -1724,52 +1277,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 } +; MODULE: attributes #[[ATTR0]] = { inaccessiblememonly nofree nosync nounwind willreturn } +; MODULE: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR2]] = { nofree noreturn nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR3]] = { noreturn } +; MODULE: attributes #[[ATTR4]] = { nounwind } +; MODULE: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind readonly } +; MODULE: attributes #[[ATTR6]] = { nounwind willreturn } +; MODULE: attributes #[[ATTR7:[0-9]+]] = { nounwind readonly willreturn } +; MODULE: attributes #[[ATTR8]] = { nofree nosync nounwind null_pointer_is_valid readnone willreturn } +; MODULE: attributes #[[ATTR9]] = { naked } +; MODULE: attributes #[[ATTR10]] = { noinline optnone } +; MODULE: attributes #[[ATTR11]] = { nofree nounwind readonly willreturn } +; MODULE: attributes #[[ATTR12]] = { willreturn } +; MODULE: attributes #[[ATTR13]] = { nofree nosync nounwind readonly } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { inaccessiblememonly nofree nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR2]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR3]] = { noreturn } +; CGSCC: attributes #[[ATTR4]] = { nounwind } +; CGSCC: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind readonly } +; CGSCC: attributes #[[ATTR6]] = { nounwind willreturn } +; CGSCC: attributes #[[ATTR7:[0-9]+]] = { nounwind readonly willreturn } +; CGSCC: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn } +; CGSCC: attributes #[[ATTR9]] = { naked } +; CGSCC: attributes #[[ATTR10]] = { noinline optnone } +; CGSCC: attributes #[[ATTR11]] = { nofree nounwind readonly willreturn } +; CGSCC: attributes #[[ATTR12]] = { willreturn } +; CGSCC: attributes #[[ATTR13]] = { nofree nosync nounwind readonly } +; CGSCC: 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,253 +1,183 @@ ; 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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC 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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@leaf +; MODULE-SAME: () #[[ATTR0:[0-9]+]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@leaf +; CGSCC-SAME: () #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: ret i32 1 ; ret i32 1 } define i32 @self_rec() { -; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@self_rec -; IS__TUNIT____-SAME: () #[[ATTR1:[0-9]+]] { -; IS__TUNIT____-NEXT: unreachable +; MODULE: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@self_rec +; MODULE-SAME: () #[[ATTR1:[0-9]+]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@self_rec +; CGSCC-SAME: () #[[ATTR1:[0-9]+]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@indirect_rec +; MODULE-SAME: () #[[ATTR1]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@indirect_rec +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@indirect_rec2 +; MODULE-SAME: () #[[ATTR1]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@indirect_rec2 +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-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 } ; CHECK: Function Attrs -; CHECK-NEXT: declare i32 @k() 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 } ; CHECK: Function Attrs -; CHECK-NEXT: declare void @llvm.memcpy.p0i8.p0i8.i32 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 +; MODULE: Function Attrs: nosync readnone +; MODULE-LABEL: define {{[^@]+}}@called_by_norecurse +; MODULE-SAME: () #[[ATTR2]] { +; MODULE-NEXT: [[A:%.*]] = call i32 @k() +; MODULE-NEXT: ret i32 undef +; +; CGSCC: Function Attrs: norecurse nosync readnone +; CGSCC-LABEL: define {{[^@]+}}@called_by_norecurse +; CGSCC-SAME: () #[[ATTR6:[0-9]+]] { +; CGSCC-NEXT: [[A:%.*]] = call i32 @k() +; CGSCC-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 +; MODULE: Function Attrs: norecurse nosync readnone +; MODULE-LABEL: define {{[^@]+}}@m +; MODULE-SAME: () #[[ATTR6:[0-9]+]] { +; MODULE-NEXT: [[A:%.*]] = call i32 @called_by_norecurse() #[[ATTR2]] +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: norecurse nosync readnone +; CGSCC-LABEL: define {{[^@]+}}@m +; CGSCC-SAME: () #[[ATTR6]] { +; CGSCC-NEXT: [[A:%.*]] = call i32 @called_by_norecurse() +; CGSCC-NEXT: ret void ; %a = call i32 @called_by_norecurse() ret void } define internal i32 @called_by_norecurse_indirectly() { -; NOT_CGSCC_OPM: Function Attrs: nosync readnone -; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@called_by_norecurse_indirectly -; NOT_CGSCC_OPM-SAME: () #[[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]] +; MODULE: Function Attrs: nosync readnone +; MODULE-LABEL: define {{[^@]+}}@o +; MODULE-SAME: () #[[ATTR2]] { +; MODULE-NEXT: [[A:%.*]] = call i32 @called_by_norecurse_indirectly() #[[ATTR2]] +; MODULE-NEXT: ret i32 [[A]] +; +; CGSCC: Function Attrs: norecurse nosync readnone +; CGSCC-LABEL: define {{[^@]+}}@o +; CGSCC-SAME: () #[[ATTR6]] { +; CGSCC-NEXT: [[A:%.*]] = call i32 @called_by_norecurse_indirectly() +; CGSCC-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]] +; MODULE: Function Attrs: norecurse nosync readnone +; MODULE-LABEL: define {{[^@]+}}@p +; MODULE-SAME: () #[[ATTR6]] { +; MODULE-NEXT: [[A:%.*]] = call i32 @o() #[[ATTR2]] +; MODULE-NEXT: ret i32 [[A]] +; +; CGSCC: Function Attrs: norecurse nosync readnone +; CGSCC-LABEL: define {{[^@]+}}@p +; CGSCC-SAME: () #[[ATTR6]] { +; CGSCC-NEXT: [[A:%.*]] = call i32 @o() +; CGSCC-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 +195,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 +226,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 +239,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@call_unknown_in_dead_block +; MODULE-SAME: () local_unnamed_addr #[[ATTR0]] { +; MODULE-NEXT: ret i32 0 +; MODULE: Dead: +; MODULE-NEXT: unreachable +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@call_unknown_in_dead_block +; CGSCC-SAME: () local_unnamed_addr #[[ATTR0]] { +; CGSCC-NEXT: ret i32 0 +; CGSCC: Dead: +; CGSCC-NEXT: unreachable ; ret i32 0 Dead: @@ -343,40 +260,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 } +; MODULE: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR1]] = { nofree noreturn nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR2]] = { nosync readnone } +; MODULE: attributes #[[ATTR3:[0-9]+]] = { readnone } +; MODULE: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind willreturn } +; MODULE: attributes #[[ATTR5:[0-9]+]] = { argmemonly nofree nounwind willreturn } +; MODULE: attributes #[[ATTR6]] = { norecurse nosync readnone } +; MODULE: attributes #[[ATTR7]] = { nofree nosync nounwind readnone } +; MODULE: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind readnone } +; MODULE: attributes #[[ATTR9]] = { null_pointer_is_valid } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR1]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR2]] = { nosync readnone } +; CGSCC: attributes #[[ATTR3:[0-9]+]] = { readnone } +; CGSCC: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR5:[0-9]+]] = { argmemonly nofree nounwind willreturn } +; CGSCC: attributes #[[ATTR6]] = { norecurse nosync readnone } +; CGSCC: attributes #[[ATTR7]] = { nofree nosync nounwind readnone } +; CGSCC: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind readnone } +; CGSCC: attributes #[[ATTR9]] = { null_pointer_is_valid } +; CGSCC: 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,9 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals -; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM -; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM -; RUN: opt -attributor-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 -; +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; Test cases specifically designed for the "no-return" function attribute. ; We use FIXME's to indicate problems and missing attributes. @@ -11,23 +8,21 @@ ; TEST 1, singleton SCC void return type -; ; void srec0() { ; return srec0(); ; } -; 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 -; -; 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 +; MODULE: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@srec0 +; MODULE-SAME: () #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: unreachable +; +; CGSCC: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@srec0 +; CGSCC-SAME: () #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: unreachable ; entry: call void @srec0() @@ -36,27 +31,25 @@ ; TEST 2: singleton SCC int return type with a lot of recursive calls -; ; int srec16(int a) { ; return srec16(srec16(srec16(srec16(srec16(srec16(srec16(srec16(srec16(srec16(srec16(srec16(srec16(srec16(srec16(srec16(a)))))))))))))))); ; } -; define i32 @srec16(i32 %a) #0 { -; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@srec16 -; IS__TUNIT____-SAME: (i32 [[A:%.*]]) #[[ATTR0]] { -; IS__TUNIT____-NEXT: entry: -; IS__TUNIT____-NEXT: unreachable -; IS__TUNIT____: exit: -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@srec16 -; IS__CGSCC____-SAME: (i32 [[A:%.*]]) #[[ATTR0]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: unreachable -; IS__CGSCC____: exit: -; IS__CGSCC____-NEXT: unreachable +; MODULE: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@srec16 +; MODULE-SAME: (i32 [[A:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: unreachable +; MODULE: exit: +; MODULE-NEXT: unreachable +; +; CGSCC: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@srec16 +; CGSCC-SAME: (i32 [[A:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: unreachable +; CGSCC: exit: +; CGSCC-NEXT: unreachable ; entry: %call = call i32 @srec16(i32 %a) @@ -83,27 +76,25 @@ ; TEST 3: endless loop, no return instruction -; ; int endless_loop(int a) { ; while (1); ; } -; 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]] -; -; 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]] +; MODULE: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable +; MODULE-LABEL: define {{[^@]+}}@endless_loop +; MODULE-SAME: (i32 [[A:%.*]]) #[[ATTR1:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: br label [[WHILE_BODY:%.*]] +; MODULE: while.body: +; MODULE-NEXT: br label [[WHILE_BODY]] +; +; CGSCC: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable +; CGSCC-LABEL: define {{[^@]+}}@endless_loop +; CGSCC-SAME: (i32 [[A:%.*]]) #[[ATTR1:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br label [[WHILE_BODY:%.*]] +; CGSCC: while.body: +; CGSCC-NEXT: br label [[WHILE_BODY]] ; entry: br label %while.body @@ -114,33 +105,31 @@ ; TEST 4: endless loop, dead return instruction -; ; int endless_loop(int a) { ; while (1); ; return a; ; } -; ; 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 -; -; 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 +; MODULE: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable +; MODULE-LABEL: define {{[^@]+}}@dead_return +; MODULE-SAME: (i32 [[A:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: br label [[WHILE_BODY:%.*]] +; MODULE: while.body: +; MODULE-NEXT: br label [[WHILE_BODY]] +; MODULE: return: +; MODULE-NEXT: unreachable +; +; CGSCC: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable +; CGSCC-LABEL: define {{[^@]+}}@dead_return +; CGSCC-SAME: (i32 [[A:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br label [[WHILE_BODY:%.*]] +; CGSCC: while.body: +; CGSCC-NEXT: br label [[WHILE_BODY]] +; CGSCC: return: +; CGSCC-NEXT: unreachable ; entry: br label %while.body @@ -154,37 +143,35 @@ ; TEST 5: all paths contain a no-return function call -; ; int multiple_noreturn_calls(int a) { ; return a == 0 ? endless_loop(a) : srec16(a); ; } -; 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 -; -; 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 +; MODULE: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@multiple_noreturn_calls +; MODULE-SAME: (i32 [[A:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[CMP:%.*]] = icmp eq i32 [[A]], 0 +; MODULE-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] +; MODULE: cond.true: +; MODULE-NEXT: unreachable +; MODULE: cond.false: +; MODULE-NEXT: unreachable +; MODULE: cond.end: +; MODULE-NEXT: unreachable +; +; CGSCC: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@multiple_noreturn_calls +; CGSCC-SAME: (i32 [[A:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[CMP:%.*]] = icmp eq i32 [[A]], 0 +; CGSCC-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] +; CGSCC: cond.true: +; CGSCC-NEXT: unreachable +; CGSCC: cond.false: +; CGSCC-NEXT: unreachable +; CGSCC: cond.end: +; CGSCC-NEXT: unreachable ; entry: %cmp = icmp eq i32 %a, 0 @@ -208,21 +195,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]] -; -; 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]] +; MODULE: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@endless_loop_but_willreturn +; MODULE-SAME: () #[[ATTR2:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: br label [[WHILE_BODY:%.*]] +; MODULE: while.body: +; MODULE-NEXT: br label [[WHILE_BODY]] +; +; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@endless_loop_but_willreturn +; CGSCC-SAME: () #[[ATTR2:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br label [[WHILE_BODY:%.*]] +; CGSCC: while.body: +; CGSCC-NEXT: br label [[WHILE_BODY]] ; entry: br label %while.body @@ -233,17 +220,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 -; -; 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 +; MODULE: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@UB_and_willreturn +; MODULE-SAME: () #[[ATTR2]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: unreachable +; +; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@UB_and_willreturn +; CGSCC-SAME: () #[[ATTR2]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: unreachable ; entry: unreachable @@ -251,11 +238,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 } +; MODULE: attributes #[[ATTR0]] = { nofree noinline noreturn nosync nounwind readnone uwtable willreturn } +; MODULE: attributes #[[ATTR1]] = { nofree noinline noreturn nosync nounwind readnone uwtable } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn } +; CGSCC: attributes #[[ATTR1]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable } +; CGSCC: attributes #[[ATTR2]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/noreturn_async.ll b/llvm/test/Transforms/Attributor/noreturn_async.ll --- a/llvm/test/Transforms/Attributor/noreturn_async.ll +++ b/llvm/test/Transforms/Attributor/noreturn_async.ll @@ -1,17 +1,12 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals ; RUN: opt -attributor -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s -; ; This file is the same as noreturn_sync.ll but with a personality which ; indicates that the exception handler *can* catch asynchronous exceptions. As ; a consequence, invokes to noreturn and nounwind functions are not translated ; to calls followed by an unreachable but the unwind edge is considered live. -; ; https://reviews.llvm.org/D59978#inline-586873 -; ; Make sure we handle invoke of a noreturn function correctly. -; ; This test is also a reminder of how we handle (=ignore) stackoverflow exception handling. -; target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-windows-msvc19.16.27032" @@ -24,11 +19,6 @@ define dso_local void @"?overflow@@YAXXZ"() { entry: ; CHECK: Function Attrs: nofree noreturn nosync nounwind -; CHECK-NEXT: define -; CHECK-NEXT: entry: -; CHECK-NEXT: {{.*}}@printf{{.*}} -; CHECK-NEXT: call void @"?overflow@@YAXXZ"() -; CHECK-NEXT: unreachable %call2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @"??_C@_0BC@NKPAGFFJ@Exception?5caught?6?$AA@", i64 0, i64 0)) nofree nosync nounwind call void @"?overflow@@YAXXZ"() %call3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @"??_C@_0BC@NKPAGFFJ@Exception?5caught?6?$AA@", i64 0, i64 0)) @@ -39,7 +29,6 @@ ; CHECK-NOT: nounwind ; CHECK-NOT: noreturn ; CHECK: define -; CHECK-SAME: @"?catchoverflow@@YAHXZ"() define dso_local i32 @"?catchoverflow@@YAHXZ"() personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) { entry: %retval = alloca i32, align 4 @@ -51,7 +40,6 @@ invoke.cont: ; preds = %entry ; CHECK: invoke.cont: -; CHECK-NEXT: unreachable br label %invoke.cont1 catch.dispatch: ; preds = %invoke.cont, %entry @@ -84,11 +72,6 @@ entry: ; CHECK: Function Attrs: noreturn ; CHECK-NOT: nounwind -; CHECK-NEXT: define -; CHECK-NEXT: entry: -; CHECK-NEXT: %call3 = call i32 (i8*, ...) @printf(i8* noundef nonnull dereferenceable(18) getelementptr inbounds ([18 x i8], [18 x i8]* @"??_C@_0BC@NKPAGFFJ@Exception?5caught?6?$AA@", i32 0, i32 0)) -; CHECK-NEXT: call void @"?overflow@@YAXXZ_may_throw"() -; CHECK-NEXT: unreachable %call3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @"??_C@_0BC@NKPAGFFJ@Exception?5caught?6?$AA@", i64 0, i64 0)) call void @"?overflow@@YAXXZ_may_throw"() ret void @@ -98,7 +81,6 @@ ; CHECK-NOT: nounwind ; CHECK-NOT: noreturn ; CHECK: define -; CHECK-SAME: @"?catchoverflow@@YAHXZ_may_throw"() define dso_local i32 @"?catchoverflow@@YAHXZ_may_throw"() personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) { entry: %retval = alloca i32, align 4 @@ -110,7 +92,6 @@ invoke.cont: ; preds = %entry ; CHECK: invoke.cont: -; CHECK-NEXT: unreachable br label %invoke.cont1 catch.dispatch: ; preds = %invoke.cont, %entry diff --git a/llvm/test/Transforms/Attributor/noreturn_sync.ll b/llvm/test/Transforms/Attributor/noreturn_sync.ll --- a/llvm/test/Transforms/Attributor/noreturn_sync.ll +++ b/llvm/test/Transforms/Attributor/noreturn_sync.ll @@ -1,17 +1,12 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals ; RUN: opt -attributor -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=4 -S < %s | FileCheck %s -; ; This file is the same as noreturn_async.ll but with a personality which ; indicates that the exception handler *cannot* catch asynchronous exceptions. ; As a consequence, invokes to noreturn and nounwind functions are translated ; to calls followed by an unreachable. -; ; https://reviews.llvm.org/D59978#inline-586873 -; ; Make sure we handle invoke of a noreturn function correctly. -; ; This test is also a reminder of how we handle (=ignore) stackoverflow exception handling. -; target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @@ -24,11 +19,6 @@ define dso_local void @"?overflow@@YAXXZ"() { entry: ; CHECK: Function Attrs: nofree noreturn nosync nounwind -; CHECK-NEXT: define -; CHECK-NEXT: entry: -; CHECK-NEXT: {{.*}}@printf{{.*}} -; CHECK-NEXT: call void @"?overflow@@YAXXZ"() -; CHECK-NEXT: unreachable %call2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @"??_C@_0BC@NKPAGFFJ@Exception?5caught?6?$AA@", i64 0, i64 0)) nofree nosync nounwind call void @"?overflow@@YAXXZ"() %call3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @"??_C@_0BC@NKPAGFFJ@Exception?5caught?6?$AA@", i64 0, i64 0)) @@ -37,7 +27,6 @@ ; CHECK: Function Attrs: nofree noreturn nosync nounwind -; CHECK-NEXT: @"?catchoverflow@@YAHXZ"() define dso_local i32 @"?catchoverflow@@YAHXZ"() personality i8* bitcast (i32 (...)* @__gcc_personality_v0 to i8*) { entry: %retval = alloca i32, align 4 @@ -45,7 +34,6 @@ invoke void @"?overflow@@YAXXZ"() to label %invoke.cont unwind label %catch.dispatch ; CHECK: call void @"?overflow@@YAXXZ"() -; CHECK-NEXT: unreachable invoke.cont: ; preds = %entry br label %invoke.cont1 @@ -80,11 +68,6 @@ entry: ; CHECK: Function Attrs: noreturn ; CHECK-NOT: nounwind -; CHECK-NEXT: define -; CHECK-NEXT: entry: -; CHECK-NEXT: %call3 = call i32 (i8*, ...) @printf(i8* noundef nonnull dereferenceable(18) getelementptr inbounds ([18 x i8], [18 x i8]* @"??_C@_0BC@NKPAGFFJ@Exception?5caught?6?$AA@", i32 0, i32 0)) -; CHECK-NEXT: call void @"?overflow@@YAXXZ_may_throw"() -; CHECK-NEXT: unreachable %call3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @"??_C@_0BC@NKPAGFFJ@Exception?5caught?6?$AA@", i64 0, i64 0)) call void @"?overflow@@YAXXZ_may_throw"() ret void @@ -94,7 +77,6 @@ ; CHECK-NOT: nounwind ; CHECK-NOT: noreturn ; CHECK: define -; CHECK-SAME: @"?catchoverflow@@YAHXZ_may_throw"() define dso_local i32 @"?catchoverflow@@YAHXZ_may_throw"() personality i8* bitcast (i32 (...)* @__gcc_personality_v0 to i8*) { entry: %retval = alloca i32, align 4 @@ -106,7 +88,6 @@ invoke.cont: ; preds = %entry ; CHECK: invoke.cont: -; CHECK-NEXT: unreachable br label %invoke.cont1 catch.dispatch: ; preds = %invoke.cont, %entry 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,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 -; 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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" ; Test cases designed for the nosync function attribute. @@ -18,7 +16,6 @@ ; double Y; ; struct RT Z; ; }; -; ; int *foo(struct ST *s) { ; return &s[1].Z.B[5][13]; ; } @@ -32,19 +29,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]] +; MODULE: Function Attrs: nofree nosync nounwind optsize readnone ssp uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@foo +; MODULE-SAME: (%struct.ST* nofree readnone "no-capture-maybe-returned" [[S:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [[STRUCT_ST:%.*]], %struct.ST* [[S]], i64 1, i32 2, i32 1, i64 5, i64 13 +; MODULE-NEXT: ret i32* [[ARRAYIDX]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind optsize readnone ssp uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@foo +; CGSCC-SAME: (%struct.ST* nofree readnone "no-capture-maybe-returned" [[S:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [[STRUCT_ST:%.*]], %struct.ST* [[S]], i64 1, i32 2, i32 1, i64 5, i64 13 +; CGSCC-NEXT: ret i32* [[ARRAYIDX]] ; entry: %arrayidx = getelementptr inbounds %struct.ST, %struct.ST* %s, i64 1, i32 2, i32 1, i64 5, i64 13 @@ -173,7 +170,6 @@ ; TEST 9 ; CHECK: Function Attrs: noinline nosync nounwind uwtable -; CHECK-NEXT: declare void @nosync_function() declare void @nosync_function() noinline nounwind uwtable nosync define void @call_nosync_function() nounwind uwtable noinline { @@ -190,7 +186,6 @@ ; TEST 10 - negative, should not deduce nosync ; CHECK: Function Attrs: noinline nounwind uwtable -; CHECK-NEXT: declare void @might_sync() declare void @might_sync() noinline nounwind uwtable define void @call_might_sync() nounwind uwtable noinline { @@ -208,15 +203,15 @@ ; volatile operation in same scc but dead. Call volatile_load defined in TEST 8. define i32 @scc1(i32* %0) noinline nounwind uwtable { -; NOT_CGSCC_NPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@scc1 -; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]]) #[[ATTR5:[0-9]+]] { -; NOT_CGSCC_NPM-NEXT: unreachable +; MODULE: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@scc1 +; MODULE-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]]) #[[ATTR5:[0-9]+]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@scc1 +; CGSCC-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]]) #[[ATTR5:[0-9]+]] { +; CGSCC-NEXT: unreachable ; tail call void @scc2(i32* %0); %val = tail call i32 @volatile_load(i32* %0); @@ -224,32 +219,29 @@ } define void @scc2(i32* %0) noinline nounwind uwtable { -; NOT_CGSCC_NPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@scc2 -; NOT_CGSCC_NPM-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]]) #[[ATTR5]] { -; NOT_CGSCC_NPM-NEXT: unreachable +; MODULE: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@scc2 +; MODULE-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]]) #[[ATTR5]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@scc2 +; CGSCC-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]]) #[[ATTR5]] { +; CGSCC-NEXT: unreachable ; tail call i32 @scc1(i32* %0); ret void; } ; TEST 12 - fences, negative -; ; void foo1(int *a, std::atomic flag){ ; *a = 100; ; atomic_thread_fence(std::memory_order_release); ; flag.store(true, std::memory_order_relaxed); ; } -; ; void bar(int *a, std::atomic flag){ ; while(!flag.load(std::memory_order_relaxed)) ; ; -; ; atomic_thread_fence(std::memory_order_acquire); ; int b = *a; ; } @@ -258,23 +250,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 +; MODULE: Function Attrs: nofree nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@foo1 +; MODULE-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]+]] { +; MODULE-NEXT: store i32 100, i32* [[TMP0]], align 4 +; MODULE-NEXT: fence release +; MODULE-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 +; MODULE-NEXT: store atomic i8 1, i8* [[TMP3]] monotonic, align 1 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@foo1 +; 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]+]] { +; CGSCC-NEXT: store i32 100, i32* [[TMP0]], align 4 +; CGSCC-NEXT: fence release +; CGSCC-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 +; CGSCC-NEXT: store atomic i8 1, i8* [[TMP3]] monotonic, align 1 +; CGSCC-NEXT: ret void ; store i32 100, i32* %0, align 4 fence release @@ -284,33 +276,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 +; MODULE: Function Attrs: nofree nounwind +; MODULE-LABEL: define {{[^@]+}}@bar +; MODULE-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull readonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR7:[0-9]+]] { +; MODULE-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 +; MODULE-NEXT: br label [[TMP4:%.*]] +; MODULE: 4: +; MODULE-NEXT: [[TMP5:%.*]] = load atomic i8, i8* [[TMP3]] monotonic, align 1 +; MODULE-NEXT: [[TMP6:%.*]] = and i8 [[TMP5]], 1 +; MODULE-NEXT: [[TMP7:%.*]] = icmp eq i8 [[TMP6]], 0 +; MODULE-NEXT: br i1 [[TMP7]], label [[TMP4]], label [[TMP8:%.*]] +; MODULE: 8: +; MODULE-NEXT: fence acquire +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nounwind +; CGSCC-LABEL: define {{[^@]+}}@bar +; CGSCC-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull readonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR7:[0-9]+]] { +; CGSCC-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 +; CGSCC-NEXT: br label [[TMP4:%.*]] +; CGSCC: 4: +; CGSCC-NEXT: [[TMP5:%.*]] = load atomic i8, i8* [[TMP3]] monotonic, align 1 +; CGSCC-NEXT: [[TMP6:%.*]] = and i8 [[TMP5]], 1 +; CGSCC-NEXT: [[TMP7:%.*]] = icmp eq i8 [[TMP6]], 0 +; CGSCC-NEXT: br i1 [[TMP7]], label [[TMP4]], label [[TMP8:%.*]] +; CGSCC: 8: +; CGSCC-NEXT: fence acquire +; CGSCC-NEXT: ret void ; %3 = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* %1, i64 0, i32 0, i32 0 br label %4 @@ -328,23 +320,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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@foo1_singlethread +; MODULE-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]+]] { +; MODULE-NEXT: store i32 100, i32* [[TMP0]], align 4 +; MODULE-NEXT: fence syncscope("singlethread") release +; MODULE-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 +; MODULE-NEXT: store atomic i8 1, i8* [[TMP3]] monotonic, align 1 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@foo1_singlethread +; 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]+]] { +; CGSCC-NEXT: store i32 100, i32* [[TMP0]], align 4 +; CGSCC-NEXT: fence syncscope("singlethread") release +; CGSCC-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 +; CGSCC-NEXT: store atomic i8 1, i8* [[TMP3]] monotonic, align 1 +; CGSCC-NEXT: ret void ; store i32 100, i32* %0, align 4 fence syncscope("singlethread") release @@ -354,33 +346,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 +; MODULE: Function Attrs: nofree nosync nounwind +; MODULE-LABEL: define {{[^@]+}}@bar_singlethread +; MODULE-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull readonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR9:[0-9]+]] { +; MODULE-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 +; MODULE-NEXT: br label [[TMP4:%.*]] +; MODULE: 4: +; MODULE-NEXT: [[TMP5:%.*]] = load atomic i8, i8* [[TMP3]] monotonic, align 1 +; MODULE-NEXT: [[TMP6:%.*]] = and i8 [[TMP5]], 1 +; MODULE-NEXT: [[TMP7:%.*]] = icmp eq i8 [[TMP6]], 0 +; MODULE-NEXT: br i1 [[TMP7]], label [[TMP4]], label [[TMP8:%.*]] +; MODULE: 8: +; MODULE-NEXT: fence syncscope("singlethread") acquire +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind +; CGSCC-LABEL: define {{[^@]+}}@bar_singlethread +; CGSCC-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull readonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR9:[0-9]+]] { +; CGSCC-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 +; CGSCC-NEXT: br label [[TMP4:%.*]] +; CGSCC: 4: +; CGSCC-NEXT: [[TMP5:%.*]] = load atomic i8, i8* [[TMP3]] monotonic, align 1 +; CGSCC-NEXT: [[TMP6:%.*]] = and i8 [[TMP5]], 1 +; CGSCC-NEXT: [[TMP7:%.*]] = icmp eq i8 [[TMP6]], 0 +; CGSCC-NEXT: br i1 [[TMP7]], label [[TMP4]], label [[TMP8:%.*]] +; CGSCC: 8: +; CGSCC-NEXT: fence syncscope("singlethread") acquire +; CGSCC-NEXT: ret void ; %3 = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* %1, i64 0, i32 0, i32 0 br label %4 @@ -402,19 +394,18 @@ ; TEST 14 - negative, checking volatile intrinsics. ; 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 +; MODULE: Function Attrs: argmemonly nofree nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@memcpy_volatile +; MODULE-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8* nocapture nofree readonly [[PTR2:%.*]]) #[[ATTR10:[0-9]+]] { +; MODULE-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]+]] +; MODULE-NEXT: ret i32 4 +; +; CGSCC: Function Attrs: argmemonly nofree nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@memcpy_volatile +; CGSCC-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8* nocapture nofree readonly [[PTR2:%.*]]) #[[ATTR10:[0-9]+]] { +; 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]+]] +; CGSCC-NEXT: ret i32 4 ; call void @llvm.memcpy(i8* %ptr1, i8* %ptr2, i32 8, i1 1) ret i32 4 @@ -423,19 +414,18 @@ ; TEST 15 - positive, non-volatile intrinsic. ; 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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@memset_non_volatile +; MODULE-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8 [[VAL:%.*]]) #[[ATTR11:[0-9]+]] { +; MODULE-NEXT: call void @llvm.memset.p0i8.i32(i8* nocapture nofree writeonly [[PTR1]], i8 [[VAL]], i32 noundef 8, i1 noundef false) #[[ATTR19:[0-9]+]] +; MODULE-NEXT: ret i32 4 +; +; CGSCC: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@memset_non_volatile +; CGSCC-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8 [[VAL:%.*]]) #[[ATTR11:[0-9]+]] { +; CGSCC-NEXT: call void @llvm.memset.p0i8.i32(i8* nocapture nofree writeonly [[PTR1]], i8 [[VAL]], i32 noundef 8, i1 noundef false) #[[ATTR20:[0-9]+]] +; CGSCC-NEXT: ret i32 4 ; call void @llvm.memset(i8* %ptr1, i8 %val, i32 8, i1 0) ret i32 4 @@ -468,7 +458,6 @@ } ; CHECK: Function Attrs: nounwind -; CHECK-NEXT: declare void @llvm.x86.sse2.clflush(i8*) declare void @llvm.x86.sse2.clflush(i8*) @a = common global i32 0, align 4 @@ -490,102 +479,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@cos_test +; MODULE-SAME: (float [[X:%.*]]) #[[ATTR15:[0-9]+]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@cos_test +; CGSCC-SAME: (float [[X:%.*]]) #[[ATTR15:[0-9]+]] { +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@cos_test2 +; MODULE-SAME: (float [[X:%.*]]) #[[ATTR15]] { +; MODULE-NEXT: [[C:%.*]] = call float @llvm.cos.f32(float [[X]]) #[[ATTR20:[0-9]+]] +; MODULE-NEXT: ret float [[C]] +; +; CGSCC: Function Attrs: nofree nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@cos_test2 +; CGSCC-SAME: (float [[X:%.*]]) #[[ATTR16:[0-9]+]] { +; CGSCC-NEXT: [[C:%.*]] = call float @llvm.cos.f32(float [[X]]) #[[ATTR21:[0-9]+]] +; CGSCC-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 } -;. -; 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 } +; MODULE: attributes #[[ATTR0]] = { nofree nosync nounwind optsize readnone ssp uwtable willreturn } +; MODULE: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind uwtable willreturn } +; MODULE: attributes #[[ATTR2]] = { argmemonly nofree norecurse nounwind uwtable willreturn } +; MODULE: attributes #[[ATTR3]] = { noinline nosync nounwind uwtable } +; MODULE: attributes #[[ATTR4]] = { noinline nounwind uwtable } +; MODULE: attributes #[[ATTR5]] = { nofree noinline noreturn nosync nounwind readnone uwtable willreturn } +; MODULE: attributes #[[ATTR6]] = { nofree nounwind willreturn } +; MODULE: attributes #[[ATTR7]] = { nofree nounwind } +; MODULE: attributes #[[ATTR8]] = { nofree nosync nounwind willreturn } +; MODULE: attributes #[[ATTR9]] = { nofree nosync nounwind } +; MODULE: attributes #[[ATTR10]] = { argmemonly nofree nounwind willreturn } +; MODULE: attributes #[[ATTR11]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; MODULE: attributes #[[ATTR12:[0-9]+]] = { convergent readnone } +; MODULE: attributes #[[ATTR13]] = { readnone } +; MODULE: attributes #[[ATTR14]] = { nounwind } +; MODULE: attributes #[[ATTR15]] = { nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR16:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } +; MODULE: attributes #[[ATTR17:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } +; MODULE: attributes #[[ATTR18]] = { willreturn } +; MODULE: attributes #[[ATTR19]] = { willreturn writeonly } +; MODULE: attributes #[[ATTR20]] = { 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 } +; CGSCC: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind optsize readnone ssp uwtable willreturn } +; CGSCC: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind uwtable willreturn } +; CGSCC: attributes #[[ATTR2]] = { argmemonly nofree norecurse nounwind uwtable willreturn } +; CGSCC: attributes #[[ATTR3]] = { noinline nosync nounwind uwtable } +; CGSCC: attributes #[[ATTR4]] = { noinline nounwind uwtable } +; CGSCC: attributes #[[ATTR5]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn } +; CGSCC: attributes #[[ATTR6]] = { nofree norecurse nounwind willreturn } +; CGSCC: attributes #[[ATTR7]] = { nofree norecurse nounwind } +; CGSCC: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind } +; CGSCC: attributes #[[ATTR10]] = { argmemonly nofree nounwind willreturn } +; CGSCC: attributes #[[ATTR11]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; CGSCC: attributes #[[ATTR12:[0-9]+]] = { convergent readnone } +; CGSCC: attributes #[[ATTR13]] = { readnone } +; CGSCC: attributes #[[ATTR14]] = { nounwind } +; CGSCC: attributes #[[ATTR15]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR16]] = { nofree nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR17:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly } +; CGSCC: attributes #[[ATTR18:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } +; CGSCC: attributes #[[ATTR19]] = { willreturn } +; CGSCC: attributes #[[ATTR20]] = { willreturn writeonly } +; CGSCC: 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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC 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 +; MODULE-LABEL: define {{[^@]+}}@callback_caller() { +; MODULE-NEXT: call void @callback_broker(void (i8*)* noundef @argument_dead_callback_callee, i8* noalias nocapture nofree readnone align 4294967296 undef) +; MODULE-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 +; CGSCC-LABEL: define {{[^@]+}}@callback_caller() { +; CGSCC-NEXT: call void @callback_broker(void (i8*)* noundef @argument_dead_callback_callee, i8* noalias nocapture nofree noundef readnone align 4294967296 null) +; CGSCC-NEXT: ret void ; call void @callback_broker(void (i8*)* @argument_dead_callback_callee, i8* null) ret void @@ -87,7 +85,6 @@ } define internal void @callee_with_dead_arg(i1 %create, ...) { -; ; CHECK-LABEL: define {{[^@]+}}@callee_with_dead_arg ; CHECK-SAME: (i1 [[CREATE:%.*]], ...) { ; CHECK-NEXT: entry: @@ -114,7 +111,6 @@ ; try to come up with a different scheme to verify the `noundef` is dropped if ; signature rewriting is not happening. define void @caller_with_noundef_arg() { -; ; CHECK-LABEL: define {{[^@]+}}@caller_with_noundef_arg() { ; CHECK-NEXT: call void (i1, ...) @callee_with_dead_arg(i1 undef) ; CHECK-NEXT: ret void diff --git a/llvm/test/Transforms/Attributor/nounwind.ll b/llvm/test/Transforms/Attributor/nounwind.ll --- a/llvm/test/Transforms/Attributor/nounwind.ll +++ b/llvm/test/Transforms/Attributor/nounwind.ll @@ -1,35 +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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; 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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@foo1 +; MODULE-SAME: () #[[ATTR0:[0-9]+]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@foo1 +; CGSCC-SAME: () #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: ret i32 1 ; ret i32 1 } ; TEST 2 define i32 @scc1_foo() { -; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@scc1_foo -; NOT_CGSCC_NPM-SAME: () #[[ATTR1:[0-9]+]] { -; NOT_CGSCC_NPM-NEXT: unreachable +; MODULE: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@scc1_foo +; MODULE-SAME: () #[[ATTR1:[0-9]+]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@scc1_foo +; CGSCC-SAME: () #[[ATTR1:[0-9]+]] { +; CGSCC-NEXT: unreachable ; %1 = call i32 @scc1_bar() ret i32 1 @@ -38,15 +36,15 @@ ; TEST 3 define i32 @scc1_bar() { -; NOT_CGSCC_NPM: Function Attrs: nofree noreturn nosync nounwind readnone willreturn -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@scc1_bar -; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] { -; NOT_CGSCC_NPM-NEXT: unreachable +; MODULE: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@scc1_bar +; MODULE-SAME: () #[[ATTR1]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@scc1_bar +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-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 } +; MODULE: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: 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,35 +1,31 @@ ; 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 -; +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; Test for multiple potential values -; ; potential-test 1 ; bool iszero(int c) { return c == 0; } ; 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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@iszero1 +; CGSCC-SAME: () #[[ATTR0:[0-9]+]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@potential_test1 +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@potential_test1 +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: ret i1 false ; %arg = select i1 %c, i32 -1, i32 1 %ret = call i1 @iszero1(i32 %arg) @@ -38,18 +34,16 @@ ; potential-test 2 -; ; potential values of argument of iszero are {1,-1} ; potential value of returned value of iszero is 0 -; ; int call_with_two_values(int x) { return iszero(x) + iszero(-x); } ; 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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@iszero2 +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: ret i32 undef ; %cmp = icmp eq i32 %c, 0 %ret = zext i1 %cmp to i32 @@ -57,10 +51,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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@call_with_two_values +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: ret i32 undef ; %csret1 = call i32 @iszero2(i32 %c) %minusc = sub i32 0, %c @@ -70,15 +64,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@potential_test2 +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@potential_test2 +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: ret i32 0 ; %csret1 = call i32 @call_with_two_values(i32 1) %csret2 = call i32 @call_with_two_values(i32 -1) @@ -88,22 +82,20 @@ ; potential-test 3 -; ; potential values of returned value of f are {0,1} ; potential values of argument of g are {0,1} ; potential value of returned value of g is 1 ; then returned value of g can be simplified -; ; int zero_or_one(int c) { return c < 2; } ; 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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@iszero3 +; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[CMP:%.*]] = icmp eq i32 undef, 0 +; CGSCC-NEXT: [[RET:%.*]] = zext i1 undef to i32 +; CGSCC-NEXT: ret i32 undef ; %cmp = icmp eq i32 %c, 0 %ret = zext i1 %cmp to i32 @@ -111,12 +103,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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@less_than_two +; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[CMP:%.*]] = icmp slt i32 undef, 2 +; CGSCC-NEXT: [[RET:%.*]] = zext i1 true to i32 +; CGSCC-NEXT: ret i32 undef ; %cmp = icmp slt i32 %c, 2 %ret = zext i1 %cmp to i32 @@ -124,15 +116,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@potential_test3 +; MODULE-SAME: () #[[ATTR0]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@potential_test3 +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: ret i32 2 ; %cmp1 = call i32 @iszero3(i32 0) %true1 = call i32 @less_than_two(i32 %cmp1) @@ -144,25 +136,23 @@ ; potential-test 4,5 -; ; simplified ; int potential_test4(int c) { return return1or3(c) == 2; } ; int potential_test5(int c) { return return1or3(c) == return2or4(c); } -; ; not simplified ; int potential_test6(int c) { return return1or3(c) == 3; } ; 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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@potential_test4 +; MODULE-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@potential_test4 +; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: ret i32 0 ; %csret = call i32 @return1or3(i32 %c) %false = icmp eq i32 %csret, 2 @@ -171,15 +161,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@potential_test5 +; MODULE-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@potential_test5 +; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: ret i32 0 ; %csret1 = call i32 @return1or3(i32 %c) %csret2 = call i32 @return2or4(i32 %c) @@ -189,26 +179,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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@potential_test6 +; MODULE-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) #[[ATTR0]], !range [[RNG0:![0-9]+]] +; MODULE-NEXT: [[RET:%.*]] = icmp eq i32 [[CSRET1]], 3 +; MODULE-NEXT: ret i1 [[RET]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@potential_test6 +; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) #[[ATTR1:[0-9]+]], !range [[RNG0:![0-9]+]] +; CGSCC-NEXT: [[RET:%.*]] = icmp eq i32 [[CSRET1]], 3 +; CGSCC-NEXT: ret i1 [[RET]] ; %csret1 = call i32 @return1or3(i32 %c) %ret = icmp eq i32 %csret1, 3 @@ -216,29 +199,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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@potential_test7 +; MODULE-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) #[[ATTR0]], !range [[RNG0]] +; MODULE-NEXT: [[CSRET2:%.*]] = call i32 @return3or4(i32 [[C]]) #[[ATTR0]], !range [[RNG1:![0-9]+]] +; MODULE-NEXT: [[RET:%.*]] = icmp eq i32 [[CSRET1]], [[CSRET2]] +; MODULE-NEXT: ret i1 [[RET]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@potential_test7 +; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[CSRET1:%.*]] = call i32 @return1or3(i32 [[C]]) #[[ATTR1]], !range [[RNG0]] +; CGSCC-NEXT: [[CSRET2:%.*]] = call i32 @return3or4(i32 [[C]]) #[[ATTR1]], !range [[RNG1:![0-9]+]] +; CGSCC-NEXT: [[RET:%.*]] = icmp eq i32 [[CSRET1]], [[CSRET2]] +; CGSCC-NEXT: ret i1 [[RET]] ; %csret1 = call i32 @return1or3(i32 %c) %csret2 = call i32 @return3or4(i32 %c) @@ -247,19 +222,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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@return1or3 +; MODULE-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[CMP:%.*]] = icmp eq i32 [[C]], 0 +; MODULE-NEXT: [[RET:%.*]] = select i1 [[CMP]], i32 1, i32 3 +; MODULE-NEXT: ret i32 [[RET]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@return1or3 +; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[CMP:%.*]] = icmp eq i32 [[C]], 0 +; CGSCC-NEXT: [[RET:%.*]] = select i1 [[CMP]], i32 1, i32 3 +; CGSCC-NEXT: ret i32 [[RET]] ; %cmp = icmp eq i32 %c, 0 %ret = select i1 %cmp, i32 1, i32 3 @@ -267,12 +242,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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@return2or4 +; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[CMP:%.*]] = icmp eq i32 undef, 0 +; CGSCC-NEXT: [[RET:%.*]] = select i1 undef, i32 2, i32 4 +; CGSCC-NEXT: ret i32 undef ; %cmp = icmp eq i32 %c, 0 %ret = select i1 %cmp, i32 2, i32 4 @@ -280,19 +255,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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@return3or4 +; MODULE-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[CMP:%.*]] = icmp eq i32 [[C]], 0 +; MODULE-NEXT: [[RET:%.*]] = select i1 [[CMP]], i32 3, i32 4 +; MODULE-NEXT: ret i32 [[RET]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@return3or4 +; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[CMP:%.*]] = icmp eq i32 [[C]], 0 +; CGSCC-NEXT: [[RET:%.*]] = select i1 [[CMP]], i32 3, i32 4 +; CGSCC-NEXT: ret i32 [[RET]] ; %cmp = icmp eq i32 %c, 0 %ret = select i1 %cmp, i32 3, i32 4 @@ -300,39 +275,38 @@ } ; potential-test 8 -; ; 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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@cmp_with_four +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@wrapper +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@potential_test8 +; MODULE-SAME: () #[[ATTR0]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@potential_test8 +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: ret i1 false ; %res1 = call i1 @wrapper(i32 1) %res3 = call i1 @wrapper(i32 3) @@ -343,81 +317,43 @@ } define i1 @potential_test9() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@potential_test9 -; IS__TUNIT_OPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: br label [[COND:%.*]] -; IS__TUNIT_OPM: cond: -; IS__TUNIT_OPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_1:%.*]], [[INC:%.*]] ] -; IS__TUNIT_OPM-NEXT: [[C_0:%.*]] = phi i32 [ 1, [[ENTRY]] ], [ [[C_1:%.*]], [[INC]] ] -; IS__TUNIT_OPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 10 -; IS__TUNIT_OPM-NEXT: br i1 [[CMP]], label [[BODY:%.*]], label [[END:%.*]] -; IS__TUNIT_OPM: body: -; IS__TUNIT_OPM-NEXT: [[C_1]] = mul i32 [[C_0]], -1 -; IS__TUNIT_OPM-NEXT: br label [[INC]] -; IS__TUNIT_OPM: inc: -; IS__TUNIT_OPM-NEXT: [[I_1]] = add i32 [[I_0]], 1 -; IS__TUNIT_OPM-NEXT: br label [[COND]] -; IS__TUNIT_OPM: end: -; IS__TUNIT_OPM-NEXT: ret i1 false -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@potential_test9 -; IS__TUNIT_NPM-SAME: () #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: br label [[COND:%.*]] -; IS__TUNIT_NPM: cond: -; IS__TUNIT_NPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_1:%.*]], [[INC:%.*]] ] -; IS__TUNIT_NPM-NEXT: [[C_0:%.*]] = phi i32 [ 1, [[ENTRY]] ], [ [[C_1:%.*]], [[INC]] ] -; IS__TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 10 -; IS__TUNIT_NPM-NEXT: br i1 [[CMP]], label [[BODY:%.*]], label [[END:%.*]] -; IS__TUNIT_NPM: body: -; IS__TUNIT_NPM-NEXT: [[C_1]] = mul i32 [[C_0]], -1 -; IS__TUNIT_NPM-NEXT: br label [[INC]] -; IS__TUNIT_NPM: inc: -; IS__TUNIT_NPM-NEXT: [[I_1]] = add i32 [[I_0]], 1 -; IS__TUNIT_NPM-NEXT: br label [[COND]] -; IS__TUNIT_NPM: end: -; IS__TUNIT_NPM-NEXT: ret i1 false -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@potential_test9 -; IS__CGSCC_OPM-SAME: () #[[ATTR1:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[COND:%.*]] -; IS__CGSCC_OPM: cond: -; IS__CGSCC_OPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_1:%.*]], [[INC:%.*]] ] -; IS__CGSCC_OPM-NEXT: [[C_0:%.*]] = phi i32 [ 1, [[ENTRY]] ], [ [[C_1:%.*]], [[INC]] ] -; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 10 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[BODY:%.*]], label [[END:%.*]] -; IS__CGSCC_OPM: body: -; IS__CGSCC_OPM-NEXT: [[C_1]] = mul i32 [[C_0]], -1 -; IS__CGSCC_OPM-NEXT: br label [[INC]] -; IS__CGSCC_OPM: inc: -; IS__CGSCC_OPM-NEXT: [[I_1]] = add i32 [[I_0]], 1 -; IS__CGSCC_OPM-NEXT: br label [[COND]] -; IS__CGSCC_OPM: end: -; IS__CGSCC_OPM-NEXT: ret i1 false -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@potential_test9 -; IS__CGSCC_NPM-SAME: () #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[COND:%.*]] -; IS__CGSCC_NPM: cond: -; IS__CGSCC_NPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_1:%.*]], [[INC:%.*]] ] -; IS__CGSCC_NPM-NEXT: [[C_0:%.*]] = phi i32 [ 1, [[ENTRY]] ], [ [[C_1:%.*]], [[INC]] ] -; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 10 -; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[BODY:%.*]], label [[END:%.*]] -; IS__CGSCC_NPM: body: -; IS__CGSCC_NPM-NEXT: [[C_1]] = mul i32 [[C_0]], -1 -; IS__CGSCC_NPM-NEXT: br label [[INC]] -; IS__CGSCC_NPM: inc: -; IS__CGSCC_NPM-NEXT: [[I_1]] = add i32 [[I_0]], 1 -; IS__CGSCC_NPM-NEXT: br label [[COND]] -; IS__CGSCC_NPM: end: -; IS__CGSCC_NPM-NEXT: ret i1 false +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@potential_test9 +; MODULE-SAME: () #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: br label [[COND:%.*]] +; MODULE: cond: +; MODULE-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_1:%.*]], [[INC:%.*]] ] +; MODULE-NEXT: [[C_0:%.*]] = phi i32 [ 1, [[ENTRY]] ], [ [[C_1:%.*]], [[INC]] ] +; MODULE-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 10 +; MODULE-NEXT: br i1 [[CMP]], label [[BODY:%.*]], label [[END:%.*]] +; MODULE: body: +; MODULE-NEXT: [[C_1]] = mul i32 [[C_0]], -1 +; MODULE-NEXT: br label [[INC]] +; MODULE: inc: +; MODULE-NEXT: [[I_1]] = add i32 [[I_0]], 1 +; MODULE-NEXT: br label [[COND]] +; MODULE: end: +; MODULE-NEXT: ret i1 false +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@potential_test9 +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br label [[COND:%.*]] +; CGSCC: cond: +; CGSCC-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_1:%.*]], [[INC:%.*]] ] +; CGSCC-NEXT: [[C_0:%.*]] = phi i32 [ 1, [[ENTRY]] ], [ [[C_1:%.*]], [[INC]] ] +; CGSCC-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 10 +; CGSCC-NEXT: br i1 [[CMP]], label [[BODY:%.*]], label [[END:%.*]] +; CGSCC: body: +; CGSCC-NEXT: [[C_1]] = mul i32 [[C_0]], -1 +; CGSCC-NEXT: br label [[INC]] +; CGSCC: inc: +; CGSCC-NEXT: [[I_1]] = add i32 [[I_0]], 1 +; CGSCC-NEXT: br label [[COND]] +; CGSCC: end: +; CGSCC-NEXT: ret i1 false ; entry: br label %cond @@ -442,19 +378,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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@may_return_undef +; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: switch i32 [[C]], label [[OTHERWISE:%.*]] [ +; CGSCC-NEXT: i32 1, label [[A:%.*]] +; CGSCC-NEXT: i32 -1, label [[B:%.*]] +; CGSCC-NEXT: ] +; CGSCC: a: +; CGSCC-NEXT: ret i32 undef +; CGSCC: b: +; CGSCC-NEXT: ret i32 undef +; CGSCC: otherwise: +; CGSCC-NEXT: ret i32 undef ; switch i32 %c, label %otherwise [i32 1, label %a i32 -1, label %b] @@ -467,16 +403,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@potential_test10 +; MODULE-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@potential_test10 +; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[CMP:%.*]] = icmp eq i32 undef, 0 +; CGSCC-NEXT: ret i1 false ; %ret = call i32 @may_return_undef(i32 %c) %cmp = icmp eq i32 %ret, 0 @@ -484,23 +420,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@optimize_undef_1 +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; MODULE: t: +; MODULE-NEXT: ret i32 0 +; MODULE: f: +; MODULE-NEXT: ret i32 1 +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@optimize_undef_1 +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; CGSCC: t: +; CGSCC-NEXT: ret i32 0 +; CGSCC: f: +; CGSCC-NEXT: ret i32 1 ; br i1 %c, label %t, label %f t: @@ -511,23 +447,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@optimize_undef_2 +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; MODULE: t: +; MODULE-NEXT: ret i32 0 +; MODULE: f: +; MODULE-NEXT: ret i32 -1 +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@optimize_undef_2 +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; CGSCC: t: +; CGSCC-NEXT: ret i32 0 +; CGSCC: f: +; CGSCC-NEXT: ret i32 -1 ; br i1 %c, label %t, label %f t: @@ -538,23 +474,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@optimize_undef_3 +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; MODULE: t: +; MODULE-NEXT: ret i32 0 +; MODULE: f: +; MODULE-NEXT: ret i32 1 +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@optimize_undef_3 +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; CGSCC: t: +; CGSCC-NEXT: ret i32 0 +; CGSCC: f: +; CGSCC-NEXT: ret i32 1 ; br i1 %c, label %t, label %f t: @@ -568,35 +504,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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@potential_test11 +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[ZERO1:%.*]] = call i32 @optimize_undef_1(i1 [[C]]) #[[ATTR0]], !range [[RNG2:![0-9]+]] +; MODULE-NEXT: [[ZERO2:%.*]] = call i32 @optimize_undef_2(i1 [[C]]) #[[ATTR0]], !range [[RNG3:![0-9]+]] +; MODULE-NEXT: [[ZERO3:%.*]] = call i32 @optimize_undef_3(i1 [[C]]) #[[ATTR0]], !range [[RNG2]] +; MODULE-NEXT: [[ACC1:%.*]] = add i32 [[ZERO1]], [[ZERO2]] +; MODULE-NEXT: [[ACC2:%.*]] = add i32 [[ACC1]], [[ZERO3]] +; MODULE-NEXT: ret i32 [[ACC2]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@potential_test11 +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[ZERO1:%.*]] = call i32 @optimize_undef_1(i1 [[C]]) #[[ATTR1]], !range [[RNG2:![0-9]+]] +; CGSCC-NEXT: [[ZERO2:%.*]] = call i32 @optimize_undef_2(i1 [[C]]) #[[ATTR1]], !range [[RNG3:![0-9]+]] +; CGSCC-NEXT: [[ZERO3:%.*]] = call i32 @optimize_undef_3(i1 [[C]]) #[[ATTR1]], !range [[RNG2]] +; CGSCC-NEXT: [[ACC1:%.*]] = add i32 [[ZERO1]], [[ZERO2]] +; CGSCC-NEXT: [[ACC2:%.*]] = add i32 [[ACC1]], [[ZERO3]] +; CGSCC-NEXT: ret i32 [[ACC2]] ; %zero1 = call i32 @optimize_undef_1(i1 %c) %zero2 = call i32 @optimize_undef_2(i1 %c) @@ -607,41 +533,23 @@ } define i32 @optimize_poison_1(i1 %c) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@optimize_poison_1 -; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT_OPM: t: -; IS__TUNIT_OPM-NEXT: ret i32 0 -; IS__TUNIT_OPM: f: -; IS__TUNIT_OPM-NEXT: ret i32 -1 -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@optimize_poison_1 -; IS__TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__TUNIT_NPM: t: -; IS__TUNIT_NPM-NEXT: ret i32 0 -; IS__TUNIT_NPM: f: -; IS__TUNIT_NPM-NEXT: ret i32 undef -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@optimize_poison_1 -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC_OPM: t: -; IS__CGSCC_OPM-NEXT: ret i32 0 -; IS__CGSCC_OPM: f: -; IS__CGSCC_OPM-NEXT: ret i32 -1 -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@optimize_poison_1 -; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; IS__CGSCC_NPM: t: -; IS__CGSCC_NPM-NEXT: ret i32 0 -; IS__CGSCC_NPM: f: -; IS__CGSCC_NPM-NEXT: ret i32 undef +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@optimize_poison_1 +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; MODULE: t: +; MODULE-NEXT: ret i32 0 +; MODULE: f: +; MODULE-NEXT: ret i32 undef +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@optimize_poison_1 +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; CGSCC: t: +; CGSCC-NEXT: ret i32 0 +; CGSCC: f: +; CGSCC-NEXT: ret i32 undef ; br i1 %c, label %t, label %f t: @@ -653,27 +561,15 @@ ; FIXME: returned value can be simplified to 0 define i32 @potential_test12(i1 %c) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn -; 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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@potential_test12 +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: ret i32 0 +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@potential_test12 +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: ret i32 0 ; %zero = call i32 @optimize_poison_1(i1 %c) ret i32 %zero @@ -685,111 +581,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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@potential_test13_callee +; MODULE-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[RET:%.*]] = and i32 [[C]], 3 +; MODULE-NEXT: ret i32 [[RET]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@potential_test13_callee +; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[RET:%.*]] = and i32 [[C]], 3 +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@potential_test13_caller1 +; MODULE-SAME: () #[[ATTR0]] { +; MODULE-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 noundef 0) #[[ATTR0]], !range [[RNG2]] +; MODULE-NEXT: ret i32 [[RET]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@potential_test13_caller1 +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 noundef 0) #[[ATTR1]], !range [[RNG2]] +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@potential_test13_caller2 +; MODULE-SAME: () #[[ATTR0]] { +; MODULE-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 noundef 1) #[[ATTR0]], !range [[RNG2]] +; MODULE-NEXT: ret i32 [[RET]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@potential_test13_caller2 +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 noundef 1) #[[ATTR1]], !range [[RNG2]] +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@potential_test13_caller3 +; MODULE-SAME: () #[[ATTR0]] { +; MODULE-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 undef) #[[ATTR0]], !range [[RNG2]] +; MODULE-NEXT: ret i32 [[RET]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@potential_test13_caller3 +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: [[RET:%.*]] = call i32 @potential_test13_callee(i32 undef) #[[ATTR1]], !range [[RNG2]] +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@potential_test14 +; MODULE-SAME: (i1 [[C0:%.*]], i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[X0:%.*]] = select i1 [[C0]], i32 0, i32 1 +; MODULE-NEXT: [[X1:%.*]] = select i1 [[C1]], i32 [[X0]], i32 undef +; MODULE-NEXT: [[Y2:%.*]] = select i1 [[C2]], i32 0, i32 7 +; MODULE-NEXT: [[Z3:%.*]] = select i1 [[C3]], i32 [[X1]], i32 [[Y2]] +; MODULE-NEXT: [[RET:%.*]] = icmp slt i32 [[Z3]], 7 +; MODULE-NEXT: ret i1 [[RET]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@potential_test14 +; CGSCC-SAME: (i1 [[C0:%.*]], i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[X0:%.*]] = select i1 [[C0]], i32 0, i32 1 +; CGSCC-NEXT: [[X1:%.*]] = select i1 [[C1]], i32 [[X0]], i32 undef +; CGSCC-NEXT: [[Y2:%.*]] = select i1 [[C2]], i32 0, i32 7 +; CGSCC-NEXT: [[Z3:%.*]] = select i1 [[C3]], i32 [[X1]], i32 [[Y2]] +; CGSCC-NEXT: [[RET:%.*]] = icmp slt i32 [[Z3]], 7 +; CGSCC-NEXT: ret i1 [[RET]] ; %x0 = select i1 %c0, i32 0, i32 1 %x1 = select i1 %c1, i32 %x0, i32 undef @@ -800,15 +678,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@potential_test15 +; MODULE-SAME: (i1 [[C0:%.*]], i1 [[C1:%.*]]) #[[ATTR0]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@potential_test15 +; CGSCC-SAME: (i1 [[C0:%.*]], i1 [[C1:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: ret i1 false ; %x0 = select i1 %c0, i32 0, i32 1 %x1 = select i1 %c1, i32 %x0, i32 undef @@ -817,15 +695,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@potential_test16 +; MODULE-SAME: (i1 [[C0:%.*]], i1 [[C1:%.*]]) #[[ATTR0]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@potential_test16 +; CGSCC-SAME: (i1 [[C0:%.*]], i1 [[C1:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: ret i1 false ; %x0 = select i1 %c0, i32 0, i32 undef %x1 = select i1 %c1, i32 %x0, i32 1 @@ -834,17 +712,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 } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: 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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; 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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@test0 +; MODULE-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: [[A:%.*]] = load i32, i32* [[P]], align 4, !range [[RNG0:![0-9]+]] +; MODULE-NEXT: ret i32 [[A]] +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@test0 +; CGSCC-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: [[A:%.*]] = load i32, i32* [[P]], align 4, !range [[RNG0:![0-9]+]] +; CGSCC-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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@test0-range-check +; MODULE-SAME: (i32* nocapture nofree readonly align 4 [[P:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[A:%.*]] = tail call i32 @test0(i32* nocapture nofree readonly align 4 [[P]]) #[[ATTR2:[0-9]+]], !range [[RNG0]] +; MODULE-NEXT: ret i32 [[A]] +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@test0-range-check +; CGSCC-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[A:%.*]] = tail call i32 @test0(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]]) #[[ATTR2:[0-9]+]], !range [[RNG0]] +; CGSCC-NEXT: ret i32 [[A]] ; %a = tail call i32 @test0(i32* %p) ret i32 %a @@ -66,193 +52,99 @@ ; 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 +; MODULE-LABEL: define {{[^@]+}}@test0-icmp-check +; MODULE-SAME: (i32* nocapture nofree readonly align 4 [[P:%.*]]) { +; MODULE-NEXT: [[RET:%.*]] = tail call i32 @test0(i32* nocapture nofree readonly align 4 [[P]]) #[[ATTR2]], !range [[RNG0]] +; MODULE-NEXT: [[CMP_EQ_2:%.*]] = icmp eq i32 [[RET]], 9 +; MODULE-NEXT: [[CMP_EQ_3:%.*]] = icmp eq i32 [[RET]], 8 +; MODULE-NEXT: [[CMP_EQ_4:%.*]] = icmp eq i32 [[RET]], 1 +; MODULE-NEXT: [[CMP_EQ_5:%.*]] = icmp eq i32 [[RET]], 0 +; MODULE-NEXT: tail call void @use3(i1 noundef false, i1 [[CMP_EQ_2]], i1 [[CMP_EQ_3]]) +; MODULE-NEXT: tail call void @use3(i1 [[CMP_EQ_4]], i1 [[CMP_EQ_5]], i1 noundef false) +; MODULE-NEXT: [[CMP_NE_2:%.*]] = icmp ne i32 [[RET]], 9 +; MODULE-NEXT: [[CMP_NE_3:%.*]] = icmp ne i32 [[RET]], 8 +; MODULE-NEXT: [[CMP_NE_4:%.*]] = icmp ne i32 [[RET]], 1 +; MODULE-NEXT: [[CMP_NE_5:%.*]] = icmp ne i32 [[RET]], 0 +; MODULE-NEXT: tail call void @use3(i1 noundef true, i1 [[CMP_NE_2]], i1 [[CMP_NE_3]]) +; MODULE-NEXT: tail call void @use3(i1 [[CMP_NE_4]], i1 [[CMP_NE_5]], i1 noundef true) +; MODULE-NEXT: [[CMP_UGT_3:%.*]] = icmp ugt i32 [[RET]], 8 +; MODULE-NEXT: [[CMP_UGT_4:%.*]] = icmp ugt i32 [[RET]], 1 +; MODULE-NEXT: [[CMP_UGT_5:%.*]] = icmp ugt i32 [[RET]], 0 +; MODULE-NEXT: tail call void @use3(i1 noundef false, i1 noundef false, i1 [[CMP_UGT_3]]) +; MODULE-NEXT: tail call void @use3(i1 [[CMP_UGT_4]], i1 [[CMP_UGT_5]], i1 noundef false) +; MODULE-NEXT: [[CMP_UGE_2:%.*]] = icmp uge i32 [[RET]], 9 +; MODULE-NEXT: [[CMP_UGE_3:%.*]] = icmp uge i32 [[RET]], 8 +; MODULE-NEXT: [[CMP_UGE_4:%.*]] = icmp uge i32 [[RET]], 1 +; MODULE-NEXT: tail call void @use3(i1 noundef false, i1 [[CMP_UGE_2]], i1 [[CMP_UGE_3]]) +; MODULE-NEXT: tail call void @use3(i1 [[CMP_UGE_4]], i1 noundef true, i1 noundef false) +; MODULE-NEXT: [[CMP_SGT_3:%.*]] = icmp sgt i32 [[RET]], 8 +; MODULE-NEXT: [[CMP_SGT_4:%.*]] = icmp sgt i32 [[RET]], 1 +; MODULE-NEXT: [[CMP_SGT_5:%.*]] = icmp sgt i32 [[RET]], 0 +; MODULE-NEXT: tail call void @use3(i1 noundef false, i1 noundef false, i1 [[CMP_SGT_3]]) +; MODULE-NEXT: tail call void @use3(i1 [[CMP_SGT_4]], i1 [[CMP_SGT_5]], i1 noundef true) +; MODULE-NEXT: [[CMP_GTE_2:%.*]] = icmp sge i32 [[RET]], 9 +; MODULE-NEXT: [[CMP_GTE_3:%.*]] = icmp sge i32 [[RET]], 8 +; MODULE-NEXT: [[CMP_GTE_4:%.*]] = icmp sge i32 [[RET]], 1 +; MODULE-NEXT: tail call void @use3(i1 noundef false, i1 [[CMP_GTE_2]], i1 [[CMP_GTE_3]]) +; MODULE-NEXT: tail call void @use3(i1 [[CMP_GTE_4]], i1 noundef true, i1 noundef true) +; MODULE-NEXT: [[CMP_SLT_2:%.*]] = icmp slt i32 [[RET]], 9 +; MODULE-NEXT: [[CMP_SLT_3:%.*]] = icmp slt i32 [[RET]], 8 +; MODULE-NEXT: [[CMP_SLT_4:%.*]] = icmp slt i32 [[RET]], 1 +; MODULE-NEXT: tail call void @use3(i1 noundef true, i1 [[CMP_SLT_2]], i1 [[CMP_SLT_3]]) +; MODULE-NEXT: tail call void @use3(i1 [[CMP_SLT_4]], i1 noundef false, i1 noundef false) +; MODULE-NEXT: [[CMP_LTE_3:%.*]] = icmp sle i32 [[RET]], 8 +; MODULE-NEXT: [[CMP_LTE_4:%.*]] = icmp sle i32 [[RET]], 1 +; MODULE-NEXT: [[CMP_LTE_5:%.*]] = icmp sle i32 [[RET]], 0 +; MODULE-NEXT: tail call void @use3(i1 noundef true, i1 noundef true, i1 [[CMP_LTE_3]]) +; MODULE-NEXT: tail call void @use3(i1 [[CMP_LTE_4]], i1 [[CMP_LTE_5]], i1 noundef false) +; MODULE-NEXT: ret void +; +; CGSCC-LABEL: define {{[^@]+}}@test0-icmp-check +; CGSCC-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) { +; CGSCC-NEXT: [[RET:%.*]] = tail call i32 @test0(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]]) #[[ATTR2]], !range [[RNG0]] +; CGSCC-NEXT: [[CMP_EQ_2:%.*]] = icmp eq i32 [[RET]], 9 +; CGSCC-NEXT: [[CMP_EQ_3:%.*]] = icmp eq i32 [[RET]], 8 +; CGSCC-NEXT: [[CMP_EQ_4:%.*]] = icmp eq i32 [[RET]], 1 +; CGSCC-NEXT: [[CMP_EQ_5:%.*]] = icmp eq i32 [[RET]], 0 +; CGSCC-NEXT: tail call void @use3(i1 noundef false, i1 [[CMP_EQ_2]], i1 [[CMP_EQ_3]]) +; CGSCC-NEXT: tail call void @use3(i1 [[CMP_EQ_4]], i1 [[CMP_EQ_5]], i1 noundef false) +; CGSCC-NEXT: [[CMP_NE_2:%.*]] = icmp ne i32 [[RET]], 9 +; CGSCC-NEXT: [[CMP_NE_3:%.*]] = icmp ne i32 [[RET]], 8 +; CGSCC-NEXT: [[CMP_NE_4:%.*]] = icmp ne i32 [[RET]], 1 +; CGSCC-NEXT: [[CMP_NE_5:%.*]] = icmp ne i32 [[RET]], 0 +; CGSCC-NEXT: tail call void @use3(i1 noundef true, i1 [[CMP_NE_2]], i1 [[CMP_NE_3]]) +; CGSCC-NEXT: tail call void @use3(i1 [[CMP_NE_4]], i1 [[CMP_NE_5]], i1 noundef true) +; CGSCC-NEXT: [[CMP_UGT_3:%.*]] = icmp ugt i32 [[RET]], 8 +; CGSCC-NEXT: [[CMP_UGT_4:%.*]] = icmp ugt i32 [[RET]], 1 +; CGSCC-NEXT: [[CMP_UGT_5:%.*]] = icmp ugt i32 [[RET]], 0 +; CGSCC-NEXT: tail call void @use3(i1 noundef false, i1 noundef false, i1 [[CMP_UGT_3]]) +; CGSCC-NEXT: tail call void @use3(i1 [[CMP_UGT_4]], i1 [[CMP_UGT_5]], i1 noundef false) +; CGSCC-NEXT: [[CMP_UGE_2:%.*]] = icmp uge i32 [[RET]], 9 +; CGSCC-NEXT: [[CMP_UGE_3:%.*]] = icmp uge i32 [[RET]], 8 +; CGSCC-NEXT: [[CMP_UGE_4:%.*]] = icmp uge i32 [[RET]], 1 +; CGSCC-NEXT: tail call void @use3(i1 noundef false, i1 [[CMP_UGE_2]], i1 [[CMP_UGE_3]]) +; CGSCC-NEXT: tail call void @use3(i1 [[CMP_UGE_4]], i1 noundef true, i1 noundef false) +; CGSCC-NEXT: [[CMP_SGT_3:%.*]] = icmp sgt i32 [[RET]], 8 +; CGSCC-NEXT: [[CMP_SGT_4:%.*]] = icmp sgt i32 [[RET]], 1 +; CGSCC-NEXT: [[CMP_SGT_5:%.*]] = icmp sgt i32 [[RET]], 0 +; CGSCC-NEXT: tail call void @use3(i1 noundef false, i1 noundef false, i1 [[CMP_SGT_3]]) +; CGSCC-NEXT: tail call void @use3(i1 [[CMP_SGT_4]], i1 [[CMP_SGT_5]], i1 noundef true) +; CGSCC-NEXT: [[CMP_GTE_2:%.*]] = icmp sge i32 [[RET]], 9 +; CGSCC-NEXT: [[CMP_GTE_3:%.*]] = icmp sge i32 [[RET]], 8 +; CGSCC-NEXT: [[CMP_GTE_4:%.*]] = icmp sge i32 [[RET]], 1 +; CGSCC-NEXT: tail call void @use3(i1 noundef false, i1 [[CMP_GTE_2]], i1 [[CMP_GTE_3]]) +; CGSCC-NEXT: tail call void @use3(i1 [[CMP_GTE_4]], i1 noundef true, i1 noundef true) +; CGSCC-NEXT: [[CMP_SLT_2:%.*]] = icmp slt i32 [[RET]], 9 +; CGSCC-NEXT: [[CMP_SLT_3:%.*]] = icmp slt i32 [[RET]], 8 +; CGSCC-NEXT: [[CMP_SLT_4:%.*]] = icmp slt i32 [[RET]], 1 +; CGSCC-NEXT: tail call void @use3(i1 noundef true, i1 [[CMP_SLT_2]], i1 [[CMP_SLT_3]]) +; CGSCC-NEXT: tail call void @use3(i1 [[CMP_SLT_4]], i1 noundef false, i1 noundef false) +; CGSCC-NEXT: [[CMP_LTE_3:%.*]] = icmp sle i32 [[RET]], 8 +; CGSCC-NEXT: [[CMP_LTE_4:%.*]] = icmp sle i32 [[RET]], 1 +; CGSCC-NEXT: [[CMP_LTE_5:%.*]] = icmp sle i32 [[RET]], 0 +; CGSCC-NEXT: tail call void @use3(i1 noundef true, i1 noundef true, i1 [[CMP_LTE_3]]) +; CGSCC-NEXT: tail call void @use3(i1 [[CMP_LTE_4]], i1 [[CMP_LTE_5]], i1 noundef false) +; CGSCC-NEXT: ret void ; %ret = tail call i32 @test0(i32 *%p) @@ -339,21 +231,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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@test1 +; MODULE-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[LOAD_10_100:%.*]] = load i32, i32* [[P]], align 4, !range [[RNG1:![0-9]+]] +; MODULE-NEXT: [[ADD_10_THEN_20_110:%.*]] = add i32 [[LOAD_10_100]], 10 +; MODULE-NEXT: [[MUL_10_THEN_200_1091:%.*]] = mul i32 [[ADD_10_THEN_20_110]], 10 +; MODULE-NEXT: ret i32 [[MUL_10_THEN_200_1091]] +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@test1 +; CGSCC-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[LOAD_10_100:%.*]] = load i32, i32* [[P]], align 4, !range [[RNG1:![0-9]+]] +; CGSCC-NEXT: [[ADD_10_THEN_20_110:%.*]] = add i32 [[LOAD_10_100]], 10 +; CGSCC-NEXT: [[MUL_10_THEN_200_1091:%.*]] = mul i32 [[ADD_10_THEN_20_110]], 10 +; CGSCC-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 @@ -362,34 +254,19 @@ } 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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@test1-check +; MODULE-SAME: (i32* nocapture nofree readonly align 4 [[P:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[RES:%.*]] = tail call i32 @test1(i32* nocapture nofree readonly align 4 [[P]]) #[[ATTR2]], !range [[RNG2:![0-9]+]] +; MODULE-NEXT: [[CMP:%.*]] = icmp eq i32 [[RES]], 500 +; MODULE-NEXT: ret i1 [[CMP]] +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@test1-check +; CGSCC-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[RES:%.*]] = tail call i32 @test1(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]]) #[[ATTR2]], !range [[RNG2:![0-9]+]] +; CGSCC-NEXT: [[CMP:%.*]] = icmp eq i32 [[RES]], 500 +; CGSCC-NEXT: ret i1 [[CMP]] ; %res = tail call i32 @test1(i32* %p) %cmp = icmp eq i32 %res, 500 @@ -409,23 +286,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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@test2 +; MODULE-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[TMP0:%.*]] = load i32, i32* [[P]], align 4 +; MODULE-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[TMP0]], 0 +; MODULE-NEXT: [[COND:%.*]] = select i1 [[TOBOOL]], i32 4, i32 3 +; MODULE-NEXT: ret i32 [[COND]] +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@test2 +; CGSCC-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[TMP0:%.*]] = load i32, i32* [[P]], align 4 +; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[TMP0]], 0 +; CGSCC-NEXT: [[COND:%.*]] = select i1 [[TOBOOL]], i32 4, i32 3 +; CGSCC-NEXT: ret i32 [[COND]] ; entry: %0 = load i32, i32* %p, align 4 @@ -435,29 +312,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test2_check +; MODULE-SAME: (i32* nocapture nofree readnone align 4 [[P:%.*]]) #[[ATTR1:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: br label [[IF_THEN:%.*]] +; MODULE: if.then: +; MODULE-NEXT: br label [[RETURN:%.*]] +; MODULE: if.end: +; MODULE-NEXT: unreachable +; MODULE: return: +; MODULE-NEXT: ret i32 2 +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test2_check +; CGSCC-SAME: (i32* nocapture nofree noundef nonnull readnone align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR1:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br label [[IF_THEN:%.*]] +; CGSCC: if.then: +; CGSCC-NEXT: br label [[RETURN:%.*]] +; CGSCC: if.end: +; CGSCC-NEXT: unreachable +; CGSCC: return: +; CGSCC-NEXT: ret i32 2 ; entry: %call = tail call i32 @test2(i32* %p) @@ -503,61 +380,23 @@ 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]] +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@r1 +; CGSCC-SAME: () local_unnamed_addr #[[ATTR1]] { +; CGSCC-NEXT: br label [[TMP3:%.*]] +; CGSCC: 1: +; CGSCC-NEXT: br label [[F:%.*]] +; CGSCC: 2: +; CGSCC-NEXT: unreachable +; CGSCC: f: +; CGSCC-NEXT: ret i32 undef +; CGSCC: 3: +; CGSCC-NEXT: [[TMP4:%.*]] = phi i32 [ 0, [[TMP0:%.*]] ], [ [[TMP7:%.*]], [[TMP3]] ] +; CGSCC-NEXT: [[TMP5:%.*]] = phi i32 [ 0, [[TMP0]] ], [ [[TMP6:%.*]], [[TMP3]] ] +; CGSCC-NEXT: [[TMP6]] = add nuw nsw i32 [[TMP4]], [[TMP5]] +; CGSCC-NEXT: [[TMP7]] = add nuw nsw i32 [[TMP4]], 1 +; CGSCC-NEXT: [[TMP8:%.*]] = icmp eq i32 [[TMP7]], 100 +; CGSCC-NEXT: br i1 [[TMP8]], label [[TMP1:%.*]], label [[TMP3]] ; br label %5 @@ -578,45 +417,23 @@ } 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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@f1 +; MODULE-SAME: (i32 [[TMP0:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: br label [[TMP3:%.*]] +; MODULE: 2: +; MODULE-NEXT: unreachable +; MODULE: 3: +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@f1 +; CGSCC-SAME: (i32 [[TMP0:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: br label [[TMP3:%.*]] +; CGSCC: 2: +; CGSCC-NEXT: unreachable +; CGSCC: 3: +; CGSCC-NEXT: ret void ; %2 = tail call i32 @r1(i32 %0) %3 = icmp sgt i32 %2, 15 @@ -641,31 +458,31 @@ ; } ; } 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]] -; ; FIXME: RETVAL_0 >= 0 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test4-f1 +; MODULE-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[CMP:%.*]] = icmp sgt i32 [[U]], -1 +; MODULE-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]] +; MODULE: if.then: +; MODULE-NEXT: br label [[RETURN]] +; MODULE: return: +; MODULE-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[U]], [[IF_THEN]] ], [ 0, [[ENTRY:%.*]] ] +; MODULE-NEXT: ret i32 [[RETVAL_0]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test4-f1 +; CGSCC-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[CMP:%.*]] = icmp sgt i32 [[U]], -1 +; CGSCC-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]] +; CGSCC: if.then: +; CGSCC-NEXT: br label [[RETURN]] +; CGSCC: return: +; CGSCC-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[U]], [[IF_THEN]] ], [ 0, [[ENTRY:%.*]] ] +; CGSCC-NEXT: ret i32 [[RETVAL_0]] +; entry: %cmp = icmp sgt i32 %u, -1 br i1 %cmp, label %if.then, label %return @@ -680,29 +497,21 @@ 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]] -; ; FIXME: %call should have range [0, inf] - +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test4-g1 +; MODULE-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[CALL:%.*]] = tail call i32 @test4-f1(i32 [[U]]) #[[ATTR1]] +; MODULE-NEXT: ret i32 [[CALL]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test4-g1 +; CGSCC-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[CALL:%.*]] = tail call i32 @test4-f1(i32 [[U]]) #[[ATTR3:[0-9]+]] +; CGSCC-NEXT: ret i32 [[CALL]] +; entry: %call = tail call i32 @test4-f1(i32 %u) ret i32 %call @@ -717,35 +526,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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test4-f2 +; MODULE-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[CMP:%.*]] = icmp sgt i32 [[U]], -1 +; MODULE-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] +; MODULE: if.then: +; MODULE-NEXT: [[ADD:%.*]] = add nuw nsw i32 [[U]], 1 +; MODULE-NEXT: br label [[RETURN:%.*]] +; MODULE: if.else: +; MODULE-NEXT: br label [[RETURN]] +; MODULE: return: +; MODULE-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[ADD]], [[IF_THEN]] ], [ 1, [[IF_ELSE]] ] +; MODULE-NEXT: ret i32 [[RETVAL_0]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test4-f2 +; CGSCC-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[CMP:%.*]] = icmp sgt i32 [[U]], -1 +; CGSCC-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] +; CGSCC: if.then: +; CGSCC-NEXT: [[ADD:%.*]] = add nuw nsw i32 [[U]], 1 +; CGSCC-NEXT: br label [[RETURN:%.*]] +; CGSCC: if.else: +; CGSCC-NEXT: br label [[RETURN]] +; CGSCC: return: +; CGSCC-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[ADD]], [[IF_THEN]] ], [ 1, [[IF_ELSE]] ] +; CGSCC-NEXT: ret i32 [[RETVAL_0]] ; entry: %cmp = icmp sgt i32 %u, -1 @@ -765,33 +574,19 @@ 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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test4-g2 +; MODULE-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[CALL:%.*]] = tail call i32 @test4-f2(i32 [[U]]) #[[ATTR1]], !range [[RNG3:![0-9]+]] +; MODULE-NEXT: ret i32 [[CALL]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test4-g2 +; CGSCC-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[CALL:%.*]] = tail call i32 @test4-f2(i32 [[U]]) #[[ATTR3]], !range [[RNG3:![0-9]+]] +; CGSCC-NEXT: ret i32 [[CALL]] ; entry: %call = tail call i32 @test4-f2(i32 %u) @@ -799,62 +594,36 @@ } 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) @@ -884,64 +653,62 @@ ; Examples taken from https://llvm.discourse.group/t/impossible-condition-optimization/461/1 -; ; The important part is that we return a constant (false) -; ; { ; 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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@phi +; MODULE-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: bb: +; MODULE-NEXT: [[TMP:%.*]] = icmp sgt i32 [[ARG]], 5 +; MODULE-NEXT: br i1 [[TMP]], label [[BB1:%.*]], label [[BB2:%.*]] +; MODULE: bb1: +; MODULE-NEXT: br label [[BB3:%.*]] +; MODULE: bb2: +; MODULE-NEXT: br label [[BB3]] +; MODULE: bb3: +; MODULE-NEXT: [[TMP4:%.*]] = icmp sgt i32 [[ARG]], 10 +; MODULE-NEXT: br i1 [[TMP4]], label [[BB5:%.*]], label [[BB7:%.*]] +; MODULE: bb5: +; MODULE-NEXT: br label [[BB9:%.*]] +; MODULE: bb7: +; MODULE-NEXT: br label [[BB9]] +; MODULE: bb9: +; MODULE-NEXT: br label [[BB12:%.*]] +; MODULE: bb11: +; MODULE-NEXT: unreachable +; MODULE: bb12: +; MODULE-NEXT: br label [[BB13:%.*]] +; MODULE: bb13: +; MODULE-NEXT: ret i1 false +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@phi +; CGSCC-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: bb: +; CGSCC-NEXT: [[TMP:%.*]] = icmp sgt i32 [[ARG]], 5 +; CGSCC-NEXT: br i1 [[TMP]], label [[BB1:%.*]], label [[BB2:%.*]] +; CGSCC: bb1: +; CGSCC-NEXT: br label [[BB3:%.*]] +; CGSCC: bb2: +; CGSCC-NEXT: br label [[BB3]] +; CGSCC: bb3: +; CGSCC-NEXT: [[TMP4:%.*]] = icmp sgt i32 [[ARG]], 10 +; CGSCC-NEXT: br i1 [[TMP4]], label [[BB5:%.*]], label [[BB7:%.*]] +; CGSCC: bb5: +; CGSCC-NEXT: br label [[BB9:%.*]] +; CGSCC: bb7: +; CGSCC-NEXT: br label [[BB9]] +; CGSCC: bb9: +; CGSCC-NEXT: br label [[BB12:%.*]] +; CGSCC: bb11: +; CGSCC-NEXT: unreachable +; CGSCC: bb12: +; CGSCC-NEXT: br label [[BB13:%.*]] +; CGSCC: bb13: +; CGSCC-NEXT: ret i1 false ; bb: %tmp = icmp sgt i32 %arg, 5 @@ -983,17 +750,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@select +; MODULE-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: ret i1 false +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@select +; CGSCC-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: ret i1 false ; entry: %cmp = icmp sgt i32 %a, 5 @@ -1006,17 +773,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@select_zext +; MODULE-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: ret i32 0 +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@select_zext +; CGSCC-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: ret i32 0 ; entry: %cmp = icmp sgt i32 %a, 5 @@ -1030,17 +797,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@select_int2ptr_bitcast_ptr2int +; MODULE-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: ret i64 0 +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@select_int2ptr_bitcast_ptr2int +; CGSCC-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: ret i64 0 ; entry: %cmp = icmp sgt i32 %a, 5 @@ -1058,117 +825,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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@f_fcmp +; MODULE-SAME: (float [[A:%.*]], float [[B:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: [[R:%.*]] = fcmp uge float [[A]], [[B]] +; MODULE-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false +; MODULE-NEXT: ret i1 [[S]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@f_fcmp +; CGSCC-SAME: (float [[A:%.*]], float [[B:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: [[R:%.*]] = fcmp uge float [[A]], [[B]] +; CGSCC-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false +; CGSCC-NEXT: ret i1 [[S]] ; %r = fcmp uge float %a, %b %s = select i1 %r, i1 %r, i1 0 ret i1 %s } define i1 @d_fcmp(double %a, double %b) { -; IS__TUNIT____: 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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@d_fcmp +; MODULE-SAME: (double [[A:%.*]], double [[B:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: [[R:%.*]] = fcmp oeq double [[A]], [[B]] +; MODULE-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false +; MODULE-NEXT: ret i1 [[S]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@d_fcmp +; CGSCC-SAME: (double [[A:%.*]], double [[B:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: [[R:%.*]] = fcmp oeq double [[A]], [[B]] +; CGSCC-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false +; CGSCC-NEXT: ret i1 [[S]] ; %r = fcmp oeq double %a, %b %s = select i1 %r, i1 %r, i1 0 ret i1 %s } define i1 @dp_icmp(double* %a, double* %b) { -; IS__TUNIT____: 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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@dp_icmp +; MODULE-SAME: (double* nofree readnone [[A:%.*]], double* nofree readnone [[B:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: [[R:%.*]] = icmp sge double* [[A]], [[B]] +; MODULE-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false +; MODULE-NEXT: ret i1 [[S]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@dp_icmp +; CGSCC-SAME: (double* nofree readnone [[A:%.*]], double* nofree readnone [[B:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: [[R:%.*]] = icmp sge double* [[A]], [[B]] +; CGSCC-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false +; CGSCC-NEXT: ret i1 [[S]] ; %r = icmp sge double* %a, %b %s = select i1 %r, i1 %r, i1 0 ret i1 %s } define i1 @ip_icmp(i8* %a, i8* %b) { -; IS__TUNIT____: 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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@ip_icmp +; MODULE-SAME: (i8* nofree readnone [[A:%.*]], i8* nofree readnone [[B:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: [[R:%.*]] = icmp ult i8* [[A]], [[B]] +; MODULE-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false +; MODULE-NEXT: ret i1 [[S]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@ip_icmp +; CGSCC-SAME: (i8* nofree readnone [[A:%.*]], i8* nofree readnone [[B:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: [[R:%.*]] = icmp ult i8* [[A]], [[B]] +; CGSCC-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false +; CGSCC-NEXT: ret i1 [[S]] ; %r = icmp ult i8* %a, %b %s = select i1 %r, i1 %r, i1 0 ret i1 %s } define i1 @fcmp_caller(float %fa, float %fb, double %da, double %db, double* %dpa, double* %dpb, i8* %ipa, i8* %ipb) { -; IS__TUNIT____: 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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@fcmp_caller +; MODULE-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]] { +; MODULE-NEXT: [[R1:%.*]] = call i1 @f_fcmp(float [[FA]], float [[FB]]) #[[ATTR1]] +; MODULE-NEXT: [[R2:%.*]] = call i1 @d_fcmp(double [[DA]], double [[DB]]) #[[ATTR1]] +; MODULE-NEXT: [[R3:%.*]] = call i1 @dp_icmp(double* noalias nofree readnone [[DPA]], double* noalias nofree readnone [[DPB]]) #[[ATTR1]] +; MODULE-NEXT: [[R4:%.*]] = call i1 @ip_icmp(i8* noalias nofree readnone [[IPA]], i8* noalias nofree readnone [[IPB]]) #[[ATTR1]] +; MODULE-NEXT: [[O1:%.*]] = or i1 [[R1]], [[R2]] +; MODULE-NEXT: [[O2:%.*]] = or i1 [[R3]], [[R4]] +; MODULE-NEXT: [[O3:%.*]] = or i1 [[O1]], [[O2]] +; MODULE-NEXT: ret i1 [[O3]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@fcmp_caller +; CGSCC-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]] { +; CGSCC-NEXT: [[R1:%.*]] = call i1 @f_fcmp(float [[FA]], float [[FB]]) #[[ATTR3]] +; CGSCC-NEXT: [[R2:%.*]] = call i1 @d_fcmp(double [[DA]], double [[DB]]) #[[ATTR3]] +; CGSCC-NEXT: [[R3:%.*]] = call i1 @dp_icmp(double* noalias nofree readnone [[DPA]], double* noalias nofree readnone [[DPB]]) #[[ATTR3]] +; CGSCC-NEXT: [[R4:%.*]] = call i1 @ip_icmp(i8* noalias nofree readnone [[IPA]], i8* noalias nofree readnone [[IPB]]) #[[ATTR3]] +; CGSCC-NEXT: [[O1:%.*]] = or i1 [[R1]], [[R2]] +; CGSCC-NEXT: [[O2:%.*]] = or i1 [[R3]], [[R4]] +; CGSCC-NEXT: [[O3:%.*]] = or i1 [[O1]], [[O2]] +; CGSCC-NEXT: ret i1 [[O3]] ; %r1 = call i1 @f_fcmp(float %fa, float %fb) %r2 = call i1 @d_fcmp(double %da, double %db) @@ -1181,43 +936,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@ret_two +; MODULE-SAME: () #[[ATTR1]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@ret_two +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@ret_undef +; MODULE-SAME: () #[[ATTR1]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@ret_undef +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-NEXT: ret i8 undef ; ret i8 undef } ; Verify we collapse undef to a value and return something non-undef here. define i8 @undef_collapse_1() { -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@undef_collapse_1 -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i8 0 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@undef_collapse_1 +; MODULE-SAME: () #[[ATTR1]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@undef_collapse_1 +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-NEXT: ret i8 0 ; %c = call i8 @ret_undef() %s = shl i8 %c, 2 @@ -1226,15 +981,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@undef_collapse_2 +; MODULE-SAME: () #[[ATTR1]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@undef_collapse_2 +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-NEXT: ret i8 0 ; %c = call i8 @ret_two() %s = shl i8 undef, %c @@ -1242,16 +997,15 @@ } define i8 @undef_collapse_caller() { +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@undef_collapse_caller +; MODULE-SAME: () #[[ATTR1]] { +; MODULE-NEXT: ret i8 0 ; -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@undef_collapse_caller -; IS__TUNIT____-SAME: () #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i8 0 -; -; IS__CGSCC____: 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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@undef_collapse_caller +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-NEXT: ret i8 0 ; %c1 = call i8 @undef_collapse_1() %c2 = call i8 @undef_collapse_2() @@ -1260,32 +1014,31 @@ } 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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@ret1or2 +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: [[S:%.*]] = select i1 [[C]], i32 1, i32 2 +; MODULE-NEXT: ret i32 [[S]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@ret1or2 +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: [[S:%.*]] = select i1 [[C]], i32 1, i32 2 +; CGSCC-NEXT: ret i32 [[S]] ; %s = select i1 %c, i32 1, i32 2 ret i32 %s } define i1 @callee_range_1(i1 %c1, i1 %c2, i1 %c3) { +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@callee_range_1 +; MODULE-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: ret i1 true ; -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@callee_range_1 -; IS__TUNIT____-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) #[[ATTR1]] { -; IS__TUNIT____-NEXT: ret i1 true -; -; IS__CGSCC____: 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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@callee_range_1 +; CGSCC-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: ret i1 true ; %r1 = call i32 @ret1or2(i1 %c1) %r2 = call i32 @ret1or2(i1 %c2) @@ -1298,44 +1051,23 @@ } 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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@callee_range_2 +; MODULE-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: [[R1:%.*]] = call i32 @ret1or2(i1 [[C1]]) #[[ATTR1]], !range [[RNG5:![0-9]+]] +; MODULE-NEXT: [[R2:%.*]] = call i32 @ret1or2(i1 [[C2]]) #[[ATTR1]], !range [[RNG5]] +; MODULE-NEXT: [[A:%.*]] = add i32 [[R1]], [[R2]] +; MODULE-NEXT: [[I1:%.*]] = icmp sle i32 [[A]], 3 +; MODULE-NEXT: ret i1 [[I1]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@callee_range_2 +; CGSCC-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: [[R1:%.*]] = call i32 @ret1or2(i1 [[C1]]) #[[ATTR3]], !range [[RNG5:![0-9]+]] +; CGSCC-NEXT: [[R2:%.*]] = call i32 @ret1or2(i1 [[C2]]) #[[ATTR3]], !range [[RNG5]] +; CGSCC-NEXT: [[A:%.*]] = add i32 [[R1]], [[R2]] +; CGSCC-NEXT: [[I1:%.*]] = icmp sle i32 [[A]], 3 +; CGSCC-NEXT: ret i1 [[I1]] ; %r1 = call i32 @ret1or2(i1 %c1) %r2 = call i32 @ret1or2(i1 %c2) @@ -1348,72 +1080,43 @@ 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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@ret100 +; MODULE-SAME: () #[[ATTR1]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@ret100 +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@ctx_adjustment +; MODULE-SAME: (i32 [[V:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: [[C1:%.*]] = icmp sge i32 [[V]], 100 +; MODULE-NEXT: br i1 [[C1]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] +; MODULE: if.true: +; MODULE-NEXT: br label [[END:%.*]] +; MODULE: if.false: +; MODULE-NEXT: br label [[END]] +; MODULE: end: +; MODULE-NEXT: ret i1 true +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@ctx_adjustment +; CGSCC-SAME: (i32 [[V:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: [[C1:%.*]] = icmp sge i32 [[V]], 100 +; CGSCC-NEXT: br i1 [[C1]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] +; CGSCC: if.true: +; CGSCC-NEXT: br label [[END:%.*]] +; CGSCC: if.false: +; CGSCC-NEXT: br label [[END]] +; CGSCC: end: +; CGSCC-NEXT: ret i1 true ; %c1 = icmp sge i32 %V, 100 br i1 %c1, label %if.true, label %if.false @@ -1430,70 +1133,46 @@ 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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@func +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: [[RET:%.*]] = select i1 [[C]], i32 0, i32 1 +; MODULE-NEXT: ret i32 [[RET]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@func +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: [[RET:%.*]] = select i1 [[C]], i32 0, i32 1 +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@simplify_callsite_argument +; MODULE-SAME: (i1 [[D:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: [[C:%.*]] = select i1 [[D]], i1 true, i1 false +; MODULE-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; MODULE: t: +; MODULE-NEXT: [[RET1:%.*]] = call noundef i32 @func(i1 noundef true) #[[ATTR1]], !range [[RNG4]] +; MODULE-NEXT: ret i32 [[RET1]] +; MODULE: f: +; MODULE-NEXT: [[RET2:%.*]] = call noundef i32 @func(i1 noundef false) #[[ATTR1]], !range [[RNG4]] +; MODULE-NEXT: ret i32 [[RET2]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@simplify_callsite_argument +; CGSCC-SAME: (i1 [[D:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: [[C:%.*]] = select i1 [[D]], i1 true, i1 false +; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; CGSCC: t: +; CGSCC-NEXT: [[RET1:%.*]] = call noundef i32 @func(i1 noundef true) #[[ATTR3]], !range [[RNG4]] +; CGSCC-NEXT: ret i32 [[RET1]] +; CGSCC: f: +; CGSCC-NEXT: [[RET2:%.*]] = call noundef i32 @func(i1 noundef false) #[[ATTR3]], !range [[RNG4]] +; CGSCC-NEXT: ret i32 [[RET2]] ; %c = select i1 %d, i1 true, i1 false br i1 %c, label %t, label %f @@ -1506,38 +1185,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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@less_than_65536 +; CGSCC-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: [[SHRINKED:%.*]] = udiv i32 undef, 65536 +; CGSCC-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@is_less_than_65536 +; CGSCC-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: [[CMP:%.*]] = icmp ult i32 undef, 65536 +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@check_divided_range +; MODULE-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@check_divided_range +; CGSCC-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: ret i1 true ; %csret1 = call i32 @less_than_65536(i32 0) %csret2 = call i32 @less_than_65536(i32 %arg) @@ -1548,37 +1226,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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@cast_and_return +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: [[RET:%.*]] = zext i1 undef to i32 +; CGSCC-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@is_less_than_3 +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@check_casted_range +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@check_casted_range +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: ret i1 true ; %csret1 = call i32 @cast_and_return(i1 true) %csret2 = call i32 @cast_and_return(i1 %c) @@ -1588,34 +1265,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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@less_than_100_1 +; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: switch i32 [[C]], label [[OTHERWISE:%.*]] [ +; CGSCC-NEXT: i32 0, label [[ONZERO:%.*]] +; CGSCC-NEXT: i32 1, label [[ONONE:%.*]] +; CGSCC-NEXT: i32 2, label [[ONTWO:%.*]] +; CGSCC-NEXT: i32 3, label [[ONTHREE:%.*]] +; CGSCC-NEXT: i32 4, label [[ONFOUR:%.*]] +; CGSCC-NEXT: i32 5, label [[ONFIVE:%.*]] +; CGSCC-NEXT: i32 6, label [[ONSIX:%.*]] +; CGSCC-NEXT: ] +; CGSCC: onzero: +; CGSCC-NEXT: ret i32 undef +; CGSCC: onone: +; CGSCC-NEXT: ret i32 undef +; CGSCC: ontwo: +; CGSCC-NEXT: ret i32 undef +; CGSCC: onthree: +; CGSCC-NEXT: ret i32 undef +; CGSCC: onfour: +; CGSCC-NEXT: ret i32 undef +; CGSCC: onfive: +; CGSCC-NEXT: ret i32 undef +; CGSCC: onsix: +; CGSCC-NEXT: ret i32 undef +; CGSCC: otherwise: +; CGSCC-NEXT: ret i32 undef ; switch i32 %c, label %otherwise [ i32 0, label %onzero i32 1, label %onone @@ -1643,25 +1320,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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@is_less_than_100_1 +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@propagate_range1 +; MODULE-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@propagate_range1 +; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: ret i1 true ; %csret = call i32 @less_than_100_1(i32 %c) %true = call i1 @is_less_than_100_1(i32 %csret) @@ -1669,35 +1346,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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@less_than_100_2 +; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: switch i32 [[C]], label [[OTHERWISE:%.*]] [ +; CGSCC-NEXT: i32 0, label [[ONZERO:%.*]] +; CGSCC-NEXT: i32 1, label [[ONONE:%.*]] +; CGSCC-NEXT: i32 2, label [[ONTWO:%.*]] +; CGSCC-NEXT: i32 3, label [[ONTHREE:%.*]] +; CGSCC-NEXT: i32 4, label [[ONFOUR:%.*]] +; CGSCC-NEXT: i32 5, label [[ONFIVE:%.*]] +; CGSCC-NEXT: i32 6, label [[ONSIX:%.*]] +; CGSCC-NEXT: ] +; CGSCC: onzero: +; CGSCC-NEXT: ret i32 undef +; CGSCC: onone: +; CGSCC-NEXT: ret i32 undef +; CGSCC: ontwo: +; CGSCC-NEXT: ret i32 undef +; CGSCC: onthree: +; CGSCC-NEXT: ret i32 undef +; CGSCC: onfour: +; CGSCC-NEXT: ret i32 undef +; CGSCC: onfive: +; CGSCC-NEXT: ret i32 undef +; CGSCC: onsix: +; CGSCC-NEXT: ret i32 undef +; CGSCC: otherwise: +; CGSCC-NEXT: ret i32 undef ; switch i32 %c, label %otherwise [ i32 0, label %onzero i32 1, label %onone @@ -1725,27 +1401,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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@is_less_than_100_2 +; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: [[CMP:%.*]] = icmp slt i32 undef, 100 +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@propagate_range2 +; MODULE-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@propagate_range2 +; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { +; CGSCC-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 +1431,10 @@ } 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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@non_zero +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-NEXT: ret i1 undef ; %r = icmp ne i8 %v, 0 ret i1 %r @@ -1779,51 +1442,27 @@ ; 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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@context +; MODULE-SAME: (i8* nocapture nofree noundef nonnull readonly dereferenceable(1) [[P:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[L:%.*]] = load i8, i8* [[P]], align 1 +; MODULE-NEXT: [[C:%.*]] = icmp slt i8 0, [[L]] +; MODULE-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; MODULE: t: +; MODULE-NEXT: ret i1 true +; MODULE: f: +; MODULE-NEXT: ret i1 false +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@context +; CGSCC-SAME: (i8* nocapture nofree noundef nonnull readonly dereferenceable(1) [[P:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[L:%.*]] = load i8, i8* [[P]], align 1 +; CGSCC-NEXT: [[C:%.*]] = icmp slt i8 0, [[L]] +; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; CGSCC: t: +; CGSCC-NEXT: ret i1 true +; CGSCC: f: +; CGSCC-NEXT: ret i1 false ; %l = load i8, i8* %p %c = icmp slt i8 0, %l @@ -1906,44 +1545,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} +; MODULE: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind readonly willreturn } +; MODULE: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; MODULE: 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} +; CGSCC: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; CGSCC: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR2]] = { readonly willreturn } +; CGSCC: 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,27 +1,21 @@ ; 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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC -; ; This is an evolved example to stress test SCC parameter attribute propagation. ; The SCC in this test is made up of the following six function, three of which ; are internal and three externally visible: -; ; static int *internal_ret0_nw(int *n0, int *w0); ; static int *internal_ret1_rw(int *r0, int *w0); ; static int *internal_ret1_rrw(int *r0, int *r1, int *w0); ; int *external_ret2_nrw(int *n0, int *r0, int *w0); ; int *external_sink_ret2_nrw(int *n0, int *r0, int *w0); ; int *external_source_ret2_nrw(int *n0, int *r0, int *w0); -; ; The top four functions call each other while the "sink" function will not ; call anything and the "source" function will not be called in this module. ; The names of the functions define the returned parameter (X for "_retX_"), ; as well as how the parameters are (transitively) used (n = readnone, ; r = readonly, w = writeonly). -; ; What we should see is something along the lines of: ; 1 - Number of functions marked as norecurse ; 6 - Number of functions marked argmemonly @@ -31,29 +25,28 @@ ; 6 - Number of arguments marked writeonly ; 6 - Number of arguments marked readonly ; 6 - Number of arguments marked returned -; 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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind +; MODULE-LABEL: define {{[^@]+}}@external_ret2_nrw +; MODULE-SAME: (i32* nofree [[N0:%.*]], i32* nofree [[R0:%.*]], i32* nofree returned [[W0:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[CALL:%.*]] = call i32* @internal_ret0_nw(i32* nofree [[N0]], i32* nofree [[W0]]) #[[ATTR2:[0-9]+]] +; MODULE-NEXT: [[CALL1:%.*]] = call i32* @internal_ret1_rrw(i32* nofree align 4 [[R0]], i32* nofree [[R0]], i32* nofree [[W0]]) #[[ATTR2]] +; MODULE-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]] +; MODULE-NEXT: [[CALL3:%.*]] = call i32* @internal_ret1_rw(i32* nofree align 4 [[R0]], i32* nofree [[W0]]) #[[ATTR2]] +; MODULE-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]] +; CGSCC: Function Attrs: argmemonly nofree nosync nounwind +; CGSCC-LABEL: define {{[^@]+}}@external_ret2_nrw +; CGSCC-SAME: (i32* nofree [[N0:%.*]], i32* nofree [[R0:%.*]], i32* nofree returned [[W0:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[CALL:%.*]] = call i32* @internal_ret0_nw(i32* nofree [[N0]], i32* nofree [[W0]]) #[[ATTR2:[0-9]+]] +; 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]] +; 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]+]] +; CGSCC-NEXT: [[CALL3:%.*]] = call i32* @internal_ret1_rw(i32* nofree nonnull align 4 dereferenceable(4) [[R0]], i32* nofree [[W0]]) #[[ATTR2]] +; CGSCC-NEXT: ret i32* [[W0]] ; entry: %call = call i32* @internal_ret0_nw(i32* %n0, i32* %w0) @@ -64,55 +57,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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind +; MODULE-LABEL: define {{[^@]+}}@internal_ret0_nw +; MODULE-SAME: (i32* nofree returned [[N0:%.*]], i32* nofree [[W0:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[R0:%.*]] = alloca i32, align 4 +; MODULE-NEXT: [[R1:%.*]] = alloca i32, align 4 +; MODULE-NEXT: [[TOBOOL:%.*]] = icmp ne i32* [[N0]], null +; MODULE-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] +; MODULE: if.then: +; MODULE-NEXT: br label [[RETURN:%.*]] +; MODULE: if.end: +; MODULE-NEXT: store i32 3, i32* [[R0]], align 4 +; MODULE-NEXT: store i32 5, i32* [[R1]], align 4 +; MODULE-NEXT: store i32 1, i32* [[W0]], align 4 +; MODULE-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]] +; MODULE-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]] +; MODULE-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]] +; MODULE-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]] +; MODULE-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]] +; MODULE-NEXT: [[CALL5:%.*]] = call i32* @internal_ret0_nw(i32* nofree [[N0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; MODULE-NEXT: br label [[RETURN]] +; MODULE: return: +; MODULE-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[N0]], [[IF_END]] ], [ [[N0]], [[IF_THEN]] ] +; MODULE-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 +; CGSCC: Function Attrs: argmemonly nofree nosync nounwind +; CGSCC-LABEL: define {{[^@]+}}@internal_ret0_nw +; CGSCC-SAME: (i32* nofree [[N0:%.*]], i32* nofree [[W0:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[R0:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: [[R1:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp ne i32* [[N0]], null +; CGSCC-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] +; CGSCC: if.then: +; CGSCC-NEXT: br label [[RETURN:%.*]] +; CGSCC: if.end: +; CGSCC-NEXT: store i32 3, i32* [[R0]], align 4 +; CGSCC-NEXT: store i32 5, i32* [[R1]], align 4 +; CGSCC-NEXT: store i32 1, i32* [[W0]], align 4 +; 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]] +; 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]] +; 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]] +; 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]] +; 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]] +; CGSCC-NEXT: [[CALL5:%.*]] = call i32* @internal_ret0_nw(i32* nofree [[N0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; CGSCC-NEXT: br label [[RETURN]] +; CGSCC: return: +; CGSCC-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[N0]], [[IF_END]] ], [ [[N0]], [[IF_THEN]] ] +; CGSCC-NEXT: ret i32* undef ; entry: %r0 = alloca i32, align 4 @@ -141,61 +134,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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind +; MODULE-LABEL: define {{[^@]+}}@internal_ret1_rrw +; MODULE-SAME: (i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0:%.*]], i32* nofree [[R1:%.*]], i32* nofree [[W0:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[TMP0:%.*]] = load i32, i32* [[R0]], align 4 +; MODULE-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0 +; MODULE-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] +; MODULE: if.then: +; MODULE-NEXT: br label [[RETURN:%.*]] +; MODULE: if.end: +; MODULE-NEXT: [[CALL:%.*]] = call i32* @internal_ret1_rw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree [[W0]]) #[[ATTR2]] +; MODULE-NEXT: [[TMP1:%.*]] = load i32, i32* [[R0]], align 4 +; MODULE-NEXT: [[TMP2:%.*]] = load i32, i32* [[R1]], align 4 +; MODULE-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[TMP2]] +; MODULE-NEXT: store i32 [[ADD]], i32* [[W0]], align 4 +; MODULE-NEXT: [[CALL1:%.*]] = call i32* @internal_ret1_rw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; MODULE-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]] +; MODULE-NEXT: [[CALL3:%.*]] = call i32* @internal_ret0_nw(i32* nofree nonnull align 4 dereferenceable(4) [[W0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; MODULE-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]] +; MODULE-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]] +; MODULE-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]] +; MODULE-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]] +; MODULE-NEXT: [[CALL8:%.*]] = call i32* @internal_ret0_nw(i32* nofree nonnull align 4 dereferenceable(4) [[R1]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; MODULE-NEXT: br label [[RETURN]] +; MODULE: return: +; MODULE-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[R1]], [[IF_END]] ], [ [[R1]], [[IF_THEN]] ] +; MODULE-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 +; CGSCC: Function Attrs: argmemonly nofree nosync nounwind +; CGSCC-LABEL: define {{[^@]+}}@internal_ret1_rrw +; CGSCC-SAME: (i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0:%.*]], i32* nofree nonnull align 4 dereferenceable(4) [[R1:%.*]], i32* nofree [[W0:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[TMP0:%.*]] = load i32, i32* [[R0]], align 4 +; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0 +; CGSCC-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] +; CGSCC: if.then: +; CGSCC-NEXT: br label [[RETURN:%.*]] +; CGSCC: if.end: +; CGSCC-NEXT: [[CALL:%.*]] = call i32* @internal_ret1_rw(i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0]], i32* nofree [[W0]]) #[[ATTR2]] +; CGSCC-NEXT: [[TMP1:%.*]] = load i32, i32* [[R0]], align 4 +; CGSCC-NEXT: [[TMP2:%.*]] = load i32, i32* [[R1]], align 4 +; CGSCC-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[TMP2]] +; CGSCC-NEXT: store i32 [[ADD]], i32* [[W0]], align 4 +; 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]] +; 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]] +; 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]] +; 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]] +; 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]] +; 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]] +; 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]] +; 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]] +; CGSCC-NEXT: br label [[RETURN]] +; CGSCC: return: +; CGSCC-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[R1]], [[IF_END]] ], [ [[R1]], [[IF_THEN]] ] +; CGSCC-NEXT: ret i32* undef ; entry: %0 = load i32, i32* %r0, align 4 @@ -227,35 +220,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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@external_sink_ret2_nrw +; MODULE-SAME: (i32* nofree [[N0:%.*]], i32* nocapture nofree readonly [[R0:%.*]], i32* nofree returned writeonly "no-capture-maybe-returned" [[W0:%.*]]) #[[ATTR1:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[TOBOOL:%.*]] = icmp ne i32* [[N0]], null +; MODULE-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] +; MODULE: if.then: +; MODULE-NEXT: br label [[RETURN:%.*]] +; MODULE: if.end: +; MODULE-NEXT: [[TMP0:%.*]] = load i32, i32* [[R0]], align 4 +; MODULE-NEXT: store i32 [[TMP0]], i32* [[W0]], align 4 +; MODULE-NEXT: br label [[RETURN]] +; MODULE: return: +; MODULE-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]] +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@external_sink_ret2_nrw +; CGSCC-SAME: (i32* nofree [[N0:%.*]], i32* nocapture nofree readonly [[R0:%.*]], i32* nofree returned writeonly "no-capture-maybe-returned" [[W0:%.*]]) #[[ATTR1:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp ne i32* [[N0]], null +; CGSCC-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] +; CGSCC: if.then: +; CGSCC-NEXT: br label [[RETURN:%.*]] +; CGSCC: if.end: +; CGSCC-NEXT: [[TMP0:%.*]] = load i32, i32* [[R0]], align 4 +; CGSCC-NEXT: store i32 [[TMP0]], i32* [[W0]], align 4 +; CGSCC-NEXT: br label [[RETURN]] +; CGSCC: return: +; CGSCC-NEXT: ret i32* [[W0]] ; entry: %tobool = icmp ne i32* %n0, null @@ -274,49 +267,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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind +; MODULE-LABEL: define {{[^@]+}}@internal_ret1_rw +; MODULE-SAME: (i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0:%.*]], i32* nofree returned [[W0:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[TMP0:%.*]] = load i32, i32* [[R0]], align 4 +; MODULE-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0 +; MODULE-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] +; MODULE: if.then: +; MODULE-NEXT: br label [[RETURN:%.*]] +; MODULE: if.end: +; MODULE-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]] +; MODULE-NEXT: [[TMP1:%.*]] = load i32, i32* [[R0]], align 4 +; MODULE-NEXT: store i32 [[TMP1]], i32* [[W0]], align 4 +; MODULE-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]] +; MODULE-NEXT: [[CALL2:%.*]] = call i32* @internal_ret0_nw(i32* nofree nonnull align 4 dereferenceable(4) [[W0]], i32* nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; MODULE-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]] +; MODULE-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]] +; MODULE-NEXT: br label [[RETURN]] +; MODULE: return: +; MODULE-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[W0]], [[IF_END]] ], [ [[W0]], [[IF_THEN]] ] +; MODULE-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 +; CGSCC: Function Attrs: argmemonly nofree nosync nounwind +; CGSCC-LABEL: define {{[^@]+}}@internal_ret1_rw +; CGSCC-SAME: (i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0:%.*]], i32* nofree [[W0:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[TMP0:%.*]] = load i32, i32* [[R0]], align 4 +; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0 +; CGSCC-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] +; CGSCC: if.then: +; CGSCC-NEXT: br label [[RETURN:%.*]] +; CGSCC: if.end: +; 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]] +; CGSCC-NEXT: [[TMP1:%.*]] = load i32, i32* [[R0]], align 4 +; CGSCC-NEXT: store i32 [[TMP1]], i32* [[W0]], align 4 +; 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]] +; 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]] +; 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]] +; 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]] +; CGSCC-NEXT: br label [[RETURN]] +; CGSCC: return: +; CGSCC-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[W0]], [[IF_END]] ], [ [[W0]], [[IF_THEN]] ] +; CGSCC-NEXT: ret i32* undef ; entry: %0 = load i32, i32* %r0, align 4 @@ -342,21 +335,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]] +; MODULE: Function Attrs: argmemonly nofree nosync nounwind +; MODULE-LABEL: define {{[^@]+}}@external_source_ret2_nrw +; MODULE-SAME: (i32* nofree [[N0:%.*]], i32* nofree [[R0:%.*]], i32* nofree returned [[W0:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-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]+]] +; MODULE-NEXT: [[CALL1:%.*]] = call i32* @external_ret2_nrw(i32* nofree [[N0]], i32* nofree [[R0]], i32* nofree [[W0]]) #[[ATTR2]] +; MODULE-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]] +; CGSCC: Function Attrs: argmemonly nofree nosync nounwind +; CGSCC-LABEL: define {{[^@]+}}@external_source_ret2_nrw +; CGSCC-SAME: (i32* nofree [[N0:%.*]], i32* nofree [[R0:%.*]], i32* nofree returned [[W0:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; 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]+]] +; CGSCC-NEXT: [[CALL1:%.*]] = call i32* @external_ret2_nrw(i32* nofree [[N0]], i32* nofree [[R0]], i32* nofree [[W0]]) #[[ATTR3]] +; CGSCC-NEXT: ret i32* [[W0]] ; entry: %call = call i32* @external_sink_ret2_nrw(i32* %n0, i32* %r0, i32* %w0) @@ -367,14 +360,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 } +; MODULE: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind } +; MODULE: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn } +; MODULE: attributes #[[ATTR2]] = { nofree nosync nounwind } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind } +; CGSCC: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR2]] = { nofree nosync nounwind } +; CGSCC: attributes #[[ATTR3]] = { nounwind } +; CGSCC: 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,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 -; 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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC @x = global i32 0 @@ -10,7 +8,6 @@ declare void @test1_1(i8* %x1_1, i8* readonly %y1_1, ...) ; NOTE: readonly for %y1_2 would be OK here but not for the similar situation in test13. -; ;. ; CHECK: @[[X:[a-zA-Z0-9_$"\\.-]+]] = global i32 0 ; CHECK: @[[CONSTANT_MEM:[a-zA-Z0-9_$"\\.-]+]] = external dso_local constant i32, align 4 @@ -28,34 +25,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]] +; MODULE: Function Attrs: nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@test2 +; MODULE-SAME: (i8* nofree readnone returned "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: store i32 0, i32* @x, align 4 +; MODULE-NEXT: ret i8* [[P]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@test2 +; CGSCC-SAME: (i8* nofree readnone returned "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: store i32 0, i32* @x, align 4 +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test3 +; MODULE-SAME: (i8* nofree readnone [[P:%.*]], i8* nofree readnone [[Q:%.*]]) #[[ATTR1:[0-9]+]] { +; MODULE-NEXT: [[A:%.*]] = icmp ult i8* [[P]], [[Q]] +; MODULE-NEXT: ret i1 [[A]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test3 +; CGSCC-SAME: (i8* nofree readnone [[P:%.*]], i8* nofree readnone [[Q:%.*]]) #[[ATTR1:[0-9]+]] { +; CGSCC-NEXT: [[A:%.*]] = icmp ult i8* [[P]], [[Q]] +; CGSCC-NEXT: ret i1 [[A]] ; %A = icmp ult i8* %p, %q ret i1 %A @@ -76,17 +73,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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@test5 +; MODULE-SAME: (i8** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[P:%.*]], i8* nofree writeonly [[Q:%.*]]) #[[ATTR3:[0-9]+]] { +; MODULE-NEXT: store i8* [[Q]], i8** [[P]], align 8 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@test5 +; CGSCC-SAME: (i8** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[P:%.*]], i8* nofree writeonly [[Q:%.*]]) #[[ATTR3:[0-9]+]] { +; CGSCC-NEXT: store i8* [[Q]], i8** [[P]], align 8 +; CGSCC-NEXT: ret void ; store i8* %q, i8** %p ret void @@ -108,50 +105,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test7_1 +; MODULE-SAME: (i32* nocapture nofree nonnull writeonly inalloca(i32) dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test7_1 +; CGSCC-SAME: (i32* nocapture nofree nonnull writeonly inalloca(i32) dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test8_1 +; MODULE-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: ret i32* [[P]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test8_1 +; CGSCC-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: entry: +; CGSCC-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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@test8_2 +; MODULE-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR3]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: store i32 10, i32* [[P]], align 4 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@test8_2 +; CGSCC-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR3]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: store i32 10, i32* [[P]], align 4 +; CGSCC-NEXT: ret void ; entry: %call = call i32* @test8_1(i32* %p) @@ -165,17 +162,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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@test9 +; MODULE-SAME: (<4 x i32*> [[PTRS:%.*]], <4 x i32> [[VAL:%.*]]) #[[ATTR0]] { +; MODULE-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]+]] +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@test9 +; CGSCC-SAME: (<4 x i32*> [[PTRS:%.*]], <4 x i32> [[VAL:%.*]]) #[[ATTR4:[0-9]+]] { +; 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]+]] +; CGSCC-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 +181,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]] +; MODULE: Function Attrs: nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@test10 +; MODULE-SAME: (<4 x i32*> [[PTRS:%.*]]) #[[ATTR4:[0-9]+]] { +; MODULE-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]+]] +; MODULE-NEXT: ret <4 x i32> [[RES]] +; +; CGSCC: Function Attrs: nofree nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@test10 +; CGSCC-SAME: (<4 x i32*> [[PTRS:%.*]]) #[[ATTR5:[0-9]+]] { +; 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]+]] +; CGSCC-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 +200,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]] +; MODULE: Function Attrs: argmemonly nounwind readonly +; MODULE-LABEL: define {{[^@]+}}@test11_2 +; MODULE-SAME: (<4 x i32*> [[PTRS:%.*]]) #[[ATTR5:[0-9]+]] { +; MODULE-NEXT: [[RES:%.*]] = call <4 x i32> @test11_1(<4 x i32*> [[PTRS]]) #[[ATTR9:[0-9]+]] +; MODULE-NEXT: ret <4 x i32> [[RES]] +; +; CGSCC: Function Attrs: argmemonly nounwind readonly +; CGSCC-LABEL: define {{[^@]+}}@test11_2 +; CGSCC-SAME: (<4 x i32*> [[PTRS:%.*]]) #[[ATTR6:[0-9]+]] { +; CGSCC-NEXT: [[RES:%.*]] = call <4 x i32> @test11_1(<4 x i32*> [[PTRS]]) #[[ATTR10:[0-9]+]] +; CGSCC-NEXT: ret <4 x i32> [[RES]] ; %res = call <4 x i32> @test11_1(<4 x i32*> %ptrs) ret <4 x i32> %res @@ -222,34 +219,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]] +; MODULE: Function Attrs: argmemonly nounwind +; MODULE-LABEL: define {{[^@]+}}@test12_2 +; MODULE-SAME: (<4 x i32*> [[PTRS:%.*]]) #[[ATTR6:[0-9]+]] { +; MODULE-NEXT: [[RES:%.*]] = call <4 x i32> @test12_1(<4 x i32*> [[PTRS]]) #[[ATTR12:[0-9]+]] +; MODULE-NEXT: ret <4 x i32> [[RES]] +; +; CGSCC: Function Attrs: argmemonly nounwind +; CGSCC-LABEL: define {{[^@]+}}@test12_2 +; CGSCC-SAME: (<4 x i32*> [[PTRS:%.*]]) #[[ATTR7:[0-9]+]] { +; CGSCC-NEXT: [[RES:%.*]] = call <4 x i32> @test12_1(<4 x i32*> [[PTRS]]) #[[ATTR13:[0-9]+]] +; CGSCC-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]] +; MODULE: Function Attrs: argmemonly nofree nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@volatile_load +; MODULE-SAME: (i32* nofree noundef align 4 [[P:%.*]]) #[[ATTR7:[0-9]+]] { +; MODULE-NEXT: [[LOAD:%.*]] = load volatile i32, i32* [[P]], align 4 +; MODULE-NEXT: ret i32 [[LOAD]] +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@volatile_load +; CGSCC-SAME: (i32* nofree noundef align 4 [[P:%.*]]) #[[ATTR8:[0-9]+]] { +; CGSCC-NEXT: [[LOAD:%.*]] = load volatile i32, i32* [[P]], align 4 +; CGSCC-NEXT: ret i32 [[LOAD]] ; %load = load volatile i32, i32* %p ret i32 %load @@ -262,7 +259,6 @@ ; though the only direct use, in @escape_readnone_ptr/@escape_readonly_ptr, ; is marked as readnone/only. However, the functions can write the pointer into ; %addr, causing the store to write to %escaped_then_written. -; define void @unsound_readnone(i8* %ignored, i8* %escaped_then_written) { ; CHECK-LABEL: define {{[^@]+}}@unsound_readnone ; CHECK-SAME: (i8* nocapture nofree readnone [[IGNORED:%.*]], i8* [[ESCAPED_THEN_WRITTEN:%.*]]) { @@ -296,7 +292,6 @@ } ; Byval but not readonly/none tests -; ;{ declare void @escape_i8(i8* %ptr) @@ -312,87 +307,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@byval_not_readonly_2 +; MODULE-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: store i8 0, i8* [[WRITTEN]], align 1 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@byval_not_readonly_2 +; CGSCC-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: store i8 0, i8* [[WRITTEN]], align 1 +; CGSCC-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 +; MODULE: Function Attrs: readnone +; MODULE-LABEL: define {{[^@]+}}@byval_not_readnone_1 +; MODULE-SAME: (i8* noalias nonnull byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR8:[0-9]+]] { +; MODULE-NEXT: call void @escape_i8(i8* nonnull dereferenceable(1) [[WRITTEN]]) +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: readnone +; CGSCC-LABEL: define {{[^@]+}}@byval_not_readnone_1 +; CGSCC-SAME: (i8* noalias nonnull byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR9:[0-9]+]] { +; CGSCC-NEXT: call void @escape_i8(i8* nonnull dereferenceable(1) [[WRITTEN]]) +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@byval_not_readnone_2 +; MODULE-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: store i8 0, i8* [[WRITTEN]], align 1 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@byval_not_readnone_2 +; CGSCC-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: store i8 0, i8* [[WRITTEN]], align 1 +; CGSCC-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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@byval_no_fnarg +; MODULE-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR3]] { +; MODULE-NEXT: store i8 0, i8* [[WRITTEN]], align 1 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@byval_no_fnarg +; CGSCC-SAME: (i8* noalias nocapture nofree noundef nonnull writeonly byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR3]] { +; CGSCC-NEXT: store i8 0, i8* [[WRITTEN]], align 1 +; CGSCC-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 +; MODULE-LABEL: define {{[^@]+}}@testbyval +; MODULE-SAME: (i8* nocapture readonly [[READ_ONLY:%.*]]) { +; MODULE-NEXT: call void @byval_not_readonly_1(i8* nocapture readonly byval(i8) [[READ_ONLY]]) #[[ATTR2]] +; MODULE-NEXT: call void @byval_not_readnone_1(i8* noalias nocapture readnone byval(i8) [[READ_ONLY]]) +; MODULE-NEXT: call void @byval_no_fnarg(i8* nocapture nofree readonly byval(i8) [[READ_ONLY]]) #[[ATTR13:[0-9]+]] +; MODULE-NEXT: ret void +; +; CGSCC-LABEL: define {{[^@]+}}@testbyval +; CGSCC-SAME: (i8* nocapture noundef nonnull readonly dereferenceable(1) [[READ_ONLY:%.*]]) { +; CGSCC-NEXT: call void @byval_not_readonly_1(i8* noalias nocapture noundef nonnull readonly byval(i8) dereferenceable(1) [[READ_ONLY]]) #[[ATTR2]] +; CGSCC-NEXT: call void @byval_not_readnone_1(i8* noalias nocapture noundef nonnull readnone byval(i8) dereferenceable(1) [[READ_ONLY]]) +; CGSCC-NEXT: call void @byval_no_fnarg(i8* noalias nocapture nofree noundef nonnull readnone byval(i8) dereferenceable(1) [[READ_ONLY]]) #[[ATTR14:[0-9]+]] +; CGSCC-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 +403,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 +; MODULE: Function Attrs: nounwind readonly +; MODULE-LABEL: define {{[^@]+}}@ptr_uses +; MODULE-SAME: (i8* nocapture readonly [[PTR:%.*]]) #[[ATTR9]] { +; MODULE-NEXT: [[CALL_PTR:%.*]] = call i8* @maybe_returned_ptr(i8* readonly [[PTR]]) #[[ATTR9]] +; MODULE-NEXT: [[CALL_VAL:%.*]] = call i8 @maybe_returned_val(i8* readonly [[CALL_PTR]]) #[[ATTR9]] +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nounwind readonly +; CGSCC-LABEL: define {{[^@]+}}@ptr_uses +; CGSCC-SAME: (i8* nocapture readonly [[PTR:%.*]]) #[[ATTR10]] { +; CGSCC-NEXT: [[CALL_PTR:%.*]] = call i8* @maybe_returned_ptr(i8* readonly [[PTR]]) #[[ATTR10]] +; CGSCC-NEXT: [[CALL_VAL:%.*]] = call i8 @maybe_returned_val(i8* readonly [[CALL_PTR]]) #[[ATTR10]] +; CGSCC-NEXT: ret void ; %call_ptr = call i8* @maybe_returned_ptr(i8* %ptr) %call_val = call i8 @maybe_returned_val(i8* %call_ptr) @@ -458,50 +453,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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@read_only_constant_mem +; MODULE-SAME: () #[[ATTR1]] { +; MODULE-NEXT: [[L:%.*]] = load i32, i32* @constant_mem, align 4 +; MODULE-NEXT: ret i32 [[L]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@read_only_constant_mem +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-NEXT: [[L:%.*]] = load i32, i32* @constant_mem, align 4 +; CGSCC-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 } +; MODULE: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn writeonly } +; MODULE: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR2]] = { readonly } +; MODULE: attributes #[[ATTR3]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; MODULE: attributes #[[ATTR4]] = { nofree nosync nounwind readonly willreturn } +; MODULE: attributes #[[ATTR5]] = { argmemonly nounwind readonly } +; MODULE: attributes #[[ATTR6]] = { argmemonly nounwind } +; MODULE: attributes #[[ATTR7]] = { argmemonly nofree nounwind willreturn } +; MODULE: attributes #[[ATTR8]] = { readnone } +; MODULE: attributes #[[ATTR9]] = { nounwind readonly } +; MODULE: attributes #[[ATTR10]] = { willreturn writeonly } +; MODULE: attributes #[[ATTR11]] = { readonly willreturn } +; MODULE: attributes #[[ATTR12]] = { nounwind } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind willreturn writeonly } +; CGSCC: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR2]] = { readonly } +; CGSCC: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; CGSCC: attributes #[[ATTR4]] = { nofree nosync nounwind willreturn writeonly } +; CGSCC: attributes #[[ATTR5]] = { nofree nosync nounwind readonly willreturn } +; CGSCC: attributes #[[ATTR6]] = { argmemonly nounwind readonly } +; CGSCC: attributes #[[ATTR7]] = { argmemonly nounwind } +; CGSCC: attributes #[[ATTR8]] = { argmemonly nofree norecurse nounwind willreturn } +; CGSCC: attributes #[[ATTR9]] = { readnone } +; CGSCC: attributes #[[ATTR10]] = { nounwind readonly } +; CGSCC: attributes #[[ATTR11]] = { willreturn writeonly } +; CGSCC: attributes #[[ATTR12]] = { readonly willreturn } +; CGSCC: attributes #[[ATTR13]] = { nounwind } +; CGSCC: 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,26 +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=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 -; +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; Test cases specifically designed for the "returned" argument attribute. ; We use FIXME's to indicate problems and missing attributes. -; ; TEST SCC test returning an integer value argument -; ; int scc_r1(int a, int b, int r); ; int scc_r2(int a, int b, int r); -; ; __attribute__((noinline)) int sink_r0(int r) { ; return r; ; } -; ; __attribute__((noinline)) int scc_r1(int a, int r, int b) { ; return scc_r2(r, a, sink_r0(r)); ; } -; ; __attribute__((noinline)) int scc_r2(int a, int b, int r) { ; if (a > b) ; return scc_r2(b, a, sink_r0(r)); @@ -43,36 +35,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]] +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@sink_r0 +; MODULE-SAME: (i32 returned [[R:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: ret i32 [[R]] +; +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@sink_r0 +; CGSCC-SAME: (i32 returned [[R:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-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]] +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; MODULE-LABEL: define {{[^@]+}}@scc_r1 +; MODULE-SAME: (i32 [[A:%.*]], i32 returned [[R:%.*]], i32 [[B:%.*]]) #[[ATTR1:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[A]], i32 [[R]]) #[[ATTR6:[0-9]+]] +; MODULE-NEXT: ret i32 [[R]] +; +; CGSCC: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@scc_r1 +; CGSCC-SAME: (i32 [[A:%.*]], i32 returned [[R:%.*]], i32 [[B:%.*]]) #[[ATTR1:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[A]], i32 [[R]]) #[[ATTR7:[0-9]+]] +; CGSCC-NEXT: ret i32 [[R]] ; entry: %call = call i32 @sink_r0(i32 %r) @@ -81,75 +73,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]] +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; MODULE-LABEL: define {{[^@]+}}@scc_r2 +; MODULE-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 returned [[R:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], [[B]] +; MODULE-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; MODULE: if.then: +; MODULE-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[R]]) #[[ATTR6]] +; MODULE-NEXT: br label [[RETURN:%.*]] +; MODULE: if.end: +; MODULE-NEXT: [[CMP2:%.*]] = icmp slt i32 [[A]], [[B]] +; MODULE-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] +; MODULE: if.then3: +; MODULE-NEXT: [[CALL5:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR6]] +; MODULE-NEXT: [[CALL6:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[R]], i32 [[R]]) #[[ATTR6]] +; MODULE-NEXT: [[CALL7:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[R]], i32 undef) #[[ATTR6]] +; MODULE-NEXT: [[CALL8:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR6]] +; MODULE-NEXT: [[CALL9:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[R]], i32 [[R]]) #[[ATTR6]] +; MODULE-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[B]], i32 [[R]], i32 undef) #[[ATTR6]] +; MODULE-NEXT: br label [[RETURN]] +; MODULE: if.end12: +; MODULE-NEXT: [[CMP13:%.*]] = icmp eq i32 [[A]], [[B]] +; MODULE-NEXT: br i1 [[CMP13]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] +; MODULE: cond.true: +; MODULE-NEXT: br label [[COND_END:%.*]] +; MODULE: cond.false: +; MODULE-NEXT: [[CALL14:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR6]] +; MODULE-NEXT: br label [[COND_END]] +; MODULE: cond.end: +; MODULE-NEXT: [[COND:%.*]] = phi i32 [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] +; MODULE-NEXT: br label [[RETURN]] +; MODULE: return: +; MODULE-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[R]], [[IF_THEN]] ], [ [[R]], [[IF_THEN3]] ], [ [[COND]], [[COND_END]] ] +; MODULE-NEXT: ret i32 [[R]] +; +; CGSCC: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@scc_r2 +; CGSCC-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 returned [[R:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], [[B]] +; CGSCC-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; CGSCC: if.then: +; CGSCC-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[R]]) #[[ATTR7]] +; CGSCC-NEXT: br label [[RETURN:%.*]] +; CGSCC: if.end: +; CGSCC-NEXT: [[CMP2:%.*]] = icmp slt i32 [[A]], [[B]] +; CGSCC-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] +; CGSCC: if.then3: +; CGSCC-NEXT: [[CALL5:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR7]] +; CGSCC-NEXT: [[CALL6:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[R]], i32 [[R]]) #[[ATTR7]] +; CGSCC-NEXT: [[CALL7:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[R]], i32 undef) #[[ATTR7]] +; CGSCC-NEXT: [[CALL8:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR7]] +; CGSCC-NEXT: [[CALL9:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[R]], i32 [[R]]) #[[ATTR7]] +; CGSCC-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[B]], i32 [[R]], i32 undef) #[[ATTR7]] +; CGSCC-NEXT: br label [[RETURN]] +; CGSCC: if.end12: +; CGSCC-NEXT: [[CMP13:%.*]] = icmp eq i32 [[A]], [[B]] +; CGSCC-NEXT: br i1 [[CMP13]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] +; CGSCC: cond.true: +; CGSCC-NEXT: br label [[COND_END:%.*]] +; CGSCC: cond.false: +; CGSCC-NEXT: [[CALL14:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR7]] +; CGSCC-NEXT: br label [[COND_END]] +; CGSCC: cond.end: +; CGSCC-NEXT: [[COND:%.*]] = phi i32 [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] +; CGSCC-NEXT: br label [[RETURN]] +; CGSCC: return: +; CGSCC-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[R]], [[IF_THEN]] ], [ [[R]], [[IF_THEN3]] ], [ [[COND]], [[COND_END]] ] +; CGSCC-NEXT: ret i32 [[R]] ; entry: %cmp = icmp sgt i32 %a, %b @@ -196,67 +188,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]] +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; MODULE-LABEL: define {{[^@]+}}@scc_rX +; MODULE-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[R:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], [[B]] +; MODULE-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; MODULE: if.then: +; MODULE-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[R]]) #[[ATTR6]] +; MODULE-NEXT: br label [[RETURN:%.*]] +; MODULE: if.end: +; MODULE-NEXT: [[CMP2:%.*]] = icmp slt i32 [[A]], [[B]] +; MODULE-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] +; MODULE: if.then3: +; MODULE-NEXT: [[CALL5:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR6]] +; MODULE-NEXT: [[CALL6:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[R]], i32 [[R]]) #[[ATTR6]] +; MODULE-NEXT: [[CALL7:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[R]], i32 undef) #[[ATTR6]] +; MODULE-NEXT: [[CALL8:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR6]] +; MODULE-NEXT: [[CALL9:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[R]], i32 [[B]]) #[[ATTR6]] +; MODULE-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[B]], i32 [[B]], i32 undef) #[[ATTR6]] +; MODULE-NEXT: br label [[RETURN]] +; MODULE: if.end12: +; MODULE-NEXT: [[CMP13:%.*]] = icmp eq i32 [[A]], [[B]] +; MODULE-NEXT: br i1 [[CMP13]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] +; MODULE: cond.true: +; MODULE-NEXT: br label [[COND_END:%.*]] +; MODULE: cond.false: +; MODULE-NEXT: [[CALL14:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR6]] +; MODULE-NEXT: br label [[COND_END]] +; MODULE: cond.end: +; MODULE-NEXT: [[COND:%.*]] = phi i32 [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] +; MODULE-NEXT: br label [[RETURN]] +; MODULE: return: +; MODULE-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[R]], [[IF_THEN]] ], [ [[B]], [[IF_THEN3]] ], [ [[COND]], [[COND_END]] ] +; MODULE-NEXT: ret i32 [[RETVAL_0]] +; +; CGSCC: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@scc_rX +; CGSCC-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[R:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], [[B]] +; CGSCC-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; CGSCC: if.then: +; CGSCC-NEXT: br label [[RETURN:%.*]] +; CGSCC: if.end: +; CGSCC-NEXT: [[CMP2:%.*]] = icmp slt i32 [[A]], [[B]] +; CGSCC-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] +; CGSCC: if.then3: +; CGSCC-NEXT: br label [[RETURN]] +; CGSCC: if.end12: +; CGSCC-NEXT: [[CMP13:%.*]] = icmp eq i32 [[A]], [[B]] +; CGSCC-NEXT: br i1 [[CMP13]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] +; CGSCC: cond.true: +; CGSCC-NEXT: br label [[COND_END:%.*]] +; CGSCC: cond.false: +; CGSCC-NEXT: br label [[COND_END]] +; CGSCC: cond.end: +; CGSCC-NEXT: [[COND:%.*]] = phi i32 [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] +; CGSCC-NEXT: br label [[RETURN]] +; CGSCC: return: +; CGSCC-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[R]], [[IF_THEN]] ], [ [[B]], [[IF_THEN3]] ], [ [[COND]], [[COND_END]] ] +; CGSCC-NEXT: ret i32 [[RETVAL_0]] ; entry: %cmp = icmp sgt i32 %a, %b @@ -304,18 +296,14 @@ ; TEST SCC test returning a pointer value argument -; ; double* ptr_scc_r1(double* a, double* b, double* r); ; double* ptr_scc_r2(double* a, double* b, double* r); -; ; __attribute__((noinline)) double* ptr_sink_r0(double* r) { ; return r; ; } -; ; __attribute__((noinline)) double* ptr_scc_r1(double* a, double* r, double* b) { ; return ptr_scc_r2(r, a, ptr_sink_r0(r)); ; } -; ; __attribute__((noinline)) double* ptr_scc_r2(double* a, double* b, double* r) { ; if (a > b) ; return ptr_scc_r2(b, a, ptr_sink_r0(r)); @@ -324,36 +312,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]] +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@ptr_sink_r0 +; MODULE-SAME: (double* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: ret double* [[R]] +; +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@ptr_sink_r0 +; CGSCC-SAME: (double* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-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]] +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; MODULE-LABEL: define {{[^@]+}}@ptr_scc_r1 +; MODULE-SAME: (double* nocapture nofree readnone [[A:%.*]], double* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]], double* nocapture nofree readnone [[B:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: entry: +; MODULE-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]] +; MODULE-NEXT: ret double* [[R]] +; +; CGSCC: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; CGSCC-LABEL: define {{[^@]+}}@ptr_scc_r1 +; CGSCC-SAME: (double* nocapture nofree readnone [[A:%.*]], double* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]], double* nocapture nofree readnone [[B:%.*]]) #[[ATTR2:[0-9]+]] { +; CGSCC-NEXT: entry: +; 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]] +; CGSCC-NEXT: ret double* [[R]] ; entry: %call = call double* @ptr_sink_r0(double* %r) @@ -362,75 +350,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]] +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; MODULE-LABEL: define {{[^@]+}}@ptr_scc_r2 +; MODULE-SAME: (double* nocapture nofree readnone [[A:%.*]], double* nocapture nofree readnone [[B:%.*]], double* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[CMP:%.*]] = icmp ugt double* [[A]], [[B]] +; MODULE-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; MODULE: if.then: +; MODULE-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]] +; MODULE-NEXT: br label [[RETURN:%.*]] +; MODULE: if.end: +; MODULE-NEXT: [[CMP2:%.*]] = icmp ult double* [[A]], [[B]] +; MODULE-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] +; MODULE: if.then3: +; MODULE-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]] +; MODULE-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]] +; MODULE-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]] +; MODULE-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]] +; MODULE-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]] +; MODULE-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]] +; MODULE-NEXT: br label [[RETURN]] +; MODULE: if.end12: +; MODULE-NEXT: [[CMP13:%.*]] = icmp eq double* [[A]], [[B]] +; MODULE-NEXT: br i1 [[CMP13]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] +; MODULE: cond.true: +; MODULE-NEXT: br label [[COND_END:%.*]] +; MODULE: cond.false: +; MODULE-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]] +; MODULE-NEXT: br label [[COND_END]] +; MODULE: cond.end: +; MODULE-NEXT: [[COND:%.*]] = phi double* [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] +; MODULE-NEXT: br label [[RETURN]] +; MODULE: return: +; MODULE-NEXT: [[RETVAL_0:%.*]] = phi double* [ [[R]], [[IF_THEN]] ], [ [[R]], [[IF_THEN3]] ], [ [[COND]], [[COND_END]] ] +; MODULE-NEXT: ret double* [[R]] +; +; CGSCC: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; CGSCC-LABEL: define {{[^@]+}}@ptr_scc_r2 +; CGSCC-SAME: (double* nocapture nofree readnone [[A:%.*]], double* nocapture nofree readnone [[B:%.*]], double* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[CMP:%.*]] = icmp ugt double* [[A]], [[B]] +; CGSCC-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; CGSCC: if.then: +; 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]] +; CGSCC-NEXT: br label [[RETURN:%.*]] +; CGSCC: if.end: +; CGSCC-NEXT: [[CMP2:%.*]] = icmp ult double* [[A]], [[B]] +; CGSCC-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] +; CGSCC: if.then3: +; 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]] +; 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]] +; 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]] +; 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]] +; 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]] +; 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]] +; CGSCC-NEXT: br label [[RETURN]] +; CGSCC: if.end12: +; CGSCC-NEXT: [[CMP13:%.*]] = icmp eq double* [[A]], [[B]] +; CGSCC-NEXT: br i1 [[CMP13]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] +; CGSCC: cond.true: +; CGSCC-NEXT: br label [[COND_END:%.*]] +; CGSCC: cond.false: +; 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]] +; CGSCC-NEXT: br label [[COND_END]] +; CGSCC: cond.end: +; CGSCC-NEXT: [[COND:%.*]] = phi double* [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] +; CGSCC-NEXT: br label [[RETURN]] +; CGSCC: return: +; CGSCC-NEXT: [[RETVAL_0:%.*]] = phi double* [ [[R]], [[IF_THEN]] ], [ [[R]], [[IF_THEN3]] ], [ [[COND]], [[COND_END]] ] +; CGSCC-NEXT: ret double* [[R]] ; entry: %cmp = icmp ugt double* %a, %b @@ -478,23 +466,21 @@ ; TEST a no-return singleton SCC -; ; int* rt0(int *a) { ; return *a ? a : rt0(a); ; } -; 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 +; MODULE: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@rt0 +; MODULE-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: unreachable +; +; CGSCC: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@rt0 +; CGSCC-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR3:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: unreachable ; entry: %v = load i32, i32* %a, align 4 @@ -505,23 +491,21 @@ } ; TEST a no-return singleton SCC -; ; int* rt1(int *a) { ; return *a ? undef : rt1(a); ; } -; 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 +; MODULE: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@rt1 +; MODULE-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: unreachable +; +; CGSCC: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@rt1 +; CGSCC-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR3]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: unreachable ; entry: %v = load i32, i32* %a, align 4 @@ -532,21 +516,20 @@ } ; 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]] +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; MODULE-LABEL: define {{[^@]+}}@rt2_helper +; MODULE-SAME: (i32* nofree readnone returned [[A:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[CALL:%.*]] = call i32* @rt2(i32* noalias nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[A]]) #[[ATTR6]] +; MODULE-NEXT: ret i32* [[A]] +; +; CGSCC: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; CGSCC-LABEL: define {{[^@]+}}@rt2_helper +; CGSCC-SAME: (i32* nofree readnone returned [[A:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[CALL:%.*]] = call i32* @rt2(i32* noalias nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[A]]) #[[ATTR7]] +; CGSCC-NEXT: ret i32* [[A]] ; entry: %call = call i32* @rt2(i32* %a, i32* %a) @@ -554,31 +537,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]] +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; MODULE-LABEL: define {{[^@]+}}@rt2 +; MODULE-SAME: (i32* nofree readnone [[A:%.*]], i32* nofree readnone "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[CMP:%.*]] = icmp eq i32* [[A]], null +; MODULE-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; MODULE: if.then: +; MODULE-NEXT: [[CALL:%.*]] = call i32* @rt2_helper(i32* noalias nofree readnone [[A]]) #[[ATTR6]] +; MODULE-NEXT: br label [[IF_END]] +; MODULE: if.end: +; MODULE-NEXT: [[SEL:%.*]] = phi i32* [ [[B]], [[ENTRY:%.*]] ], [ [[A]], [[IF_THEN]] ] +; MODULE-NEXT: ret i32* [[SEL]] +; +; CGSCC: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; CGSCC-LABEL: define {{[^@]+}}@rt2 +; CGSCC-SAME: (i32* nofree readnone [[A:%.*]], i32* nofree readnone "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[CMP:%.*]] = icmp eq i32* [[A]], null +; CGSCC-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; CGSCC: if.then: +; CGSCC-NEXT: [[CALL:%.*]] = call i32* @rt2_helper(i32* noalias nofree readnone [[A]]) #[[ATTR7]] +; CGSCC-NEXT: br label [[IF_END]] +; CGSCC: if.end: +; CGSCC-NEXT: [[SEL:%.*]] = phi i32* [ [[B]], [[ENTRY:%.*]] ], [ [[A]], [[IF_THEN]] ] +; CGSCC-NEXT: ret i32* [[SEL]] ; entry: %cmp = icmp eq i32* %a, null @@ -594,21 +577,20 @@ } ; 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]] +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; MODULE-LABEL: define {{[^@]+}}@rt3_helper +; MODULE-SAME: (i32* nocapture nofree readnone [[A:%.*]], i32* nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[CALL:%.*]] = call i32* @rt3(i32* noalias nocapture nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR6]] +; MODULE-NEXT: ret i32* [[B]] +; +; CGSCC: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; CGSCC-LABEL: define {{[^@]+}}@rt3_helper +; CGSCC-SAME: (i32* nocapture nofree readnone [[A:%.*]], i32* nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[CALL:%.*]] = call i32* @rt3(i32* noalias nocapture nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR7]] +; CGSCC-NEXT: ret i32* [[B]] ; entry: %call = call i32* @rt3(i32* %a, i32* %b) @@ -616,31 +598,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]] +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; MODULE-LABEL: define {{[^@]+}}@rt3 +; MODULE-SAME: (i32* nocapture nofree readnone [[A:%.*]], i32* nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[CMP:%.*]] = icmp eq i32* [[A]], null +; MODULE-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; MODULE: if.then: +; MODULE-NEXT: [[CALL:%.*]] = call i32* @rt3_helper(i32* noalias nocapture nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR6]] +; MODULE-NEXT: br label [[IF_END]] +; MODULE: if.end: +; MODULE-NEXT: [[SEL:%.*]] = phi i32* [ [[B]], [[ENTRY:%.*]] ], [ [[B]], [[IF_THEN]] ] +; MODULE-NEXT: ret i32* [[B]] +; +; CGSCC: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; CGSCC-LABEL: define {{[^@]+}}@rt3 +; CGSCC-SAME: (i32* nocapture nofree readnone [[A:%.*]], i32* nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[CMP:%.*]] = icmp eq i32* [[A]], null +; CGSCC-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; CGSCC: if.then: +; CGSCC-NEXT: [[CALL:%.*]] = call i32* @rt3_helper(i32* noalias nocapture nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR7]] +; CGSCC-NEXT: br label [[IF_END]] +; CGSCC: if.end: +; CGSCC-NEXT: [[SEL:%.*]] = phi i32* [ [[B]], [[ENTRY:%.*]] ], [ [[B]], [[IF_THEN]] ] +; CGSCC-NEXT: ret i32* [[B]] ; entry: %cmp = icmp eq i32* %a, null @@ -656,28 +638,25 @@ } ; TEST address taken function with call to an external functions -; ; void unknown_fn(void *); -; ; int* calls_unknown_fn(int *r) { ; unknown_fn(&calls_unknown_fn); ; return r; ; } -; 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]] +; MODULE: Function Attrs: noinline nounwind uwtable +; MODULE-LABEL: define {{[^@]+}}@calls_unknown_fn +; MODULE-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR3:[0-9]+]] { +; MODULE-NEXT: tail call void @unknown_fn(i32* (i32*)* noundef nonnull @calls_unknown_fn) #[[ATTR7:[0-9]+]] +; MODULE-NEXT: ret i32* [[R]] +; +; CGSCC: Function Attrs: noinline nounwind uwtable +; CGSCC-LABEL: define {{[^@]+}}@calls_unknown_fn +; CGSCC-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR4:[0-9]+]] { +; CGSCC-NEXT: tail call void @unknown_fn(i32* (i32*)* noundef nonnull @calls_unknown_fn) #[[ATTR8:[0-9]+]] +; CGSCC-NEXT: ret i32* [[R]] ; tail call void @unknown_fn(i32* (i32*)* nonnull @calls_unknown_fn) ret i32* %r @@ -685,49 +664,45 @@ ; TEST call to a function that might be redifined at link time -; ; int *maybe_redefined_fn(int *r) { ; return r; ; } -; ; int *calls_maybe_redefined_fn(int *r) { ; maybe_redefined_fn(r); ; return r; ; } -; ; 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]] +; MODULE: Function Attrs: noinline nounwind uwtable +; MODULE-LABEL: define {{[^@]+}}@maybe_redefined_fn +; MODULE-SAME: (i32* [[R:%.*]]) #[[ATTR3]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: ret i32* [[R]] +; +; CGSCC: Function Attrs: noinline nounwind uwtable +; CGSCC-LABEL: define {{[^@]+}}@maybe_redefined_fn +; CGSCC-SAME: (i32* [[R:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: entry: +; CGSCC-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]] +; MODULE: Function Attrs: noinline nounwind uwtable +; MODULE-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn +; MODULE-SAME: (i32* returned [[R:%.*]]) #[[ATTR3]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn(i32* [[R]]) #[[ATTR7]] +; MODULE-NEXT: ret i32* [[R]] +; +; CGSCC: Function Attrs: noinline nounwind uwtable +; CGSCC-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn +; CGSCC-SAME: (i32* returned [[R:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn(i32* [[R]]) #[[ATTR8]] +; CGSCC-NEXT: ret i32* [[R]] ; entry: %call = call i32* @maybe_redefined_fn(i32* %r) @@ -735,48 +710,44 @@ } ; TEST return call to a function that might be redifined at link time -; ; int *maybe_redefined_fn2(int *r) { ; return r; ; } -; ; int *calls_maybe_redefined_fn2(int *r) { ; return maybe_redefined_fn2(r); ; } -; ; 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]] +; MODULE: Function Attrs: noinline nounwind uwtable +; MODULE-LABEL: define {{[^@]+}}@maybe_redefined_fn2 +; MODULE-SAME: (i32* [[R:%.*]]) #[[ATTR3]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: ret i32* [[R]] +; +; CGSCC: Function Attrs: noinline nounwind uwtable +; CGSCC-LABEL: define {{[^@]+}}@maybe_redefined_fn2 +; CGSCC-SAME: (i32* [[R:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: entry: +; CGSCC-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]] +; MODULE: Function Attrs: noinline nounwind uwtable +; MODULE-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn2 +; MODULE-SAME: (i32* [[R:%.*]]) #[[ATTR3]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn2(i32* [[R]]) #[[ATTR7]] +; MODULE-NEXT: ret i32* [[CALL]] +; +; CGSCC: Function Attrs: noinline nounwind uwtable +; CGSCC-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn2 +; CGSCC-SAME: (i32* [[R:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn2(i32* [[R]]) #[[ATTR8]] +; CGSCC-NEXT: ret i32* [[CALL]] ; entry: %call = call i32* @maybe_redefined_fn2(i32* %r) @@ -785,36 +756,34 @@ ; TEST returned argument goes through select and phi -; ; double select_and_phi(double b) { ; double x = b; ; if (b > 0) ; x = b; ; return b == 0? b : x; ; } -; 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]] +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@select_and_phi +; MODULE-SAME: (double returned [[B:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[CMP:%.*]] = fcmp ogt double [[B]], 0.000000e+00 +; MODULE-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; MODULE: if.then: +; MODULE-NEXT: br label [[IF_END]] +; MODULE: if.end: +; MODULE-NEXT: ret double [[B]] +; +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@select_and_phi +; CGSCC-SAME: (double returned [[B:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[CMP:%.*]] = fcmp ogt double [[B]], 0.000000e+00 +; CGSCC-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; CGSCC: if.then: +; CGSCC-NEXT: br label [[IF_END]] +; CGSCC: if.end: +; CGSCC-NEXT: ret double [[B]] ; entry: %cmp = fcmp ogt double %b, 0.000000e+00 @@ -832,40 +801,38 @@ ; TEST returned argument goes through recursion, select, and phi -; ; double recursion_select_and_phi(int a, double b) { ; double x = b; ; if (a-- > 0) ; x = recursion_select_and_phi(a, b); ; return b == 0? b : x; ; } -; 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]] +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; MODULE-LABEL: define {{[^@]+}}@recursion_select_and_phi +; MODULE-SAME: (i32 [[A:%.*]], double returned [[B:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[DEC:%.*]] = add nsw i32 [[A]], -1 +; MODULE-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], 0 +; MODULE-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; MODULE: if.then: +; MODULE-NEXT: [[CALL:%.*]] = call double @recursion_select_and_phi(i32 [[DEC]], double [[B]]) #[[ATTR6]] +; MODULE-NEXT: br label [[IF_END]] +; MODULE: if.end: +; MODULE-NEXT: ret double [[B]] +; +; CGSCC: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; CGSCC-LABEL: define {{[^@]+}}@recursion_select_and_phi +; CGSCC-SAME: (i32 [[A:%.*]], double returned [[B:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[DEC:%.*]] = add nsw i32 [[A]], -1 +; CGSCC-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], 0 +; CGSCC-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; CGSCC: if.then: +; CGSCC-NEXT: [[CALL:%.*]] = call double @recursion_select_and_phi(i32 [[DEC]], double [[B]]) #[[ATTR7]] +; CGSCC-NEXT: br label [[IF_END]] +; CGSCC: if.end: +; CGSCC-NEXT: ret double [[B]] ; entry: %dec = add nsw i32 %a, -1 @@ -885,25 +852,23 @@ ; TEST returned argument goes through bitcasts -; ; double* bitcast(int* b) { ; return (double*)b; ; } -; 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]] +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@bitcast +; MODULE-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* +; MODULE-NEXT: ret double* [[BC0]] +; +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@bitcast +; CGSCC-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* +; CGSCC-NEXT: ret double* [[BC0]] ; entry: %bc0 = bitcast i32* %b to double* @@ -912,52 +877,50 @@ ; TEST returned argument goes through select and phi interleaved with bitcasts -; ; double* bitcasts_select_and_phi(int* b) { ; double* x = b; ; if (b == 0) ; x = b; ; return b != 0 ? b : x; ; } -; 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]] +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@bitcasts_select_and_phi +; MODULE-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* +; MODULE-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null +; MODULE-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; MODULE: if.then: +; MODULE-NEXT: [[BC1:%.*]] = bitcast i32* [[B]] to double* +; MODULE-NEXT: br label [[IF_END]] +; MODULE: if.end: +; MODULE-NEXT: [[PHI:%.*]] = phi double* [ [[BC1]], [[IF_THEN]] ], [ [[BC0]], [[ENTRY:%.*]] ] +; MODULE-NEXT: [[BC2:%.*]] = bitcast double* [[PHI]] to i8* +; MODULE-NEXT: [[BC3:%.*]] = bitcast i32* [[B]] to i8* +; MODULE-NEXT: [[CMP2:%.*]] = icmp ne double* [[BC0]], null +; MODULE-NEXT: [[SEL:%.*]] = select i1 [[CMP2]], i8* [[BC2]], i8* [[BC3]] +; MODULE-NEXT: [[BC4:%.*]] = bitcast i8* [[SEL]] to double* +; MODULE-NEXT: ret double* [[BC4]] +; +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@bitcasts_select_and_phi +; CGSCC-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* +; CGSCC-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null +; CGSCC-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] +; CGSCC: if.then: +; CGSCC-NEXT: [[BC1:%.*]] = bitcast i32* [[B]] to double* +; CGSCC-NEXT: br label [[IF_END]] +; CGSCC: if.end: +; CGSCC-NEXT: [[PHI:%.*]] = phi double* [ [[BC1]], [[IF_THEN]] ], [ [[BC0]], [[ENTRY:%.*]] ] +; CGSCC-NEXT: [[BC2:%.*]] = bitcast double* [[PHI]] to i8* +; CGSCC-NEXT: [[BC3:%.*]] = bitcast i32* [[B]] to i8* +; CGSCC-NEXT: [[CMP2:%.*]] = icmp ne double* [[BC0]], null +; CGSCC-NEXT: [[SEL:%.*]] = select i1 [[CMP2]], i8* [[BC2]], i8* [[BC3]] +; CGSCC-NEXT: [[BC4:%.*]] = bitcast i8* [[SEL]] to double* +; CGSCC-NEXT: ret double* [[BC4]] ; entry: %bc0 = bitcast i32* %b to double* @@ -980,7 +943,6 @@ ; TEST return argument or argument or undef -; ; double* ret_arg_arg_undef(int* b) { ; if (b == 0) ; return (double*)b; @@ -988,41 +950,40 @@ ; return (double*)b; ; /* return undef */ ; } -; 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 +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@ret_arg_arg_undef +; MODULE-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* +; MODULE-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null +; MODULE-NEXT: br i1 [[CMP]], label [[RET_ARG0:%.*]], label [[IF_END:%.*]] +; MODULE: ret_arg0: +; MODULE-NEXT: [[BC1:%.*]] = bitcast i32* [[B]] to double* +; MODULE-NEXT: ret double* [[BC1]] +; MODULE: if.end: +; MODULE-NEXT: br i1 [[CMP]], label [[RET_ARG1:%.*]], label [[RET_UNDEF:%.*]] +; MODULE: ret_arg1: +; MODULE-NEXT: ret double* [[BC0]] +; MODULE: ret_undef: +; MODULE-NEXT: ret double* undef +; +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@ret_arg_arg_undef +; CGSCC-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* +; CGSCC-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null +; CGSCC-NEXT: br i1 [[CMP]], label [[RET_ARG0:%.*]], label [[IF_END:%.*]] +; CGSCC: ret_arg0: +; CGSCC-NEXT: [[BC1:%.*]] = bitcast i32* [[B]] to double* +; CGSCC-NEXT: ret double* [[BC1]] +; CGSCC: if.end: +; CGSCC-NEXT: br i1 [[CMP]], label [[RET_ARG1:%.*]], label [[RET_UNDEF:%.*]] +; CGSCC: ret_arg1: +; CGSCC-NEXT: ret double* [[BC0]] +; CGSCC: ret_undef: +; CGSCC-NEXT: ret double* undef ; entry: %bc0 = bitcast i32* %b to double* @@ -1045,7 +1006,6 @@ ; TEST return undef or argument or argument -; ; double* ret_undef_arg_arg(int* b) { ; if (b == 0) ; return (double*)b; @@ -1053,41 +1013,40 @@ ; return (double*)b; ; /* return undef */ ; } -; 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]] +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@ret_undef_arg_arg +; MODULE-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* +; MODULE-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null +; MODULE-NEXT: br i1 [[CMP]], label [[RET_UNDEF:%.*]], label [[IF_END:%.*]] +; MODULE: ret_undef: +; MODULE-NEXT: ret double* undef +; MODULE: if.end: +; MODULE-NEXT: br i1 [[CMP]], label [[RET_ARG0:%.*]], label [[RET_ARG1:%.*]] +; MODULE: ret_arg0: +; MODULE-NEXT: ret double* [[BC0]] +; MODULE: ret_arg1: +; MODULE-NEXT: [[BC1:%.*]] = bitcast i32* [[B]] to double* +; MODULE-NEXT: ret double* [[BC1]] +; +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@ret_undef_arg_arg +; CGSCC-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* +; CGSCC-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null +; CGSCC-NEXT: br i1 [[CMP]], label [[RET_UNDEF:%.*]], label [[IF_END:%.*]] +; CGSCC: ret_undef: +; CGSCC-NEXT: ret double* undef +; CGSCC: if.end: +; CGSCC-NEXT: br i1 [[CMP]], label [[RET_ARG0:%.*]], label [[RET_ARG1:%.*]] +; CGSCC: ret_arg0: +; CGSCC-NEXT: ret double* [[BC0]] +; CGSCC: ret_arg1: +; CGSCC-NEXT: [[BC1:%.*]] = bitcast i32* [[B]] to double* +; CGSCC-NEXT: ret double* [[BC1]] ; entry: %bc0 = bitcast i32* %b to double* @@ -1110,7 +1069,6 @@ ; TEST return undef or argument or undef -; ; double* ret_undef_arg_undef(int* b) { ; if (b == 0) ; /* return undef */ @@ -1118,39 +1076,38 @@ ; return (double*)b; ; /* return undef */ ; } -; 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 +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@ret_undef_arg_undef +; MODULE-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* +; MODULE-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null +; MODULE-NEXT: br i1 [[CMP]], label [[RET_UNDEF0:%.*]], label [[IF_END:%.*]] +; MODULE: ret_undef0: +; MODULE-NEXT: ret double* undef +; MODULE: if.end: +; MODULE-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNDEF1:%.*]] +; MODULE: ret_arg: +; MODULE-NEXT: ret double* [[BC0]] +; MODULE: ret_undef1: +; MODULE-NEXT: ret double* undef +; +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@ret_undef_arg_undef +; CGSCC-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double* +; CGSCC-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null +; CGSCC-NEXT: br i1 [[CMP]], label [[RET_UNDEF0:%.*]], label [[IF_END:%.*]] +; CGSCC: ret_undef0: +; CGSCC-NEXT: ret double* undef +; CGSCC: if.end: +; CGSCC-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNDEF1:%.*]] +; CGSCC: ret_arg: +; CGSCC-NEXT: ret double* [[BC0]] +; CGSCC: ret_undef1: +; CGSCC-NEXT: ret double* undef ; entry: %bc0 = bitcast i32* %b to double* @@ -1171,41 +1128,38 @@ } ; TEST return argument or unknown call result -; ; int* ret_arg_or_unknown(int* b) { ; if (b == 0) ; return b; ; return unknown(); ; } -; ; Verify we do not assume b is returned -; 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]] +; MODULE: Function Attrs: noinline nounwind uwtable +; MODULE-LABEL: define {{[^@]+}}@ret_arg_or_unknown +; MODULE-SAME: (i32* [[B:%.*]]) #[[ATTR3]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null +; MODULE-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] +; MODULE: ret_arg: +; MODULE-NEXT: ret i32* [[B]] +; MODULE: ret_unknown: +; MODULE-NEXT: [[CALL:%.*]] = call i32* @unknown(i32* [[B]]) +; MODULE-NEXT: ret i32* [[CALL]] +; +; CGSCC: Function Attrs: noinline nounwind uwtable +; CGSCC-LABEL: define {{[^@]+}}@ret_arg_or_unknown +; CGSCC-SAME: (i32* [[B:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null +; CGSCC-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] +; CGSCC: ret_arg: +; CGSCC-NEXT: ret i32* [[B]] +; CGSCC: ret_unknown: +; CGSCC-NEXT: [[CALL:%.*]] = call i32* @unknown(i32* [[B]]) +; CGSCC-NEXT: ret i32* [[CALL]] ; entry: %cmp = icmp eq i32* %b, null @@ -1220,35 +1174,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]] +; MODULE: Function Attrs: noinline nounwind uwtable +; MODULE-LABEL: define {{[^@]+}}@ret_arg_or_unknown_through_phi +; MODULE-SAME: (i32* [[B:%.*]]) #[[ATTR3]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null +; MODULE-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] +; MODULE: ret_arg: +; MODULE-NEXT: br label [[R:%.*]] +; MODULE: ret_unknown: +; MODULE-NEXT: [[CALL:%.*]] = call i32* @unknown(i32* [[B]]) +; MODULE-NEXT: br label [[R]] +; MODULE: r: +; MODULE-NEXT: [[PHI:%.*]] = phi i32* [ [[B]], [[RET_ARG]] ], [ [[CALL]], [[RET_UNKNOWN]] ] +; MODULE-NEXT: ret i32* [[PHI]] +; +; CGSCC: Function Attrs: noinline nounwind uwtable +; CGSCC-LABEL: define {{[^@]+}}@ret_arg_or_unknown_through_phi +; CGSCC-SAME: (i32* [[B:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null +; CGSCC-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] +; CGSCC: ret_arg: +; CGSCC-NEXT: br label [[R:%.*]] +; CGSCC: ret_unknown: +; CGSCC-NEXT: [[CALL:%.*]] = call i32* @unknown(i32* [[B]]) +; CGSCC-NEXT: br label [[R]] +; CGSCC: r: +; CGSCC-NEXT: [[PHI:%.*]] = phi i32* [ [[B]], [[RET_ARG]] ], [ [[CALL]], [[RET_UNKNOWN]] ] +; CGSCC-NEXT: ret i32* [[PHI]] ; entry: %cmp = icmp eq i32* %b, null @@ -1267,23 +1221,22 @@ } ; 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 +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@deadblockcall1 +; MODULE-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: ret i32 [[A]] +; MODULE: unreachableblock: +; MODULE-NEXT: unreachable +; +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@deadblockcall1 +; CGSCC-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: ret i32 [[A]] +; CGSCC: unreachableblock: +; CGSCC-NEXT: unreachable ; entry: ret i32 %A @@ -1295,25 +1248,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 +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@deadblockcall2 +; MODULE-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: ret i32 [[A]] +; MODULE: unreachableblock1: +; MODULE-NEXT: unreachable +; MODULE: unreachableblock2: +; MODULE-NEXT: unreachable +; +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@deadblockcall2 +; CGSCC-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: ret i32 [[A]] +; CGSCC: unreachableblock1: +; CGSCC-NEXT: unreachable +; CGSCC: unreachableblock2: +; CGSCC-NEXT: unreachable ; entry: ret i32 %A @@ -1326,29 +1279,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]] +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@deadblockphi1 +; MODULE-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: br label [[R:%.*]] +; MODULE: unreachableblock1: +; MODULE-NEXT: unreachable +; MODULE: unreachableblock2: +; MODULE-NEXT: unreachable +; MODULE: r: +; MODULE-NEXT: ret i32 [[A]] +; +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@deadblockphi1 +; CGSCC-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br label [[R:%.*]] +; CGSCC: unreachableblock1: +; CGSCC-NEXT: unreachable +; CGSCC: unreachableblock2: +; CGSCC-NEXT: unreachable +; CGSCC: r: +; CGSCC-NEXT: ret i32 [[A]] ; entry: br label %r @@ -1364,33 +1317,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]] +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@deadblockphi2 +; MODULE-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: br label [[R:%.*]] +; MODULE: unreachableblock1: +; MODULE-NEXT: unreachable +; MODULE: unreachableblock2: +; MODULE-NEXT: unreachable +; MODULE: unreachableblock3: +; MODULE-NEXT: unreachable +; MODULE: r: +; MODULE-NEXT: ret i32 [[A]] +; +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@deadblockphi2 +; CGSCC-SAME: (i32 returned [[A:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br label [[R:%.*]] +; CGSCC: unreachableblock1: +; CGSCC-NEXT: unreachable +; CGSCC: unreachableblock2: +; CGSCC-NEXT: unreachable +; CGSCC: unreachableblock3: +; CGSCC-NEXT: unreachable +; CGSCC: r: +; CGSCC-NEXT: ret i32 [[A]] ; entry: br label %r @@ -1411,35 +1364,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]] +; MODULE: Function Attrs: noinline nounwind uwtable +; MODULE-LABEL: define {{[^@]+}}@deadblockphi3 +; MODULE-SAME: (i32 returned [[A:%.*]], i1 [[C:%.*]]) #[[ATTR3]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: br i1 [[C]], label [[R:%.*]], label [[UNREACHABLECALL:%.*]] +; MODULE: unreachablecall: +; MODULE-NEXT: call void @noreturn() #[[ATTR4:[0-9]+]] +; MODULE-NEXT: unreachable +; MODULE: unreachableblock2: +; MODULE-NEXT: unreachable +; MODULE: unreachableblock3: +; MODULE-NEXT: unreachable +; MODULE: r: +; MODULE-NEXT: ret i32 [[A]] +; +; CGSCC: Function Attrs: noinline nounwind uwtable +; CGSCC-LABEL: define {{[^@]+}}@deadblockphi3 +; CGSCC-SAME: (i32 returned [[A:%.*]], i1 [[C:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br i1 [[C]], label [[R:%.*]], label [[UNREACHABLECALL:%.*]] +; CGSCC: unreachablecall: +; CGSCC-NEXT: call void @noreturn() #[[ATTR5:[0-9]+]] +; CGSCC-NEXT: unreachable +; CGSCC: unreachableblock2: +; CGSCC-NEXT: unreachable +; CGSCC: unreachableblock3: +; CGSCC-NEXT: unreachable +; CGSCC: r: +; CGSCC-NEXT: ret i32 [[A]] ; entry: br i1 %c, label %r, label %unreachablecall @@ -1528,52 +1481,50 @@ @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*) +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@ret_const +; MODULE-SAME: () #[[ATTR0]] { +; MODULE-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*) +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@ret_const +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-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*) +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@use_const +; MODULE-SAME: () #[[ATTR0]] { +; MODULE-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*) +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@use_const +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-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*) +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@dont_use_const +; MODULE-SAME: () #[[ATTR0]] { +; MODULE-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*) +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@dont_use_const +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: ret i32* bitcast (i8* @G to i32*) ; %c = musttail call i32* @ret_const() ret i32* %c } ; UTC_ARGS: --disable -; ; Verify we do not derive constraints for @_Z3fooP1X as if it was returning `null`. -; ; CHEKC-NOT: noalias ; CHECK-NOT: align 536870912 @@ -1615,23 +1566,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 } +; MODULE: attributes #[[ATTR0]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; MODULE: attributes #[[ATTR1]] = { nofree noinline nosync nounwind readnone uwtable } +; MODULE: attributes #[[ATTR2]] = { nofree noinline noreturn nosync nounwind readnone uwtable willreturn } +; MODULE: attributes #[[ATTR3]] = { noinline nounwind uwtable } +; MODULE: attributes #[[ATTR4]] = { noreturn } +; MODULE: attributes #[[ATTR5:[0-9]+]] = { nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR6]] = { nofree nosync nounwind readnone } +; MODULE: attributes #[[ATTR7]] = { nounwind } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } +; CGSCC: attributes #[[ATTR1]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; CGSCC: attributes #[[ATTR2]] = { nofree noinline nosync nounwind readnone uwtable } +; CGSCC: attributes #[[ATTR3]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn } +; CGSCC: attributes #[[ATTR4]] = { noinline nounwind uwtable } +; CGSCC: attributes #[[ATTR5]] = { noreturn } +; CGSCC: attributes #[[ATTR6:[0-9]+]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR7]] = { nofree nosync nounwind readnone } +; CGSCC: 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,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 -; 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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC 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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@load_wholly_unreachable +; MODULE-SAME: () #[[ATTR0:[0-9]+]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@load_wholly_unreachable +; CGSCC-SAME: () #[[ATTR0:[0-9]+]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@loads_wholly_unreachable +; MODULE-SAME: () #[[ATTR0]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@loads_wholly_unreachable +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@load_single_bb_unreachable +; MODULE-SAME: (i1 [[COND:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] +; MODULE: t: +; MODULE-NEXT: unreachable +; MODULE: e: +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@load_single_bb_unreachable +; CGSCC-SAME: (i1 [[COND:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] +; CGSCC: t: +; CGSCC-NEXT: unreachable +; CGSCC: e: +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind null_pointer_is_valid readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@load_null_pointer_is_defined +; MODULE-SAME: () #[[ATTR1:[0-9]+]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@load_null_pointer_is_defined +; CGSCC-SAME: () #[[ATTR1:[0-9]+]] { +; CGSCC-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@ret_null +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@load_null_propagated +; MODULE-SAME: () #[[ATTR0]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@load_null_propagated +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@store_wholly_unreachable +; MODULE-SAME: () #[[ATTR0]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@store_wholly_unreachable +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@store_wholly_unreachable_volatile +; MODULE-SAME: () #[[ATTR2:[0-9]+]] { +; MODULE-NEXT: store volatile i32 5, i32* null, align 4294967296 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@store_wholly_unreachable_volatile +; CGSCC-SAME: () #[[ATTR2:[0-9]+]] { +; CGSCC-NEXT: store volatile i32 5, i32* null, align 4294967296 +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@store_single_bb_unreachable +; MODULE-SAME: (i1 [[COND:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] +; MODULE: t: +; MODULE-NEXT: unreachable +; MODULE: e: +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@store_single_bb_unreachable +; CGSCC-SAME: (i1 [[COND:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] +; CGSCC: t: +; CGSCC-NEXT: unreachable +; CGSCC: e: +; CGSCC-NEXT: ret void ; br i1 %cond, label %t, label %e t: @@ -175,35 +173,32 @@ } 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 +; MODULE: Function Attrs: nofree nosync nounwind null_pointer_is_valid willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@store_null_pointer_is_defined +; MODULE-SAME: () #[[ATTR3:[0-9]+]] { +; MODULE-NEXT: store i32 5, i32* null, align 4294967296 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@store_null_pointer_is_defined +; CGSCC-SAME: () #[[ATTR3:[0-9]+]] { +; CGSCC-NEXT: store i32 5, i32* null, align 4294967296 +; CGSCC-NEXT: ret void ; store i32 5, i32* null ret void } define void @store_null_propagated() { -; ATTRIBUTOR-LABEL: @store_null_propagated( -; ATTRIBUTOR-NEXT: unreachable +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@store_null_propagated +; MODULE-SAME: () #[[ATTR0]] { +; MODULE-NEXT: unreachable ; -; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT____-LABEL: define {{[^@]+}}@store_null_propagated -; IS__TUNIT____-SAME: () #[[ATTR0]] { -; IS__TUNIT____-NEXT: unreachable -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@store_null_propagated -; IS__CGSCC____-SAME: () #[[ATTR0]] { -; IS__CGSCC____-NEXT: unreachable +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@store_null_propagated +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: unreachable ; %ptr = call i32* @ret_null() store i32 5, i32* %ptr @@ -213,38 +208,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 +; MODULE: Function Attrs: nofree nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@atomicrmw_wholly_unreachable +; MODULE-SAME: () #[[ATTR2]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@atomicrmw_wholly_unreachable +; CGSCC-SAME: () #[[ATTR2]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@atomicrmw_single_bb_unreachable +; MODULE-SAME: (i1 [[COND:%.*]]) #[[ATTR2]] { +; MODULE-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] +; MODULE: t: +; MODULE-NEXT: unreachable +; MODULE: e: +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@atomicrmw_single_bb_unreachable +; CGSCC-SAME: (i1 [[COND:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] +; CGSCC: t: +; CGSCC-NEXT: unreachable +; CGSCC: e: +; CGSCC-NEXT: ret void ; br i1 %cond, label %t, label %e t: @@ -255,35 +250,32 @@ } 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 +; MODULE: Function Attrs: nofree nounwind null_pointer_is_valid willreturn +; MODULE-LABEL: define {{[^@]+}}@atomicrmw_null_pointer_is_defined +; MODULE-SAME: () #[[ATTR4:[0-9]+]] { +; MODULE-NEXT: [[A:%.*]] = atomicrmw add i32* null, i32 1 acquire, align 4 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nounwind null_pointer_is_valid willreturn +; CGSCC-LABEL: define {{[^@]+}}@atomicrmw_null_pointer_is_defined +; CGSCC-SAME: () #[[ATTR4:[0-9]+]] { +; CGSCC-NEXT: [[A:%.*]] = atomicrmw add i32* null, i32 1 acquire, align 4 +; CGSCC-NEXT: ret void ; %a = atomicrmw add i32* null, i32 1 acquire ret void } define void @atomicrmw_null_propagated() { -; 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 +; MODULE: Function Attrs: nofree nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@atomicrmw_null_propagated +; MODULE-SAME: () #[[ATTR2]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@atomicrmw_null_propagated +; CGSCC-SAME: () #[[ATTR2]] { +; CGSCC-NEXT: unreachable ; %ptr = call i32* @ret_null() %a = atomicrmw add i32* %ptr, i32 1 acquire @@ -293,38 +285,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 +; MODULE: Function Attrs: nofree nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@atomiccmpxchg_wholly_unreachable +; MODULE-SAME: () #[[ATTR2]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@atomiccmpxchg_wholly_unreachable +; CGSCC-SAME: () #[[ATTR2]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@atomiccmpxchg_single_bb_unreachable +; MODULE-SAME: (i1 [[COND:%.*]]) #[[ATTR2]] { +; MODULE-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] +; MODULE: t: +; MODULE-NEXT: unreachable +; MODULE: e: +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@atomiccmpxchg_single_bb_unreachable +; CGSCC-SAME: (i1 [[COND:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: br i1 [[COND]], label [[T:%.*]], label [[E:%.*]] +; CGSCC: t: +; CGSCC-NEXT: unreachable +; CGSCC: e: +; CGSCC-NEXT: ret void ; br i1 %cond, label %t, label %e t: @@ -335,35 +327,32 @@ } 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 +; MODULE: Function Attrs: nofree nounwind null_pointer_is_valid willreturn +; MODULE-LABEL: define {{[^@]+}}@atomiccmpxchg_null_pointer_is_defined +; MODULE-SAME: () #[[ATTR4]] { +; MODULE-NEXT: [[A:%.*]] = cmpxchg i32* null, i32 2, i32 3 acq_rel monotonic, align 4 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nounwind null_pointer_is_valid willreturn +; CGSCC-LABEL: define {{[^@]+}}@atomiccmpxchg_null_pointer_is_defined +; CGSCC-SAME: () #[[ATTR4]] { +; CGSCC-NEXT: [[A:%.*]] = cmpxchg i32* null, i32 2, i32 3 acq_rel monotonic, align 4 +; CGSCC-NEXT: ret void ; %a = cmpxchg i32* null, i32 2, i32 3 acq_rel monotonic ret void } define void @atomiccmpxchg_null_propagated() { -; 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 +; MODULE: Function Attrs: nofree nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@atomiccmpxchg_null_propagated +; MODULE-SAME: () #[[ATTR2]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@atomiccmpxchg_null_propagated +; CGSCC-SAME: () #[[ATTR2]] { +; CGSCC-NEXT: unreachable ; %ptr = call i32* @ret_null() %a = cmpxchg i32* %ptr, i32 2, i32 3 acq_rel monotonic @@ -375,23 +364,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 +; MODULE: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@cond_br_on_undef +; MODULE-SAME: () #[[ATTR5:[0-9]+]] { +; MODULE-NEXT: unreachable +; MODULE: t: +; MODULE-NEXT: unreachable +; MODULE: e: +; MODULE-NEXT: unreachable +; +; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@cond_br_on_undef +; CGSCC-SAME: () #[[ATTR5:[0-9]+]] { +; CGSCC-NEXT: unreachable +; CGSCC: t: +; CGSCC-NEXT: unreachable +; CGSCC: e: +; CGSCC-NEXT: unreachable ; br i1 undef, label %t, label %e t: @@ -404,31 +393,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@cond_br_on_undef2 +; MODULE-SAME: (i1 [[COND:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: br i1 [[COND]], label [[T1:%.*]], label [[E1:%.*]] +; MODULE: t1: +; MODULE-NEXT: unreachable +; MODULE: t2: +; MODULE-NEXT: unreachable +; MODULE: e2: +; MODULE-NEXT: unreachable +; MODULE: e1: +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@cond_br_on_undef2 +; CGSCC-SAME: (i1 [[COND:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: br i1 [[COND]], label [[T1:%.*]], label [[E1:%.*]] +; CGSCC: t1: +; CGSCC-NEXT: unreachable +; CGSCC: t2: +; CGSCC-NEXT: unreachable +; CGSCC: e2: +; CGSCC-NEXT: unreachable +; CGSCC: e1: +; CGSCC-NEXT: ret void ; br i1 %cond, label %t1, label %e1 t1: @@ -442,37 +431,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@ret_undef +; MODULE-SAME: () #[[ATTR0]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@ret_undef +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@cond_br_on_undef_interproc +; MODULE-SAME: () #[[ATTR5]] { +; MODULE-NEXT: unreachable +; MODULE: t: +; MODULE-NEXT: unreachable +; MODULE: e: +; MODULE-NEXT: unreachable +; +; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@cond_br_on_undef_interproc +; CGSCC-SAME: () #[[ATTR5]] { +; CGSCC-NEXT: unreachable +; CGSCC: t: +; CGSCC-NEXT: unreachable +; CGSCC: e: +; CGSCC-NEXT: unreachable ; %cond = call i1 @ret_undef() br i1 %cond, label %t, label %e @@ -483,23 +472,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@ret_undef2 +; MODULE-SAME: () #[[ATTR0]] { +; MODULE-NEXT: br i1 true, label [[T:%.*]], label [[E:%.*]] +; MODULE: t: +; MODULE-NEXT: ret i1 undef +; MODULE: e: +; MODULE-NEXT: unreachable +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@ret_undef2 +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: br i1 true, label [[T:%.*]], label [[E:%.*]] +; CGSCC: t: +; CGSCC-NEXT: ret i1 undef +; CGSCC: e: +; CGSCC-NEXT: unreachable ; br i1 true, label %t, label %e t: @@ -510,23 +499,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 +; MODULE: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@cond_br_on_undef_interproc2 +; MODULE-SAME: () #[[ATTR5]] { +; MODULE-NEXT: unreachable +; MODULE: t: +; MODULE-NEXT: unreachable +; MODULE: e: +; MODULE-NEXT: unreachable +; +; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@cond_br_on_undef_interproc2 +; CGSCC-SAME: () #[[ATTR5]] { +; CGSCC-NEXT: unreachable +; CGSCC: t: +; CGSCC-NEXT: unreachable +; CGSCC: e: +; CGSCC-NEXT: unreachable ; %cond = call i1 @ret_undef2() br i1 %cond, label %t, label %e @@ -539,23 +528,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@cond_br_on_undef3 +; MODULE-SAME: () #[[ATTR0]] { +; MODULE-NEXT: br label [[T:%.*]] +; MODULE: t: +; MODULE-NEXT: ret i32 1 +; MODULE: e: +; MODULE-NEXT: unreachable +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@cond_br_on_undef3 +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: br label [[T:%.*]] +; CGSCC: t: +; CGSCC-NEXT: ret i32 1 +; CGSCC: e: +; CGSCC-NEXT: unreachable ; %cond = icmp ne i32 1, undef br i1 %cond, label %t, label %e @@ -568,23 +557,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 +; MODULE: Function Attrs: nofree noreturn nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@cond_br_on_undef_uninit +; MODULE-SAME: () #[[ATTR5]] { +; MODULE-NEXT: unreachable +; MODULE: t: +; MODULE-NEXT: unreachable +; MODULE: e: +; MODULE-NEXT: unreachable +; +; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@cond_br_on_undef_uninit +; CGSCC-SAME: () #[[ATTR5]] { +; CGSCC-NEXT: unreachable +; CGSCC: t: +; CGSCC-NEXT: unreachable +; CGSCC: e: +; CGSCC-NEXT: unreachable ; %alloc = alloca i1 %cond = load i1, i1* %alloc @@ -600,16 +589,15 @@ ; We want to test that doing both won't cause a segfault. ; 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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@callee +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: unreachable +; CGSCC: T: +; CGSCC-NEXT: unreachable +; CGSCC: F: +; CGSCC-NEXT: ret i32 undef ; entry: %A.0 = load i32, i32* null @@ -623,86 +611,85 @@ } 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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@foo +; MODULE-SAME: () #[[ATTR0]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@foo +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: ret i32 1 ; %X = call i32 @callee(i1 false, i32* null) ret i32 %X } ; Tests for nonnull noundef attribute violation. -; ; 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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@arg_nonnull_1 +; MODULE-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR6:[0-9]+]] { +; MODULE-NEXT: store i32 0, i32* [[A]], align 4 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@arg_nonnull_1 +; CGSCC-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR6:[0-9]+]] { +; CGSCC-NEXT: store i32 0, i32* [[A]], align 4 +; CGSCC-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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@arg_nonnull_1_noundef_1 +; MODULE-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR6]] { +; MODULE-NEXT: store i32 0, i32* [[A]], align 4 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@arg_nonnull_1_noundef_1 +; CGSCC-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR6]] { +; CGSCC-NEXT: store i32 0, i32* [[A]], align 4 +; CGSCC-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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@arg_nonnull_12 +; MODULE-SAME: (i32* nocapture nofree nonnull writeonly [[A:%.*]], i32* nocapture nofree nonnull writeonly [[B:%.*]], i32* nofree writeonly [[C:%.*]]) #[[ATTR6]] { +; MODULE-NEXT: [[D:%.*]] = icmp eq i32* [[C]], null +; MODULE-NEXT: br i1 [[D]], label [[T:%.*]], label [[F:%.*]] +; MODULE: t: +; MODULE-NEXT: store i32 0, i32* [[A]], align 4 +; MODULE-NEXT: br label [[RET:%.*]] +; MODULE: f: +; MODULE-NEXT: store i32 1, i32* [[B]], align 4 +; MODULE-NEXT: br label [[RET]] +; MODULE: ret: +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@arg_nonnull_12 +; CGSCC-SAME: (i32* nocapture nofree nonnull writeonly [[A:%.*]], i32* nocapture nofree nonnull writeonly [[B:%.*]], i32* nofree writeonly [[C:%.*]]) #[[ATTR6]] { +; CGSCC-NEXT: [[D:%.*]] = icmp eq i32* [[C]], null +; CGSCC-NEXT: br i1 [[D]], label [[T:%.*]], label [[F:%.*]] +; CGSCC: t: +; CGSCC-NEXT: store i32 0, i32* [[A]], align 4 +; CGSCC-NEXT: br label [[RET:%.*]] +; CGSCC: f: +; CGSCC-NEXT: store i32 1, i32* [[B]], align 4 +; CGSCC-NEXT: br label [[RET]] +; CGSCC: ret: +; CGSCC-NEXT: ret void ; %d = icmp eq i32* %c, null br i1 %d, label %t, label %f @@ -717,33 +704,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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@arg_nonnull_12_noundef_2 +; MODULE-SAME: (i32* nocapture nofree nonnull writeonly [[A:%.*]], i32* nocapture nofree noundef nonnull writeonly [[B:%.*]], i32* nofree writeonly [[C:%.*]]) #[[ATTR6]] { +; MODULE-NEXT: [[D:%.*]] = icmp eq i32* [[C]], null +; MODULE-NEXT: br i1 [[D]], label [[T:%.*]], label [[F:%.*]] +; MODULE: t: +; MODULE-NEXT: store i32 0, i32* [[A]], align 4 +; MODULE-NEXT: br label [[RET:%.*]] +; MODULE: f: +; MODULE-NEXT: store i32 1, i32* [[B]], align 4 +; MODULE-NEXT: br label [[RET]] +; MODULE: ret: +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@arg_nonnull_12_noundef_2 +; CGSCC-SAME: (i32* nocapture nofree nonnull writeonly [[A:%.*]], i32* nocapture nofree noundef nonnull writeonly [[B:%.*]], i32* nofree writeonly [[C:%.*]]) #[[ATTR6]] { +; CGSCC-NEXT: [[D:%.*]] = icmp eq i32* [[C]], null +; CGSCC-NEXT: br i1 [[D]], label [[T:%.*]], label [[F:%.*]] +; CGSCC: t: +; CGSCC-NEXT: store i32 0, i32* [[A]], align 4 +; CGSCC-NEXT: br label [[RET:%.*]] +; CGSCC: f: +; CGSCC-NEXT: store i32 1, i32* [[B]], align 4 +; CGSCC-NEXT: br label [[RET]] +; CGSCC: ret: +; CGSCC-NEXT: ret void ; %d = icmp eq i32* %c, null br i1 %d, label %t, label %f @@ -759,30 +746,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@arg_nonnull_violation1_1 +; MODULE-SAME: () #[[ATTR0]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@arg_nonnull_violation1_1 +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@arg_nonnull_violation1_2 +; MODULE-SAME: () #[[ATTR0]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@arg_nonnull_violation1_2 +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: unreachable ; call void @arg_nonnull_1_noundef_1(i32* null) ret void @@ -790,15 +777,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@arg_nonnull_violation2_1 +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@arg_nonnull_violation2_1 +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: unreachable ; %null = getelementptr i32, i32* null, i32 0 %mustnull = select i1 %c, i32* null, i32* %null @@ -807,15 +794,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@arg_nonnull_violation2_2 +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@arg_nonnull_violation2_2 +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: unreachable ; %null = getelementptr i32, i32* null, i32 0 %mustnull = select i1 %c, i32* null, i32* %null @@ -825,33 +812,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@arg_nonnull_violation3_1 +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[PTR:%.*]] = alloca i32, align 4 +; MODULE-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; MODULE: t: +; MODULE-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]+]] +; MODULE-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]] +; MODULE-NEXT: unreachable +; MODULE: f: +; MODULE-NEXT: unreachable +; MODULE: ret: +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@arg_nonnull_violation3_1 +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[PTR:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; CGSCC: t: +; 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]+]] +; 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]] +; CGSCC-NEXT: unreachable +; CGSCC: f: +; CGSCC-NEXT: unreachable +; CGSCC: ret: +; CGSCC-NEXT: ret void ; %ptr = alloca i32 br i1 %c, label %t, label %f @@ -872,33 +859,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@arg_nonnull_violation3_2 +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[PTR:%.*]] = alloca i32, align 4 +; MODULE-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; MODULE: t: +; MODULE-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]] +; MODULE-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]] +; MODULE-NEXT: unreachable +; MODULE: f: +; MODULE-NEXT: unreachable +; MODULE: ret: +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@arg_nonnull_violation3_2 +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[PTR:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; CGSCC: t: +; 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]] +; 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]] +; CGSCC-NEXT: unreachable +; CGSCC: f: +; CGSCC-NEXT: unreachable +; CGSCC: ret: +; CGSCC-NEXT: ret void ; %ptr = alloca i32 br i1 %c, label %t, label %f @@ -921,35 +908,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@returned_nonnnull +; MODULE-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: switch i32 [[C]], label [[ONDEFAULT:%.*]] [ +; MODULE-NEXT: i32 0, label [[ONZERO:%.*]] +; MODULE-NEXT: i32 1, label [[ONONE:%.*]] +; MODULE-NEXT: ] +; MODULE: onzero: +; MODULE-NEXT: [[PTR:%.*]] = alloca i32, align 4 +; MODULE-NEXT: ret i32* [[PTR]] +; MODULE: onone: +; MODULE-NEXT: ret i32* null +; MODULE: ondefault: +; MODULE-NEXT: ret i32* undef +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@returned_nonnnull +; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: switch i32 [[C]], label [[ONDEFAULT:%.*]] [ +; CGSCC-NEXT: i32 0, label [[ONZERO:%.*]] +; CGSCC-NEXT: i32 1, label [[ONONE:%.*]] +; CGSCC-NEXT: ] +; CGSCC: onzero: +; CGSCC-NEXT: [[PTR:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: ret i32* [[PTR]] +; CGSCC: onone: +; CGSCC-NEXT: ret i32* null +; CGSCC: ondefault: +; CGSCC-NEXT: ret i32* undef ; switch i32 %c, label %ondefault [ i32 0, label %onzero i32 1, label %onone ] @@ -963,35 +950,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@returned_noundef +; MODULE-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: switch i32 [[C]], label [[ONDEFAULT:%.*]] [ +; MODULE-NEXT: i32 0, label [[ONZERO:%.*]] +; MODULE-NEXT: i32 1, label [[ONONE:%.*]] +; MODULE-NEXT: ] +; MODULE: onzero: +; MODULE-NEXT: [[PTR:%.*]] = alloca i32, align 4 +; MODULE-NEXT: ret i32* [[PTR]] +; MODULE: onone: +; MODULE-NEXT: ret i32* null +; MODULE: ondefault: +; MODULE-NEXT: unreachable +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@returned_noundef +; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: switch i32 [[C]], label [[ONDEFAULT:%.*]] [ +; CGSCC-NEXT: i32 0, label [[ONZERO:%.*]] +; CGSCC-NEXT: i32 1, label [[ONONE:%.*]] +; CGSCC-NEXT: ] +; CGSCC: onzero: +; CGSCC-NEXT: [[PTR:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: ret i32* [[PTR]] +; CGSCC: onone: +; CGSCC-NEXT: ret i32* null +; CGSCC: ondefault: +; CGSCC-NEXT: unreachable ; switch i32 %c, label %ondefault [ i32 0, label %onzero i32 1, label %onone ] @@ -1005,35 +992,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@returned_nonnnull_noundef +; MODULE-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: switch i32 [[C]], label [[ONDEFAULT:%.*]] [ +; MODULE-NEXT: i32 0, label [[ONZERO:%.*]] +; MODULE-NEXT: i32 1, label [[ONONE:%.*]] +; MODULE-NEXT: ] +; MODULE: onzero: +; MODULE-NEXT: [[PTR:%.*]] = alloca i32, align 4 +; MODULE-NEXT: ret i32* [[PTR]] +; MODULE: onone: +; MODULE-NEXT: unreachable +; MODULE: ondefault: +; MODULE-NEXT: unreachable +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@returned_nonnnull_noundef +; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: switch i32 [[C]], label [[ONDEFAULT:%.*]] [ +; CGSCC-NEXT: i32 0, label [[ONZERO:%.*]] +; CGSCC-NEXT: i32 1, label [[ONONE:%.*]] +; CGSCC-NEXT: ] +; CGSCC: onzero: +; CGSCC-NEXT: [[PTR:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: ret i32* [[PTR]] +; CGSCC: onone: +; CGSCC-NEXT: unreachable +; CGSCC: ondefault: +; CGSCC-NEXT: unreachable ; switch i32 %c, label %ondefault [ i32 0, label %onzero i32 1, label %onone ] @@ -1047,15 +1034,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@returned_nonnnull_noundef_int +; MODULE-SAME: () #[[ATTR0]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@returned_nonnnull_noundef_int +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-NEXT: ret i32 0 ; ret i32 0 } @@ -1082,78 +1069,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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@argument_noundef1 +; MODULE-SAME: (i32 noundef returned [[C:%.*]]) #[[ATTR0]] { +; MODULE-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]] +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@argument_noundef1 +; CGSCC-SAME: (i32 noundef returned [[C:%.*]]) #[[ATTR0]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@violate_noundef_nonpointer +; MODULE-SAME: () #[[ATTR0]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@violate_noundef_nonpointer +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@argument_noundef2 +; MODULE-SAME: (i32* nofree noundef readnone returned "no-capture-maybe-returned" [[C:%.*]]) #[[ATTR0]] { +; MODULE-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]] +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@argument_noundef2 +; CGSCC-SAME: (i32* nofree noundef readnone returned "no-capture-maybe-returned" [[C:%.*]]) #[[ATTR0]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@violate_noundef_pointer +; MODULE-SAME: () #[[ATTR0]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@violate_noundef_pointer +; CGSCC-SAME: () #[[ATTR0]] { +; CGSCC-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 } +; MODULE: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR1]] = { nofree nosync nounwind null_pointer_is_valid readnone willreturn } +; MODULE: attributes #[[ATTR2]] = { nofree nounwind readnone willreturn } +; MODULE: attributes #[[ATTR3]] = { nofree nosync nounwind null_pointer_is_valid willreturn writeonly } +; MODULE: attributes #[[ATTR4]] = { nofree nounwind null_pointer_is_valid willreturn } +; MODULE: attributes #[[ATTR5]] = { nofree noreturn nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR6]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn } +; CGSCC: attributes #[[ATTR2]] = { nofree norecurse nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR3]] = { nofree norecurse nosync nounwind null_pointer_is_valid willreturn writeonly } +; CGSCC: attributes #[[ATTR4]] = { nofree norecurse nounwind null_pointer_is_valid willreturn } +; CGSCC: attributes #[[ATTR5]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR6]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; CGSCC: 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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC 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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@recursive_inst_comparator +; MODULE-SAME: (i1* noalias nofree readnone [[A:%.*]], i1* noalias nofree readnone [[B:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: [[CMP:%.*]] = icmp eq i1* [[A]], [[B]] +; MODULE-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]] +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@recursive_inst_comparator +; CGSCC-SAME: (i1* noalias nofree readnone [[A:%.*]], i1* noalias nofree readnone [[B:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: [[CMP:%.*]] = icmp eq i1* [[A]], [[B]] +; CGSCC-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]] +; MODULE-LABEL: define {{[^@]+}}@recursive_inst_generator +; MODULE-SAME: (i1 [[C:%.*]], i1* nofree [[P:%.*]]) { +; MODULE-NEXT: [[A:%.*]] = call i1* @geti1Ptr() +; MODULE-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; MODULE: t: +; MODULE-NEXT: [[R1:%.*]] = call i1 @recursive_inst_comparator(i1* noalias nofree readnone [[A]], i1* noalias nofree readnone [[P]]) #[[ATTR4:[0-9]+]] +; MODULE-NEXT: ret i1 [[R1]] +; MODULE: f: +; MODULE-NEXT: [[R2:%.*]] = call i1 @recursive_inst_generator(i1 noundef true, i1* nofree [[A]]) +; MODULE-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]] +; CGSCC-LABEL: define {{[^@]+}}@recursive_inst_generator +; CGSCC-SAME: (i1 [[C:%.*]], i1* nofree [[P:%.*]]) { +; CGSCC-NEXT: [[A:%.*]] = call i1* @geti1Ptr() +; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; CGSCC: t: +; CGSCC-NEXT: [[R1:%.*]] = call i1 @recursive_inst_comparator(i1* noalias nofree readnone [[A]], i1* noalias nofree readnone [[P]]) +; CGSCC-NEXT: ret i1 [[R1]] +; CGSCC: f: +; CGSCC-NEXT: [[R2:%.*]] = call i1 @recursive_inst_generator(i1 noundef true, i1* nofree [[A]]) +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone +; MODULE-LABEL: define {{[^@]+}}@recursive_alloca_compare_caller +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare(i1 [[C]], i1* undef) #[[ATTR1]] +; MODULE-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]] +; CGSCC: Function Attrs: nofree nosync nounwind readnone +; CGSCC-LABEL: define {{[^@]+}}@recursive_alloca_compare_caller +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare(i1 [[C]], i1* undef) #[[ATTR4:[0-9]+]] +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone +; MODULE-LABEL: define {{[^@]+}}@recursive_alloca_load_return_caller +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: [[CALL:%.*]] = call i8 @recursive_alloca_load_return(i1 [[C]], i8* undef, i8 noundef 42) #[[ATTR3]] +; MODULE-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]] +; CGSCC: Function Attrs: nofree nosync nounwind readnone +; CGSCC-LABEL: define {{[^@]+}}@recursive_alloca_load_return_caller +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: [[CALL:%.*]] = call i8 @recursive_alloca_load_return(i1 [[C]], i8* undef, i8 noundef 42) #[[ATTR5:[0-9]+]] +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind +; MODULE-LABEL: define {{[^@]+}}@recursive_alloca_compare_caller_global1 +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { +; MODULE-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global1(i1 [[C]]) #[[ATTR3]] +; MODULE-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]] +; CGSCC: Function Attrs: nofree nosync nounwind +; CGSCC-LABEL: define {{[^@]+}}@recursive_alloca_compare_caller_global1 +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { +; CGSCC-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global1(i1 [[C]]) #[[ATTR5]] +; CGSCC-NEXT: ret i1 [[CALL]] ; %call = call i1 @recursive_alloca_compare_global1(i1 %c) ret i1 %call @@ -275,23 +273,22 @@ ; 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]] +; MODULE: Function Attrs: nofree nosync nounwind +; MODULE-LABEL: define {{[^@]+}}@recursive_alloca_compare_caller_global2 +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { +; MODULE-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global2(i1 [[C]]) #[[ATTR3]] +; MODULE-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]] +; CGSCC: Function Attrs: nofree nosync nounwind +; CGSCC-LABEL: define {{[^@]+}}@recursive_alloca_compare_caller_global2 +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { +; CGSCC-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global2(i1 [[C]]) #[[ATTR5]] +; CGSCC-NEXT: ret i1 [[CALL]] ; %call = call i1 @recursive_alloca_compare_global2(i1 %c) ret i1 %call } define internal i1 @recursive_inst_compare_global3(i1 %c) { -; ; CHECK: Function Attrs: nofree nosync nounwind ; CHECK-LABEL: define {{[^@]+}}@recursive_inst_compare_global3 ; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { @@ -318,32 +315,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]] +; MODULE: Function Attrs: nofree nosync nounwind +; MODULE-LABEL: define {{[^@]+}}@recursive_inst_compare_caller_global3 +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { +; MODULE-NEXT: [[CALL:%.*]] = call i1 @recursive_inst_compare_global3(i1 [[C]]) #[[ATTR3]] +; MODULE-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]] +; CGSCC: Function Attrs: nofree nosync nounwind +; CGSCC-LABEL: define {{[^@]+}}@recursive_inst_compare_caller_global3 +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { +; CGSCC-NEXT: [[CALL:%.*]] = call i1 @recursive_inst_compare_global3(i1 [[C]]) #[[ATTR5]] +; CGSCC-NEXT: ret i1 [[CALL]] ; %call = call i1 @recursive_inst_compare_global3(i1 %c) ret i1 %call } ;. -; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } -; IS__TUNIT____: attributes #[[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 } +; MODULE: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR1]] = { nofree nosync nounwind readnone } +; MODULE: attributes #[[ATTR2]] = { argmemonly nofree nosync nounwind } +; MODULE: attributes #[[ATTR3]] = { nofree nosync nounwind } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR1]] = { nofree nosync nounwind readnone } +; CGSCC: attributes #[[ATTR2]] = { argmemonly nofree nosync nounwind } +; CGSCC: attributes #[[ATTR3]] = { nofree nosync nounwind } +; CGSCC: attributes #[[ATTR4]] = { nounwind readnone } +; CGSCC: 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,9 +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=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 -; +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC %struct.S = type { i32, i32, i32, float, float, float } @globalBytes = global [1024 x i8] zeroinitializer, align 16 @@ -56,19 +53,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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@write_arg +; MODULE-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]], i32 [[V:%.*]]) #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: store i32 [[V]], i32* [[P]], align 4, !tbaa [[TBAA3:![0-9]+]] +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@write_arg +; CGSCC-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]], i32 [[V:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: store i32 [[V]], i32* [[P]], align 4, !tbaa [[TBAA3:![0-9]+]] +; CGSCC-NEXT: ret void ; entry: store i32 %v, i32* %p, align 4, !tbaa !3 @@ -109,149 +106,77 @@ ; 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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@local_alloca_simplifiable_1 +; MODULE-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR1:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[S:%.*]] = alloca [[STRUCT_S]], align 4 +; MODULE-NEXT: [[I:%.*]] = bitcast %struct.S* [[S]] to i8* +; MODULE-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I]]) #[[ATTR7:[0-9]+]] +; MODULE-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 +; MODULE-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 +; MODULE-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 +; MODULE-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 +; MODULE-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR4:[0-9]+]] +; MODULE-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 +; MODULE-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR4]] +; MODULE-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 +; MODULE-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR4]] +; MODULE-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 +; MODULE-NEXT: store float 0x3FF19999A0000000, float* [[F12]], align 4, !tbaa [[TBAA7:![0-9]+]] +; MODULE-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00 +; MODULE-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4 +; MODULE-NEXT: store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10:![0-9]+]] +; MODULE-NEXT: [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000 +; MODULE-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5 +; MODULE-NEXT: store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11:![0-9]+]] +; MODULE-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0 +; MODULE-NEXT: store i32 1, i32* [[I19]], align 4, !tbaa [[TBAA12:![0-9]+]] +; MODULE-NEXT: [[MUL11:%.*]] = shl nsw i32 2, 1 +; MODULE-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1 +; MODULE-NEXT: store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13:![0-9]+]] +; MODULE-NEXT: [[ADD15:%.*]] = add nsw i32 3, 1 +; MODULE-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 +; MODULE-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14:![0-9]+]] +; MODULE-NEXT: [[I12:%.*]] = bitcast %struct.S* [[S]] to i8* +; MODULE-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I12]]) #[[ATTR7]] +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@local_alloca_simplifiable_1 +; CGSCC-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR1:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[S:%.*]] = alloca [[STRUCT_S]], align 4 +; CGSCC-NEXT: [[I:%.*]] = bitcast %struct.S* [[S]] to i8* +; CGSCC-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I]]) #[[ATTR9:[0-9]+]] +; CGSCC-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 +; CGSCC-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 +; CGSCC-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 +; CGSCC-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 +; CGSCC-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR10:[0-9]+]] +; CGSCC-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 +; CGSCC-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR10]] +; CGSCC-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 +; CGSCC-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR10]] +; CGSCC-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 +; CGSCC-NEXT: store float 0x3FF19999A0000000, float* [[F12]], align 4, !tbaa [[TBAA7:![0-9]+]] +; CGSCC-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00 +; CGSCC-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4 +; CGSCC-NEXT: store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10:![0-9]+]] +; CGSCC-NEXT: [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000 +; CGSCC-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5 +; CGSCC-NEXT: store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11:![0-9]+]] +; CGSCC-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0 +; CGSCC-NEXT: store i32 1, i32* [[I19]], align 4, !tbaa [[TBAA12:![0-9]+]] +; CGSCC-NEXT: [[MUL11:%.*]] = shl nsw i32 2, 1 +; CGSCC-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1 +; CGSCC-NEXT: store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13:![0-9]+]] +; CGSCC-NEXT: [[ADD15:%.*]] = add nsw i32 3, 1 +; CGSCC-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 +; CGSCC-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14:![0-9]+]] +; CGSCC-NEXT: [[I12:%.*]] = bitcast %struct.S* [[S]] to i8* +; CGSCC-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I12]]) #[[ATTR9]] +; CGSCC-NEXT: ret void ; entry: %s = alloca %struct.S, align 4 @@ -324,331 +249,168 @@ ; for (int i = 0; i < 1024; ++i) ; globalBytes[i] = Bytes[i]; ; } -; 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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@local_alloca_simplifiable_2 +; MODULE-SAME: () #[[ATTR2:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16 +; MODULE-NEXT: [[I:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0 +; MODULE-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I]]) #[[ATTR7]] +; MODULE-NEXT: br label [[FOR_COND:%.*]] +; MODULE: for.cond: +; MODULE-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ] +; MODULE-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100 +; MODULE-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] +; MODULE: for.cond.cleanup: +; MODULE-NEXT: br label [[FOR_END:%.*]] +; MODULE: for.body: +; MODULE-NEXT: [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10 +; MODULE-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[I15]] +; MODULE-NEXT: br label [[FOR_INC]] +; MODULE: for.inc: +; MODULE-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 +; MODULE-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP15:![0-9]+]] +; MODULE: for.end: +; MODULE-NEXT: br label [[FOR_COND2:%.*]] +; MODULE: for.cond2: +; MODULE-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ] +; MODULE-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10 +; MODULE-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]] +; MODULE: for.cond.cleanup4: +; MODULE-NEXT: br label [[FOR_END11:%.*]] +; MODULE: for.body5: +; MODULE-NEXT: [[I16:%.*]] = bitcast [1024 x i8]* [[BYTES]] to float* +; MODULE-NEXT: [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10 +; MODULE-NEXT: [[I18:%.*]] = or i64 [[I17]], 1 +; MODULE-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I16]], i64 [[I18]] +; MODULE-NEXT: br label [[FOR_INC9]] +; MODULE: for.inc9: +; MODULE-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1 +; MODULE-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP17:![0-9]+]] +; MODULE: for.end11: +; MODULE-NEXT: br label [[FOR_COND13:%.*]] +; MODULE: for.cond13: +; MODULE-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC22:%.*]] ], [ 0, [[FOR_END11]] ] +; MODULE-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20 +; MODULE-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]] +; MODULE: for.cond.cleanup15: +; MODULE-NEXT: br label [[FOR_END24:%.*]] +; MODULE: for.body16: +; MODULE-NEXT: [[I19:%.*]] = bitcast [1024 x i8]* [[BYTES]] to i64* +; MODULE-NEXT: [[I20:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10 +; MODULE-NEXT: [[I21:%.*]] = add nuw nsw i64 [[I20]], 2 +; MODULE-NEXT: [[ARRAYIDX21:%.*]] = getelementptr inbounds i64, i64* [[I19]], i64 [[I21]] +; MODULE-NEXT: br label [[FOR_INC22]] +; MODULE: for.inc22: +; MODULE-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 +; MODULE-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP18:![0-9]+]] +; MODULE: for.end24: +; MODULE-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 1023 +; MODULE-NEXT: [[ARRAYIDX26:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 500 +; MODULE-NEXT: [[I22:%.*]] = bitcast i8* [[ARRAYIDX26]] to i32* +; MODULE-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(524) [[I22]], i32 noundef 0) #[[ATTR4]] +; MODULE-NEXT: br label [[FOR_COND28:%.*]] +; MODULE: for.cond28: +; MODULE-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC36:%.*]] ], [ 0, [[FOR_END24]] ] +; MODULE-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024 +; MODULE-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY31:%.*]], label [[FOR_COND_CLEANUP30:%.*]] +; MODULE: for.cond.cleanup30: +; MODULE-NEXT: br label [[FOR_END38:%.*]] +; MODULE: for.body31: +; MODULE-NEXT: [[ARRAYIDX35:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]] +; MODULE-NEXT: store i8 0, i8* [[ARRAYIDX35]], align 1, !tbaa [[TBAA19:![0-9]+]] +; MODULE-NEXT: br label [[FOR_INC36]] +; MODULE: for.inc36: +; MODULE-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 +; MODULE-NEXT: br label [[FOR_COND28]], !llvm.loop [[LOOP20:![0-9]+]] +; MODULE: for.end38: +; MODULE-NEXT: [[I24:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0 +; MODULE-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I24]]) #[[ATTR7]] +; MODULE-NEXT: ret void +; +; CGSCC-LABEL: define {{[^@]+}}@local_alloca_simplifiable_2() { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16 +; CGSCC-NEXT: [[I:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0 +; CGSCC-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I]]) #[[ATTR9]] +; CGSCC-NEXT: br label [[FOR_COND:%.*]] +; CGSCC: for.cond: +; CGSCC-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ] +; CGSCC-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100 +; CGSCC-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] +; CGSCC: for.cond.cleanup: +; CGSCC-NEXT: br label [[FOR_END:%.*]] +; CGSCC: for.body: +; CGSCC-NEXT: [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10 +; CGSCC-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[I15]] +; CGSCC-NEXT: store i8 0, i8* [[ARRAYIDX]], align 2, !tbaa [[TBAA15:![0-9]+]] +; CGSCC-NEXT: br label [[FOR_INC]] +; CGSCC: for.inc: +; CGSCC-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 +; CGSCC-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP16:![0-9]+]] +; CGSCC: for.end: +; CGSCC-NEXT: br label [[FOR_COND2:%.*]] +; CGSCC: for.cond2: +; CGSCC-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ] +; CGSCC-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10 +; CGSCC-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]] +; CGSCC: for.cond.cleanup4: +; CGSCC-NEXT: br label [[FOR_END11:%.*]] +; CGSCC: for.body5: +; CGSCC-NEXT: [[I16:%.*]] = bitcast [1024 x i8]* [[BYTES]] to float* +; CGSCC-NEXT: [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10 +; CGSCC-NEXT: [[I18:%.*]] = or i64 [[I17]], 1 +; CGSCC-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I16]], i64 [[I18]] +; CGSCC-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA18:![0-9]+]] +; CGSCC-NEXT: br label [[FOR_INC9]] +; CGSCC: for.inc9: +; CGSCC-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1 +; CGSCC-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP19:![0-9]+]] +; CGSCC: for.end11: +; CGSCC-NEXT: br label [[FOR_COND13:%.*]] +; CGSCC: for.cond13: +; CGSCC-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC22:%.*]] ], [ 0, [[FOR_END11]] ] +; CGSCC-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20 +; CGSCC-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]] +; CGSCC: for.cond.cleanup15: +; CGSCC-NEXT: br label [[FOR_END24:%.*]] +; CGSCC: for.body16: +; CGSCC-NEXT: [[I19:%.*]] = bitcast [1024 x i8]* [[BYTES]] to i64* +; CGSCC-NEXT: [[I20:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10 +; CGSCC-NEXT: [[I21:%.*]] = add nuw nsw i64 [[I20]], 2 +; CGSCC-NEXT: [[ARRAYIDX21:%.*]] = getelementptr inbounds i64, i64* [[I19]], i64 [[I21]] +; CGSCC-NEXT: store i64 0, i64* [[ARRAYIDX21]], align 16, !tbaa [[TBAA20:![0-9]+]] +; CGSCC-NEXT: br label [[FOR_INC22]] +; CGSCC: for.inc22: +; CGSCC-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 +; CGSCC-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP22:![0-9]+]] +; CGSCC: for.end24: +; CGSCC-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 1023 +; CGSCC-NEXT: store i8 0, i8* [[ARRAYIDX25]], align 1, !tbaa [[TBAA15]] +; CGSCC-NEXT: [[ARRAYIDX26:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 500 +; CGSCC-NEXT: [[I22:%.*]] = bitcast i8* [[ARRAYIDX26]] to i32* +; CGSCC-NEXT: call void @write_arg(i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[I22]], i32 noundef 0) #[[ATTR11:[0-9]+]] +; CGSCC-NEXT: br label [[FOR_COND28:%.*]] +; CGSCC: for.cond28: +; CGSCC-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC36:%.*]] ], [ 0, [[FOR_END24]] ] +; CGSCC-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024 +; CGSCC-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY31:%.*]], label [[FOR_COND_CLEANUP30:%.*]] +; CGSCC: for.cond.cleanup30: +; CGSCC-NEXT: br label [[FOR_END38:%.*]] +; CGSCC: for.body31: +; CGSCC-NEXT: [[ARRAYIDX33:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[INDVARS_IV12]] +; CGSCC-NEXT: [[I23:%.*]] = load i8, i8* [[ARRAYIDX33]], align 1, !tbaa [[TBAA15]] +; CGSCC-NEXT: [[ARRAYIDX35:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]] +; CGSCC-NEXT: store i8 [[I23]], i8* [[ARRAYIDX35]], align 1, !tbaa [[TBAA15]] +; CGSCC-NEXT: br label [[FOR_INC36]] +; CGSCC: for.inc36: +; CGSCC-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 +; CGSCC-NEXT: br label [[FOR_COND28]], !llvm.loop [[LOOP23:![0-9]+]] +; CGSCC: for.end38: +; CGSCC-NEXT: [[I24:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0 +; CGSCC-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1024, i8* nofree noundef nonnull [[I24]]) +; CGSCC-NEXT: ret void ; entry: %Bytes = alloca [1024 x i8], align 16 @@ -759,29 +521,28 @@ ; A = 2; ; return A; ; } -; 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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@local_alloca_simplifiable_3 +; MODULE-SAME: () #[[ATTR3:[0-9]+]] { +; MODULE-NEXT: [[A:%.*]] = alloca i32, align 4 +; MODULE-NEXT: store i32 1, i32* [[A]], align 4 +; MODULE-NEXT: br label [[SPLIT:%.*]] +; MODULE: split: +; MODULE-NEXT: store i32 2, i32* [[A]], align 4 +; MODULE-NEXT: [[L:%.*]] = load i32, i32* [[A]], align 4 +; MODULE-NEXT: ret i32 [[L]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@local_alloca_simplifiable_3 +; CGSCC-SAME: () #[[ATTR2:[0-9]+]] { +; CGSCC-NEXT: [[A:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: store i32 1, i32* [[A]], align 4 +; CGSCC-NEXT: br label [[SPLIT:%.*]] +; CGSCC: split: +; CGSCC-NEXT: store i32 2, i32* [[A]], align 4 +; CGSCC-NEXT: [[L:%.*]] = load i32, i32* [[A]], align 4 +; CGSCC-NEXT: ret i32 [[L]] ; %A = alloca i32, align 4 store i32 1, i32* %A @@ -795,17 +556,16 @@ ; int A; ; return A; ; } -; 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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@local_alloca_simplifiable_4 +; MODULE-SAME: () #[[ATTR3]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@local_alloca_simplifiable_4 +; CGSCC-SAME: () #[[ATTR2]] { +; CGSCC-NEXT: ret i32 undef ; %A = alloca i32, align 4 %l = load i32, i32* %A, align 4 @@ -819,77 +579,41 @@ ; 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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@multi_obj_simplifiable_1 +; MODULE-SAME: (i32 [[CND:%.*]]) #[[ATTR2]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[L:%.*]] = alloca i32, align 4 +; MODULE-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8* +; MODULE-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR7]] +; MODULE-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0 +; MODULE-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]] +; MODULE: cond.true: +; MODULE-NEXT: br label [[COND_END:%.*]] +; MODULE: cond.false: +; MODULE-NEXT: br label [[COND_END]] +; MODULE: cond.end: +; MODULE-NEXT: [[I2:%.*]] = bitcast i32* [[L]] to i8* +; MODULE-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I2]]) #[[ATTR7]] +; MODULE-NEXT: ret i32 5 +; +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@multi_obj_simplifiable_1 +; CGSCC-SAME: (i32 [[CND:%.*]]) #[[ATTR3:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[L:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8* +; CGSCC-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR9]] +; CGSCC-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0 +; CGSCC-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]] +; CGSCC: cond.true: +; CGSCC-NEXT: br label [[COND_END:%.*]] +; CGSCC: cond.false: +; CGSCC-NEXT: br label [[COND_END]] +; CGSCC: cond.end: +; CGSCC-NEXT: [[I2:%.*]] = bitcast i32* [[L]] to i8* +; CGSCC-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I2]]) #[[ATTR9]] +; CGSCC-NEXT: ret i32 5 ; entry: %L = alloca i32, align 4 @@ -921,79 +645,42 @@ ; *p = 5; ; return *p; ; } -; 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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@multi_obj_simplifiable_2 +; MODULE-SAME: (i32 [[CND:%.*]]) #[[ATTR2]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[L:%.*]] = alloca i32, align 4 +; MODULE-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8* +; MODULE-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR7]] +; MODULE-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0 +; MODULE-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]] +; MODULE: cond.true: +; MODULE-NEXT: br label [[COND_END:%.*]] +; MODULE: cond.false: +; MODULE-NEXT: br label [[COND_END]] +; MODULE: cond.end: +; MODULE-NEXT: [[I1:%.*]] = bitcast i32* [[L]] to i8* +; MODULE-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR7]] +; MODULE-NEXT: ret i32 5 +; +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@multi_obj_simplifiable_2 +; CGSCC-SAME: (i32 [[CND:%.*]]) #[[ATTR3]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[L:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8* +; CGSCC-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR9]] +; CGSCC-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0 +; CGSCC-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]] +; CGSCC: cond.true: +; CGSCC-NEXT: br label [[COND_END:%.*]] +; CGSCC: cond.false: +; CGSCC-NEXT: br label [[COND_END]] +; CGSCC: cond.end: +; CGSCC-NEXT: [[I1:%.*]] = bitcast i32* [[L]] to i8* +; CGSCC-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR9]] +; CGSCC-NEXT: ret i32 5 ; entry: %L = alloca i32, align 4 @@ -1034,107 +721,56 @@ ; r.i3 = Gs.i3 + Gs.i1; ; return r; ; } -; 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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@static_global_simplifiable_1 +; MODULE-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR4]] { +; MODULE-NEXT: entry: +; MODULE-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]] +; MODULE-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]] +; MODULE-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]] +; MODULE-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 +; MODULE-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]] +; MODULE-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00 +; MODULE-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4 +; MODULE-NEXT: store float [[MUL]], float* [[F2]], align 4, !tbaa [[TBAA10]] +; MODULE-NEXT: [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000 +; MODULE-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5 +; MODULE-NEXT: store float [[ADD]], float* [[F3]], align 4, !tbaa [[TBAA11]] +; MODULE-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0 +; MODULE-NEXT: store i32 1, i32* [[I1]], align 4, !tbaa [[TBAA12]] +; MODULE-NEXT: [[MUL1:%.*]] = shl nsw i32 2, 1 +; MODULE-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1 +; MODULE-NEXT: store i32 [[MUL1]], i32* [[I2]], align 4, !tbaa [[TBAA13]] +; MODULE-NEXT: [[ADD2:%.*]] = add nsw i32 3, 1 +; MODULE-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 +; MODULE-NEXT: store i32 [[ADD2]], i32* [[I3]], align 4, !tbaa [[TBAA14]] +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@static_global_simplifiable_1 +; CGSCC-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR4:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-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]] +; CGSCC-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]] +; CGSCC-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]] +; CGSCC-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 +; CGSCC-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]] +; CGSCC-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00 +; CGSCC-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4 +; CGSCC-NEXT: store float [[MUL]], float* [[F2]], align 4, !tbaa [[TBAA10]] +; CGSCC-NEXT: [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000 +; CGSCC-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5 +; CGSCC-NEXT: store float [[ADD]], float* [[F3]], align 4, !tbaa [[TBAA11]] +; CGSCC-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0 +; CGSCC-NEXT: store i32 1, i32* [[I1]], align 4, !tbaa [[TBAA12]] +; CGSCC-NEXT: [[MUL1:%.*]] = shl nsw i32 2, 1 +; CGSCC-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1 +; CGSCC-NEXT: store i32 [[MUL1]], i32* [[I2]], align 4, !tbaa [[TBAA13]] +; CGSCC-NEXT: [[ADD2:%.*]] = add nsw i32 3, 1 +; CGSCC-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 +; CGSCC-NEXT: store i32 [[ADD2]], i32* [[I3]], align 4, !tbaa [[TBAA14]] +; CGSCC-NEXT: ret void ; entry: store float 0x3FF19999A0000000, float* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 3), align 4, !tbaa !7 @@ -1184,291 +820,148 @@ ; for (int i = 0; i < 1024; ++i) ; globalBytes[i] = GBytes[i]; ; } -; 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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@static_global_simplifiable_2 +; MODULE-SAME: () #[[ATTR4]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: br label [[FOR_COND:%.*]] +; MODULE: for.cond: +; MODULE-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ] +; MODULE-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100 +; MODULE-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] +; MODULE: for.cond.cleanup: +; MODULE-NEXT: br label [[FOR_END:%.*]] +; MODULE: for.body: +; MODULE-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10 +; MODULE-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 [[I]] +; MODULE-NEXT: br label [[FOR_INC]] +; MODULE: for.inc: +; MODULE-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 +; MODULE-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP21:![0-9]+]] +; MODULE: for.end: +; MODULE-NEXT: br label [[FOR_COND2:%.*]] +; MODULE: for.cond2: +; MODULE-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ] +; MODULE-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10 +; MODULE-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]] +; MODULE: for.cond.cleanup4: +; MODULE-NEXT: br label [[FOR_END11:%.*]] +; MODULE: for.body5: +; MODULE-NEXT: [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10 +; MODULE-NEXT: [[I16:%.*]] = or i64 [[I15]], 1 +; MODULE-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* bitcast ([1024 x i8]* @GBytes to float*), i64 [[I16]] +; MODULE-NEXT: br label [[FOR_INC9]] +; MODULE: for.inc9: +; MODULE-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1 +; MODULE-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP22:![0-9]+]] +; MODULE: for.end11: +; MODULE-NEXT: br label [[FOR_COND13:%.*]] +; MODULE: for.cond13: +; MODULE-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ] +; MODULE-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20 +; MODULE-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]] +; MODULE: for.cond.cleanup15: +; MODULE-NEXT: br label [[FOR_END23:%.*]] +; MODULE: for.body16: +; MODULE-NEXT: [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10 +; MODULE-NEXT: [[I18:%.*]] = add nuw nsw i64 [[I17]], 2 +; MODULE-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* bitcast ([1024 x i8]* @GBytes to i64*), i64 [[I18]] +; MODULE-NEXT: br label [[FOR_INC21]] +; MODULE: for.inc21: +; MODULE-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 +; MODULE-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP23:![0-9]+]] +; MODULE: for.end23: +; MODULE-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]] +; MODULE-NEXT: br label [[FOR_COND25:%.*]] +; MODULE: for.cond25: +; MODULE-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC33:%.*]] ], [ 0, [[FOR_END23]] ] +; MODULE-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024 +; MODULE-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY28:%.*]], label [[FOR_COND_CLEANUP27:%.*]] +; MODULE: for.cond.cleanup27: +; MODULE-NEXT: br label [[FOR_END35:%.*]] +; MODULE: for.body28: +; MODULE-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]] +; MODULE-NEXT: store i8 0, i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA19]] +; MODULE-NEXT: br label [[FOR_INC33]] +; MODULE: for.inc33: +; MODULE-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 +; MODULE-NEXT: br label [[FOR_COND25]], !llvm.loop [[LOOP24:![0-9]+]] +; MODULE: for.end35: +; MODULE-NEXT: ret void +; +; CGSCC-LABEL: define {{[^@]+}}@static_global_simplifiable_2() { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br label [[FOR_COND:%.*]] +; CGSCC: for.cond: +; CGSCC-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ] +; CGSCC-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100 +; CGSCC-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] +; CGSCC: for.cond.cleanup: +; CGSCC-NEXT: br label [[FOR_END:%.*]] +; CGSCC: for.body: +; CGSCC-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10 +; CGSCC-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 [[I]] +; CGSCC-NEXT: store i8 0, i8* [[ARRAYIDX]], align 2, !tbaa [[TBAA15]] +; CGSCC-NEXT: br label [[FOR_INC]] +; CGSCC: for.inc: +; CGSCC-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 +; CGSCC-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP24:![0-9]+]] +; CGSCC: for.end: +; CGSCC-NEXT: br label [[FOR_COND2:%.*]] +; CGSCC: for.cond2: +; CGSCC-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ] +; CGSCC-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10 +; CGSCC-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]] +; CGSCC: for.cond.cleanup4: +; CGSCC-NEXT: br label [[FOR_END11:%.*]] +; CGSCC: for.body5: +; CGSCC-NEXT: [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10 +; CGSCC-NEXT: [[I16:%.*]] = or i64 [[I15]], 1 +; CGSCC-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* bitcast ([1024 x i8]* @GBytes to float*), i64 [[I16]] +; CGSCC-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA18]] +; CGSCC-NEXT: br label [[FOR_INC9]] +; CGSCC: for.inc9: +; CGSCC-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1 +; CGSCC-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP25:![0-9]+]] +; CGSCC: for.end11: +; CGSCC-NEXT: br label [[FOR_COND13:%.*]] +; CGSCC: for.cond13: +; CGSCC-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ] +; CGSCC-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20 +; CGSCC-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]] +; CGSCC: for.cond.cleanup15: +; CGSCC-NEXT: br label [[FOR_END23:%.*]] +; CGSCC: for.body16: +; CGSCC-NEXT: [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10 +; CGSCC-NEXT: [[I18:%.*]] = add nuw nsw i64 [[I17]], 2 +; CGSCC-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* bitcast ([1024 x i8]* @GBytes to i64*), i64 [[I18]] +; CGSCC-NEXT: store i64 0, i64* [[ARRAYIDX20]], align 16, !tbaa [[TBAA20]] +; CGSCC-NEXT: br label [[FOR_INC21]] +; CGSCC: for.inc21: +; CGSCC-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 +; CGSCC-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP26:![0-9]+]] +; CGSCC: for.end23: +; CGSCC-NEXT: store i8 0, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 1023), align 1, !tbaa [[TBAA15]] +; CGSCC-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]] +; CGSCC-NEXT: br label [[FOR_COND25:%.*]] +; CGSCC: for.cond25: +; CGSCC-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC33:%.*]] ], [ 0, [[FOR_END23]] ] +; CGSCC-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024 +; CGSCC-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY28:%.*]], label [[FOR_COND_CLEANUP27:%.*]] +; CGSCC: for.cond.cleanup27: +; CGSCC-NEXT: br label [[FOR_END35:%.*]] +; CGSCC: for.body28: +; CGSCC-NEXT: [[ARRAYIDX30:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 [[INDVARS_IV12]] +; CGSCC-NEXT: [[I19:%.*]] = load i8, i8* [[ARRAYIDX30]], align 1, !tbaa [[TBAA15]] +; CGSCC-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]] +; CGSCC-NEXT: store i8 [[I19]], i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA15]] +; CGSCC-NEXT: br label [[FOR_INC33]] +; CGSCC: for.inc33: +; CGSCC-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 +; CGSCC-NEXT: br label [[FOR_COND25]], !llvm.loop [[LOOP27:![0-9]+]] +; CGSCC: for.end35: +; CGSCC-NEXT: ret void ; entry: br label %for.cond @@ -1569,26 +1062,19 @@ ; 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]] +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@static_global_simplifiable_3 +; MODULE-SAME: () #[[ATTR2]] { +; MODULE-NEXT: store i32 1, i32* @Flag3, align 4, !tbaa [[TBAA3]] +; MODULE-NEXT: [[I:%.*]] = load i32, i32* @Flag3, align 4, !tbaa [[TBAA3]] +; MODULE-NEXT: ret i32 [[I]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@static_global_simplifiable_3 +; CGSCC-SAME: () #[[ATTR5:[0-9]+]] { +; CGSCC-NEXT: store i32 1, i32* @Flag3, align 4, !tbaa [[TBAA3]] +; CGSCC-NEXT: [[I:%.*]] = load i32, i32* @Flag3, align 4, !tbaa [[TBAA3]] +; CGSCC-NEXT: ret i32 [[I]] ; store i32 1, i32* @Flag3, align 4, !tbaa !3 %i = load i32, i32* @Flag3, align 4, !tbaa !3 @@ -1611,207 +1097,106 @@ ; r.i3 = s.i3 + s.i1; ; return r; ; } -; 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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_1 +; MODULE-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]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 +; MODULE-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]] +; MODULE-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 +; MODULE-NEXT: store float 0x40019999A0000000, float* [[F2]], align 8, !tbaa [[TBAA10]] +; MODULE-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 +; MODULE-NEXT: store float 0x400A666660000000, float* [[F3]], align 4, !tbaa [[TBAA11]] +; MODULE-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 +; MODULE-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 8 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR4]] +; MODULE-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 +; MODULE-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR4]] +; MODULE-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 +; MODULE-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 8 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR4]] +; MODULE-NEXT: [[F11:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 +; MODULE-NEXT: [[I:%.*]] = load float, float* [[F11]], align 4, !tbaa [[TBAA7]] +; MODULE-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 +; MODULE-NEXT: store float [[I]], float* [[F12]], align 4, !tbaa [[TBAA7]] +; MODULE-NEXT: [[F23:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 +; MODULE-NEXT: [[I4:%.*]] = load float, float* [[F23]], align 8, !tbaa [[TBAA10]] +; MODULE-NEXT: [[MUL:%.*]] = fmul float [[I4]], 2.000000e+00 +; MODULE-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4 +; MODULE-NEXT: store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10]] +; MODULE-NEXT: [[F35:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 +; MODULE-NEXT: [[I5:%.*]] = load float, float* [[F35]], align 4, !tbaa [[TBAA11]] +; MODULE-NEXT: [[F16:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 +; MODULE-NEXT: [[I6:%.*]] = load float, float* [[F16]], align 4, !tbaa [[TBAA7]] +; MODULE-NEXT: [[ADD:%.*]] = fadd float [[I5]], [[I6]] +; MODULE-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5 +; MODULE-NEXT: store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11]] +; MODULE-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 +; MODULE-NEXT: [[I7:%.*]] = load i32, i32* [[I18]], align 8, !tbaa [[TBAA12]] +; MODULE-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0 +; MODULE-NEXT: store i32 [[I7]], i32* [[I19]], align 4, !tbaa [[TBAA12]] +; MODULE-NEXT: [[I210:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 +; MODULE-NEXT: [[I8:%.*]] = load i32, i32* [[I210]], align 4, !tbaa [[TBAA13]] +; MODULE-NEXT: [[MUL11:%.*]] = shl nsw i32 [[I8]], 1 +; MODULE-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1 +; MODULE-NEXT: store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13]] +; MODULE-NEXT: [[I313:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 +; MODULE-NEXT: [[I9:%.*]] = load i32, i32* [[I313]], align 8, !tbaa [[TBAA14]] +; MODULE-NEXT: [[I114:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 +; MODULE-NEXT: [[I10:%.*]] = load i32, i32* [[I114]], align 8, !tbaa [[TBAA12]] +; MODULE-NEXT: [[ADD15:%.*]] = add nsw i32 [[I9]], [[I10]] +; MODULE-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 +; MODULE-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14]] +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_1 +; CGSCC-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]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 +; CGSCC-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]] +; CGSCC-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 +; CGSCC-NEXT: store float 0x40019999A0000000, float* [[F2]], align 8, !tbaa [[TBAA10]] +; CGSCC-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 +; CGSCC-NEXT: store float 0x400A666660000000, float* [[F3]], align 4, !tbaa [[TBAA11]] +; CGSCC-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 +; CGSCC-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR10]] +; CGSCC-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 +; CGSCC-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR10]] +; CGSCC-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 +; CGSCC-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR10]] +; CGSCC-NEXT: [[F11:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 +; CGSCC-NEXT: [[I:%.*]] = load float, float* [[F11]], align 4, !tbaa [[TBAA7]] +; CGSCC-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 +; CGSCC-NEXT: store float [[I]], float* [[F12]], align 4, !tbaa [[TBAA7]] +; CGSCC-NEXT: [[F23:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 +; CGSCC-NEXT: [[I4:%.*]] = load float, float* [[F23]], align 8, !tbaa [[TBAA10]] +; CGSCC-NEXT: [[MUL:%.*]] = fmul float [[I4]], 2.000000e+00 +; CGSCC-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4 +; CGSCC-NEXT: store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10]] +; CGSCC-NEXT: [[F35:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 +; CGSCC-NEXT: [[I5:%.*]] = load float, float* [[F35]], align 4, !tbaa [[TBAA11]] +; CGSCC-NEXT: [[F16:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 +; CGSCC-NEXT: [[I6:%.*]] = load float, float* [[F16]], align 4, !tbaa [[TBAA7]] +; CGSCC-NEXT: [[ADD:%.*]] = fadd float [[I5]], [[I6]] +; CGSCC-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5 +; CGSCC-NEXT: store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11]] +; CGSCC-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 +; CGSCC-NEXT: [[I7:%.*]] = load i32, i32* [[I18]], align 8, !tbaa [[TBAA12]] +; CGSCC-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0 +; CGSCC-NEXT: store i32 [[I7]], i32* [[I19]], align 4, !tbaa [[TBAA12]] +; CGSCC-NEXT: [[I210:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 +; CGSCC-NEXT: [[I8:%.*]] = load i32, i32* [[I210]], align 4, !tbaa [[TBAA13]] +; CGSCC-NEXT: [[MUL11:%.*]] = shl nsw i32 [[I8]], 1 +; CGSCC-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1 +; CGSCC-NEXT: store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13]] +; CGSCC-NEXT: [[I313:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 +; CGSCC-NEXT: [[I9:%.*]] = load i32, i32* [[I313]], align 8, !tbaa [[TBAA14]] +; CGSCC-NEXT: [[I114:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 +; CGSCC-NEXT: [[I10:%.*]] = load i32, i32* [[I114]], align 8, !tbaa [[TBAA12]] +; CGSCC-NEXT: [[ADD15:%.*]] = add nsw i32 [[I9]], [[I10]] +; CGSCC-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 +; CGSCC-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14]] +; CGSCC-NEXT: ret void ; entry: %f1 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 3 @@ -1874,325 +1259,165 @@ ; for (int i = 0; i < 1024; ++i) ; globalBytes[i] = Bytes[i]; ; } -; 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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_2 +; MODULE-SAME: (i8* nocapture nofree [[BYTES:%.*]]) #[[ATTR2]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: br label [[FOR_COND:%.*]] +; MODULE: for.cond: +; MODULE-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ] +; MODULE-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100 +; MODULE-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] +; MODULE: for.cond.cleanup: +; MODULE-NEXT: br label [[FOR_END:%.*]] +; MODULE: for.body: +; MODULE-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10 +; MODULE-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[I]] +; MODULE-NEXT: store i8 0, i8* [[ARRAYIDX]], align 1, !tbaa [[TBAA19]] +; MODULE-NEXT: br label [[FOR_INC]] +; MODULE: for.inc: +; MODULE-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 +; MODULE-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP25:![0-9]+]] +; MODULE: for.end: +; MODULE-NEXT: br label [[FOR_COND2:%.*]] +; MODULE: for.cond2: +; MODULE-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ] +; MODULE-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10 +; MODULE-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]] +; MODULE: for.cond.cleanup4: +; MODULE-NEXT: br label [[FOR_END11:%.*]] +; MODULE: for.body5: +; MODULE-NEXT: [[I15:%.*]] = bitcast i8* [[BYTES]] to float* +; MODULE-NEXT: [[I16:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10 +; MODULE-NEXT: [[I17:%.*]] = or i64 [[I16]], 1 +; MODULE-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I15]], i64 [[I17]] +; MODULE-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA26:![0-9]+]] +; MODULE-NEXT: br label [[FOR_INC9]] +; MODULE: for.inc9: +; MODULE-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1 +; MODULE-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP27:![0-9]+]] +; MODULE: for.end11: +; MODULE-NEXT: br label [[FOR_COND13:%.*]] +; MODULE: for.cond13: +; MODULE-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ] +; MODULE-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20 +; MODULE-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]] +; MODULE: for.cond.cleanup15: +; MODULE-NEXT: br label [[FOR_END23:%.*]] +; MODULE: for.body16: +; MODULE-NEXT: [[I18:%.*]] = bitcast i8* [[BYTES]] to i64* +; MODULE-NEXT: [[I19:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10 +; MODULE-NEXT: [[I20:%.*]] = add nuw nsw i64 [[I19]], 2 +; MODULE-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* [[I18]], i64 [[I20]] +; MODULE-NEXT: store i64 0, i64* [[ARRAYIDX20]], align 8, !tbaa [[TBAA28:![0-9]+]] +; MODULE-NEXT: br label [[FOR_INC21]] +; MODULE: for.inc21: +; MODULE-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 +; MODULE-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP30:![0-9]+]] +; MODULE: for.end23: +; MODULE-NEXT: [[ARRAYIDX24:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 1023 +; MODULE-NEXT: store i8 0, i8* [[ARRAYIDX24]], align 1, !tbaa [[TBAA19]] +; MODULE-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 500 +; MODULE-NEXT: [[I21:%.*]] = bitcast i8* [[ARRAYIDX25]] to i32* +; MODULE-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 [[I21]], i32 noundef 0) #[[ATTR4]] +; MODULE-NEXT: br label [[FOR_COND27:%.*]] +; MODULE: for.cond27: +; MODULE-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC35:%.*]] ], [ 0, [[FOR_END23]] ] +; MODULE-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024 +; MODULE-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY30:%.*]], label [[FOR_COND_CLEANUP29:%.*]] +; MODULE: for.cond.cleanup29: +; MODULE-NEXT: br label [[FOR_END37:%.*]] +; MODULE: for.body30: +; MODULE-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[INDVARS_IV12]] +; MODULE-NEXT: [[I22:%.*]] = load i8, i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA19]] +; MODULE-NEXT: [[ARRAYIDX34:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]] +; MODULE-NEXT: store i8 [[I22]], i8* [[ARRAYIDX34]], align 1, !tbaa [[TBAA19]] +; MODULE-NEXT: br label [[FOR_INC35]] +; MODULE: for.inc35: +; MODULE-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 +; MODULE-NEXT: br label [[FOR_COND27]], !llvm.loop [[LOOP31:![0-9]+]] +; MODULE: for.end37: +; MODULE-NEXT: ret void +; +; CGSCC-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_2 +; CGSCC-SAME: (i8* [[BYTES:%.*]]) { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br label [[FOR_COND:%.*]] +; CGSCC: for.cond: +; CGSCC-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ] +; CGSCC-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100 +; CGSCC-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] +; CGSCC: for.cond.cleanup: +; CGSCC-NEXT: br label [[FOR_END:%.*]] +; CGSCC: for.body: +; CGSCC-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10 +; CGSCC-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[I]] +; CGSCC-NEXT: store i8 0, i8* [[ARRAYIDX]], align 1, !tbaa [[TBAA15]] +; CGSCC-NEXT: br label [[FOR_INC]] +; CGSCC: for.inc: +; CGSCC-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 +; CGSCC-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP28:![0-9]+]] +; CGSCC: for.end: +; CGSCC-NEXT: br label [[FOR_COND2:%.*]] +; CGSCC: for.cond2: +; CGSCC-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ] +; CGSCC-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10 +; CGSCC-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]] +; CGSCC: for.cond.cleanup4: +; CGSCC-NEXT: br label [[FOR_END11:%.*]] +; CGSCC: for.body5: +; CGSCC-NEXT: [[I15:%.*]] = bitcast i8* [[BYTES]] to float* +; CGSCC-NEXT: [[I16:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10 +; CGSCC-NEXT: [[I17:%.*]] = or i64 [[I16]], 1 +; CGSCC-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I15]], i64 [[I17]] +; CGSCC-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA18]] +; CGSCC-NEXT: br label [[FOR_INC9]] +; CGSCC: for.inc9: +; CGSCC-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1 +; CGSCC-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP29:![0-9]+]] +; CGSCC: for.end11: +; CGSCC-NEXT: br label [[FOR_COND13:%.*]] +; CGSCC: for.cond13: +; CGSCC-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ] +; CGSCC-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20 +; CGSCC-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]] +; CGSCC: for.cond.cleanup15: +; CGSCC-NEXT: br label [[FOR_END23:%.*]] +; CGSCC: for.body16: +; CGSCC-NEXT: [[I18:%.*]] = bitcast i8* [[BYTES]] to i64* +; CGSCC-NEXT: [[I19:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10 +; CGSCC-NEXT: [[I20:%.*]] = add nuw nsw i64 [[I19]], 2 +; CGSCC-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* [[I18]], i64 [[I20]] +; CGSCC-NEXT: store i64 0, i64* [[ARRAYIDX20]], align 8, !tbaa [[TBAA20]] +; CGSCC-NEXT: br label [[FOR_INC21]] +; CGSCC: for.inc21: +; CGSCC-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 +; CGSCC-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP30:![0-9]+]] +; CGSCC: for.end23: +; CGSCC-NEXT: [[ARRAYIDX24:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 1023 +; CGSCC-NEXT: store i8 0, i8* [[ARRAYIDX24]], align 1, !tbaa [[TBAA15]] +; CGSCC-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 500 +; CGSCC-NEXT: [[I21:%.*]] = bitcast i8* [[ARRAYIDX25]] to i32* +; CGSCC-NEXT: call void @write_arg(i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[I21]], i32 noundef 0) #[[ATTR11]] +; CGSCC-NEXT: br label [[FOR_COND27:%.*]] +; CGSCC: for.cond27: +; CGSCC-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC35:%.*]] ], [ 0, [[FOR_END23]] ] +; CGSCC-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024 +; CGSCC-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY30:%.*]], label [[FOR_COND_CLEANUP29:%.*]] +; CGSCC: for.cond.cleanup29: +; CGSCC-NEXT: br label [[FOR_END37:%.*]] +; CGSCC: for.body30: +; CGSCC-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[INDVARS_IV12]] +; CGSCC-NEXT: [[I22:%.*]] = load i8, i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA15]] +; CGSCC-NEXT: [[ARRAYIDX34:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]] +; CGSCC-NEXT: store i8 [[I22]], i8* [[ARRAYIDX34]], align 1, !tbaa [[TBAA15]] +; CGSCC-NEXT: br label [[FOR_INC35]] +; CGSCC: for.inc35: +; CGSCC-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 +; CGSCC-NEXT: br label [[FOR_COND27]], !llvm.loop [[LOOP31:![0-9]+]] +; CGSCC: for.end37: +; CGSCC-NEXT: ret void ; entry: br label %for.cond @@ -2300,107 +1525,56 @@ ; Z = X ? 1 : 2; ; return X + Y + Z; ; } -; 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]] +; MODULE-LABEL: define {{[^@]+}}@local_alloca_not_simplifiable_1() { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[X:%.*]] = alloca i32, align 4 +; MODULE-NEXT: [[Y:%.*]] = alloca i32, align 4 +; MODULE-NEXT: [[I:%.*]] = bitcast i32* [[X]] to i8* +; MODULE-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR7]] +; MODULE-NEXT: [[I1:%.*]] = bitcast i32* [[Y]] to i8* +; MODULE-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR7]] +; MODULE-NEXT: store i32 1, i32* [[Y]], align 4, !tbaa [[TBAA3]] +; MODULE-NEXT: store i32 1, i32* [[X]], align 4, !tbaa [[TBAA3]] +; MODULE-NEXT: [[I2:%.*]] = bitcast i32* [[X]] to i8* +; MODULE-NEXT: call void @escape(i8* noundef nonnull align 4 dereferenceable(4) [[I2]]) +; MODULE-NEXT: call void @write_random(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[Y]]) +; MODULE-NEXT: [[I3:%.*]] = load i32, i32* [[X]], align 4, !tbaa [[TBAA3]] +; MODULE-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[I3]], 0 +; MODULE-NEXT: [[COND:%.*]] = select i1 [[TOBOOL_NOT]], i32 2, i32 1 +; MODULE-NEXT: [[I4:%.*]] = load i32, i32* [[Y]], align 4, !tbaa [[TBAA3]] +; MODULE-NEXT: [[ADD:%.*]] = add nsw i32 [[I3]], [[I4]] +; MODULE-NEXT: [[ADD1:%.*]] = add nsw i32 [[ADD]], [[COND]] +; MODULE-NEXT: [[I5:%.*]] = bitcast i32* [[Y]] to i8* +; MODULE-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I5]]) +; MODULE-NEXT: [[I6:%.*]] = bitcast i32* [[X]] to i8* +; MODULE-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I6]]) +; MODULE-NEXT: ret i32 [[ADD1]] +; +; CGSCC-LABEL: define {{[^@]+}}@local_alloca_not_simplifiable_1() { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[X:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: [[Y:%.*]] = alloca i32, align 4 +; CGSCC-NEXT: [[I:%.*]] = bitcast i32* [[X]] to i8* +; CGSCC-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR9]] +; CGSCC-NEXT: [[I1:%.*]] = bitcast i32* [[Y]] to i8* +; CGSCC-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR9]] +; CGSCC-NEXT: store i32 1, i32* [[Y]], align 4, !tbaa [[TBAA3]] +; CGSCC-NEXT: store i32 1, i32* [[X]], align 4, !tbaa [[TBAA3]] +; CGSCC-NEXT: [[I2:%.*]] = bitcast i32* [[X]] to i8* +; CGSCC-NEXT: call void @escape(i8* noundef nonnull align 4 dereferenceable(4) [[I2]]) +; CGSCC-NEXT: call void @write_random(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[Y]]) +; CGSCC-NEXT: [[I3:%.*]] = load i32, i32* [[X]], align 4, !tbaa [[TBAA3]] +; CGSCC-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[I3]], 0 +; CGSCC-NEXT: [[COND:%.*]] = select i1 [[TOBOOL_NOT]], i32 2, i32 1 +; CGSCC-NEXT: [[I4:%.*]] = load i32, i32* [[Y]], align 4, !tbaa [[TBAA3]] +; CGSCC-NEXT: [[ADD:%.*]] = add nsw i32 [[I3]], [[I4]] +; CGSCC-NEXT: [[ADD1:%.*]] = add nsw i32 [[ADD]], [[COND]] +; CGSCC-NEXT: [[I5:%.*]] = bitcast i32* [[Y]] to i8* +; CGSCC-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I5]]) +; CGSCC-NEXT: [[I6:%.*]] = bitcast i32* [[X]] to i8* +; CGSCC-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I6]]) +; CGSCC-NEXT: ret i32 [[ADD1]] ; entry: %X = alloca i32, align 4 @@ -2429,43 +1603,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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@unknown_access_mixed_simplifiable +; MODULE-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]]) #[[ATTR3]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 4 +; MODULE-NEXT: [[BC:%.*]] = bitcast %struct.S* [[S]] to i32* +; MODULE-NEXT: [[GEP1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 +; MODULE-NEXT: [[GEP2:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG1]] +; MODULE-NEXT: [[GEP3:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG2]] +; MODULE-NEXT: store i32 7, i32* [[GEP1]], align 4 +; MODULE-NEXT: store i32 7, i32* [[GEP2]], align 4 +; MODULE-NEXT: store i32 7, i32* [[GEP3]], align 4 +; MODULE-NEXT: [[L1:%.*]] = load i32, i32* [[GEP1]], align 4 +; MODULE-NEXT: [[L2:%.*]] = load i32, i32* [[GEP2]], align 4 +; MODULE-NEXT: [[L3:%.*]] = load i32, i32* [[GEP3]], align 4 +; MODULE-NEXT: [[ADD1:%.*]] = add i32 [[L1]], [[L2]] +; MODULE-NEXT: [[ADD2:%.*]] = add i32 [[ADD1]], [[L3]] +; MODULE-NEXT: ret i32 [[ADD2]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@unknown_access_mixed_simplifiable +; CGSCC-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 4 +; CGSCC-NEXT: [[BC:%.*]] = bitcast %struct.S* [[S]] to i32* +; CGSCC-NEXT: [[GEP1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 +; CGSCC-NEXT: [[GEP2:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG1]] +; CGSCC-NEXT: [[GEP3:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG2]] +; CGSCC-NEXT: store i32 7, i32* [[GEP1]], align 4 +; CGSCC-NEXT: store i32 7, i32* [[GEP2]], align 4 +; CGSCC-NEXT: store i32 7, i32* [[GEP3]], align 4 +; CGSCC-NEXT: [[L1:%.*]] = load i32, i32* [[GEP1]], align 4 +; CGSCC-NEXT: [[L2:%.*]] = load i32, i32* [[GEP2]], align 4 +; CGSCC-NEXT: [[L3:%.*]] = load i32, i32* [[GEP3]], align 4 +; CGSCC-NEXT: [[ADD1:%.*]] = add i32 [[L1]], [[L2]] +; CGSCC-NEXT: [[ADD2:%.*]] = add i32 [[ADD1]], [[L3]] +; CGSCC-NEXT: ret i32 [[ADD2]] ; entry: %s = alloca %struct.S, align 4 @@ -2486,55 +1660,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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@unknown_access_mixed_not_simplifiable +; MODULE-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]], i32 [[ARG3:%.*]]) #[[ATTR3]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 4 +; MODULE-NEXT: [[BC:%.*]] = bitcast %struct.S* [[S]] to i32* +; MODULE-NEXT: [[GEP1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 +; MODULE-NEXT: [[GEP2:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG1]] +; MODULE-NEXT: [[GEP3:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG2]] +; MODULE-NEXT: [[BC4A:%.*]] = bitcast %struct.S* [[S]] to i8* +; MODULE-NEXT: [[GEP4:%.*]] = getelementptr inbounds i8, i8* [[BC4A]], i32 [[ARG3]] +; MODULE-NEXT: [[BC4B:%.*]] = bitcast i8* [[GEP4]] to i32* +; MODULE-NEXT: store i32 7, i32* [[GEP1]], align 4 +; MODULE-NEXT: store i32 7, i32* [[GEP2]], align 4 +; MODULE-NEXT: store i32 7, i32* [[GEP3]], align 4 +; MODULE-NEXT: store i32 7, i32* [[BC4B]], align 4 +; MODULE-NEXT: [[L1:%.*]] = load i32, i32* [[GEP1]], align 4 +; MODULE-NEXT: [[L2:%.*]] = load i32, i32* [[GEP2]], align 4 +; MODULE-NEXT: [[L3:%.*]] = load i32, i32* [[GEP3]], align 4 +; MODULE-NEXT: [[L4:%.*]] = load i32, i32* [[BC4B]], align 4 +; MODULE-NEXT: [[ADD1:%.*]] = add i32 [[L1]], [[L2]] +; MODULE-NEXT: [[ADD2:%.*]] = add i32 [[ADD1]], [[L3]] +; MODULE-NEXT: [[ADD3:%.*]] = add i32 [[ADD2]], [[L4]] +; MODULE-NEXT: ret i32 [[ADD3]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@unknown_access_mixed_not_simplifiable +; CGSCC-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]], i32 [[ARG3:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 4 +; CGSCC-NEXT: [[BC:%.*]] = bitcast %struct.S* [[S]] to i32* +; CGSCC-NEXT: [[GEP1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 +; CGSCC-NEXT: [[GEP2:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG1]] +; CGSCC-NEXT: [[GEP3:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG2]] +; CGSCC-NEXT: [[BC4A:%.*]] = bitcast %struct.S* [[S]] to i8* +; CGSCC-NEXT: [[GEP4:%.*]] = getelementptr inbounds i8, i8* [[BC4A]], i32 [[ARG3]] +; CGSCC-NEXT: [[BC4B:%.*]] = bitcast i8* [[GEP4]] to i32* +; CGSCC-NEXT: store i32 7, i32* [[GEP1]], align 4 +; CGSCC-NEXT: store i32 7, i32* [[GEP2]], align 4 +; CGSCC-NEXT: store i32 7, i32* [[GEP3]], align 4 +; CGSCC-NEXT: store i32 7, i32* [[BC4B]], align 4 +; CGSCC-NEXT: [[L1:%.*]] = load i32, i32* [[GEP1]], align 4 +; CGSCC-NEXT: [[L2:%.*]] = load i32, i32* [[GEP2]], align 4 +; CGSCC-NEXT: [[L3:%.*]] = load i32, i32* [[GEP3]], align 4 +; CGSCC-NEXT: [[L4:%.*]] = load i32, i32* [[BC4B]], align 4 +; CGSCC-NEXT: [[ADD1:%.*]] = add i32 [[L1]], [[L2]] +; CGSCC-NEXT: [[ADD2:%.*]] = add i32 [[ADD1]], [[L3]] +; CGSCC-NEXT: [[ADD3:%.*]] = add i32 [[ADD2]], [[L4]] +; CGSCC-NEXT: ret i32 [[ADD3]] ; entry: %s = alloca %struct.S, align 4 @@ -2565,28 +1739,20 @@ ; int global_not_simplifiable_1(int cnd) { ; return Flag0; ; } -; 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]] +; MODULE: Function Attrs: nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@global_not_simplifiable_1 +; MODULE-SAME: (i32 [[CND:%.*]]) #[[ATTR5:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[I:%.*]] = load i32, i32* @Flag0, align 4, !tbaa [[TBAA3]] +; MODULE-NEXT: ret i32 [[I]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@global_not_simplifiable_1 +; CGSCC-SAME: (i32 [[CND:%.*]]) #[[ATTR7:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[I:%.*]] = load i32, i32* @Flag0, align 4, !tbaa [[TBAA3]] +; CGSCC-NEXT: ret i32 [[I]] ; entry: %i = load i32, i32* @Flag0, align 4, !tbaa !3 @@ -2601,7 +1767,6 @@ ; Flag1 = 1; ; return v; ; } -; define i32 @static_global_not_simplifiable_1(i32 %cnd) { ; CHECK-LABEL: define {{[^@]+}}@static_global_not_simplifiable_1 ; CHECK-SAME: (i32 [[CND:%.*]]) { @@ -2667,295 +1832,208 @@ ; int read{,_static,_static_undef}_global(void) { ; return Gint{,static,_static_undef}2; ; } -; ; 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]] +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@write_read_global +; MODULE-SAME: () #[[ATTR2]] { +; MODULE-NEXT: store i32 7, i32* @Gint1, align 4 +; MODULE-NEXT: [[L:%.*]] = load i32, i32* @Gint1, align 4 +; MODULE-NEXT: ret i32 [[L]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@write_read_global +; CGSCC-SAME: () #[[ATTR5]] { +; CGSCC-NEXT: store i32 7, i32* @Gint1, align 4 +; CGSCC-NEXT: [[L:%.*]] = load i32, i32* @Gint1, align 4 +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@write_global +; MODULE-SAME: () #[[ATTR4]] { +; MODULE-NEXT: store i32 7, i32* @Gint2, align 4 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@write_global +; CGSCC-SAME: () #[[ATTR4]] { +; CGSCC-NEXT: store i32 7, i32* @Gint2, align 4 +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@read_global +; MODULE-SAME: () #[[ATTR5]] { +; MODULE-NEXT: [[L:%.*]] = load i32, i32* @Gint2, align 4 +; MODULE-NEXT: ret i32 [[L]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@read_global +; CGSCC-SAME: () #[[ATTR7]] { +; CGSCC-NEXT: [[L:%.*]] = load i32, i32* @Gint2, align 4 +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@write_read_static_global +; MODULE-SAME: () #[[ATTR2]] { +; MODULE-NEXT: store i32 7, i32* @Gstatic_int1, align 4 +; MODULE-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int1, align 4 +; MODULE-NEXT: ret i32 [[L]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@write_read_static_global +; CGSCC-SAME: () #[[ATTR5]] { +; CGSCC-NEXT: store i32 7, i32* @Gstatic_int1, align 4 +; CGSCC-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int1, align 4 +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@write_static_global +; MODULE-SAME: () #[[ATTR4]] { +; MODULE-NEXT: store i32 7, i32* @Gstatic_int2, align 4 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@write_static_global +; CGSCC-SAME: () #[[ATTR4]] { +; CGSCC-NEXT: store i32 7, i32* @Gstatic_int2, align 4 +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@read_static_global +; MODULE-SAME: () #[[ATTR5]] { +; MODULE-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int2, align 4 +; MODULE-NEXT: ret i32 [[L]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@read_static_global +; CGSCC-SAME: () #[[ATTR7]] { +; CGSCC-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int2, align 4 +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@write_read_static_undef_global +; MODULE-SAME: () #[[ATTR4]] { +; MODULE-NEXT: ret i32 7 ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@write_read_static_undef_global -; IS__TUNIT_NPM-SAME: () #[[ATTR4]] { -; IS__TUNIT_NPM-NEXT: ret i32 7 -; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@write_read_static_undef_global -; IS__CGSCC____-SAME: () #[[ATTR4]] { -; IS__CGSCC____-NEXT: ret i32 7 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@write_read_static_undef_global +; CGSCC-SAME: () #[[ATTR4]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@write_static_undef_global +; MODULE-SAME: () #[[ATTR4]] { +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@write_static_undef_global +; CGSCC-SAME: () #[[ATTR4]] { +; CGSCC-NEXT: store i32 7, i32* @Gstatic_undef_int2, align 4 +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@read_static_undef_global +; MODULE-SAME: () #[[ATTR3]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@read_static_undef_global +; CGSCC-SAME: () #[[ATTR2]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@single_read_of_static_global +; MODULE-SAME: () #[[ATTR3]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@single_read_of_static_global +; CGSCC-SAME: () #[[ATTR2]] { +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@phi_store +; MODULE-SAME: () #[[ATTR3]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[A:%.*]] = alloca i16, align 2 +; MODULE-NEXT: [[B:%.*]] = bitcast i16* [[A]] to i8* +; MODULE-NEXT: br label [[LOOP:%.*]] +; MODULE: loop: +; MODULE-NEXT: [[P:%.*]] = phi i8* [ [[B]], [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ] +; MODULE-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] +; MODULE-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1 +; MODULE-NEXT: [[O]] = add nsw i8 [[I]], 1 +; MODULE-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 2 +; MODULE-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] +; MODULE: end: +; MODULE-NEXT: [[S:%.*]] = getelementptr i8, i8* [[B]], i64 1 +; MODULE-NEXT: [[L:%.*]] = load i8, i8* [[S]], align 1 +; MODULE-NEXT: ret i8 [[L]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@phi_store +; CGSCC-SAME: () #[[ATTR2]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[A:%.*]] = alloca i16, align 2 +; CGSCC-NEXT: [[B:%.*]] = bitcast i16* [[A]] to i8* +; CGSCC-NEXT: br label [[LOOP:%.*]] +; CGSCC: loop: +; CGSCC-NEXT: [[P:%.*]] = phi i8* [ [[B]], [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ] +; CGSCC-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] +; CGSCC-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1 +; CGSCC-NEXT: [[O]] = add nsw i8 [[I]], 1 +; CGSCC-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 2 +; CGSCC-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] +; CGSCC: end: +; CGSCC-NEXT: [[S:%.*]] = getelementptr i8, i8* [[B]], i64 1 +; CGSCC-NEXT: [[L:%.*]] = load i8, i8* [[S]], align 1 +; CGSCC-NEXT: ret i8 [[L]] ; entry: %a = alloca i16 @@ -2977,77 +2055,41 @@ ; FIXME: This function returns 1. define i8 @phi_no_store_1() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@phi_no_store_1 -; IS__TUNIT_OPM-SAME: () #[[ATTR2]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: br label [[LOOP:%.*]] -; IS__TUNIT_OPM: loop: -; IS__TUNIT_OPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a1 to i8*), [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ] -; IS__TUNIT_OPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] -; IS__TUNIT_OPM-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1 -; IS__TUNIT_OPM-NEXT: [[O]] = add nsw i8 [[I]], 1 -; IS__TUNIT_OPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 3 -; IS__TUNIT_OPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] -; IS__TUNIT_OPM: end: -; IS__TUNIT_OPM-NEXT: [[L11:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 2), align 2 -; IS__TUNIT_OPM-NEXT: [[L12:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 3), align 1 -; IS__TUNIT_OPM-NEXT: [[ADD:%.*]] = add i8 [[L11]], [[L12]] -; IS__TUNIT_OPM-NEXT: ret i8 [[ADD]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@phi_no_store_1 -; IS__TUNIT_NPM-SAME: () #[[ATTR2]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: br label [[LOOP:%.*]] -; IS__TUNIT_NPM: loop: -; IS__TUNIT_NPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a1 to i8*), [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ] -; IS__TUNIT_NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] -; IS__TUNIT_NPM-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1 -; IS__TUNIT_NPM-NEXT: [[O]] = add nsw i8 [[I]], 1 -; IS__TUNIT_NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 3 -; IS__TUNIT_NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] -; IS__TUNIT_NPM: end: -; IS__TUNIT_NPM-NEXT: [[L11:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 2), align 2 -; IS__TUNIT_NPM-NEXT: [[L12:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 3), align 1 -; IS__TUNIT_NPM-NEXT: [[ADD:%.*]] = add i8 [[L11]], [[L12]] -; IS__TUNIT_NPM-NEXT: ret i8 [[ADD]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@phi_no_store_1 -; IS__CGSCC_OPM-SAME: () #[[ATTR9:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[LOOP:%.*]] -; IS__CGSCC_OPM: loop: -; IS__CGSCC_OPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a1 to i8*), [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ] -; IS__CGSCC_OPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] -; IS__CGSCC_OPM-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1 -; IS__CGSCC_OPM-NEXT: [[O]] = add nsw i8 [[I]], 1 -; IS__CGSCC_OPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 3 -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] -; IS__CGSCC_OPM: end: -; IS__CGSCC_OPM-NEXT: [[L11:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 2), align 2 -; IS__CGSCC_OPM-NEXT: [[L12:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 3), align 1 -; IS__CGSCC_OPM-NEXT: [[ADD:%.*]] = add i8 [[L11]], [[L12]] -; IS__CGSCC_OPM-NEXT: ret i8 [[ADD]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@phi_no_store_1 -; IS__CGSCC_NPM-SAME: () #[[ATTR5]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[LOOP:%.*]] -; IS__CGSCC_NPM: loop: -; IS__CGSCC_NPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a1 to i8*), [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ] -; IS__CGSCC_NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] -; IS__CGSCC_NPM-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1 -; IS__CGSCC_NPM-NEXT: [[O]] = add nsw i8 [[I]], 1 -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 3 -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] -; IS__CGSCC_NPM: end: -; IS__CGSCC_NPM-NEXT: [[L11:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 2), align 2 -; IS__CGSCC_NPM-NEXT: [[L12:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 3), align 1 -; IS__CGSCC_NPM-NEXT: [[ADD:%.*]] = add i8 [[L11]], [[L12]] -; IS__CGSCC_NPM-NEXT: ret i8 [[ADD]] +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@phi_no_store_1 +; MODULE-SAME: () #[[ATTR2]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: br label [[LOOP:%.*]] +; MODULE: loop: +; MODULE-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a1 to i8*), [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ] +; MODULE-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] +; MODULE-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1 +; MODULE-NEXT: [[O]] = add nsw i8 [[I]], 1 +; MODULE-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 3 +; MODULE-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] +; MODULE: end: +; MODULE-NEXT: [[L11:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 2), align 2 +; MODULE-NEXT: [[L12:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 3), align 1 +; MODULE-NEXT: [[ADD:%.*]] = add i8 [[L11]], [[L12]] +; MODULE-NEXT: ret i8 [[ADD]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@phi_no_store_1 +; CGSCC-SAME: () #[[ATTR5]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br label [[LOOP:%.*]] +; CGSCC: loop: +; CGSCC-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a1 to i8*), [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ] +; CGSCC-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] +; CGSCC-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1 +; CGSCC-NEXT: [[O]] = add nsw i8 [[I]], 1 +; CGSCC-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 3 +; CGSCC-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] +; CGSCC: end: +; CGSCC-NEXT: [[L11:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 2), align 2 +; CGSCC-NEXT: [[L12:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 3), align 1 +; CGSCC-NEXT: [[ADD:%.*]] = add i8 [[L11]], [[L12]] +; CGSCC-NEXT: ret i8 [[ADD]] ; entry: %b = bitcast i32* @a1 to i8* @@ -3071,71 +2113,37 @@ ; 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]] +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@phi_no_store_2 +; MODULE-SAME: () #[[ATTR2]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: br label [[LOOP:%.*]] +; MODULE: loop: +; MODULE-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a2 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), [[LOOP]] ] +; MODULE-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] +; MODULE-NEXT: store i8 1, i8* [[P]], align 2 +; MODULE-NEXT: [[O]] = add nsw i8 [[I]], 1 +; MODULE-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7 +; MODULE-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] +; MODULE: end: +; MODULE-NEXT: [[L21:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), align 2 +; MODULE-NEXT: ret i8 [[L21]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@phi_no_store_2 +; CGSCC-SAME: () #[[ATTR5]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br label [[LOOP:%.*]] +; CGSCC: loop: +; CGSCC-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a2 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), [[LOOP]] ] +; CGSCC-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] +; CGSCC-NEXT: store i8 1, i8* [[P]], align 2 +; CGSCC-NEXT: [[O]] = add nsw i8 [[I]], 1 +; CGSCC-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7 +; CGSCC-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] +; CGSCC: end: +; CGSCC-NEXT: [[L21:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), align 2 +; CGSCC-NEXT: ret i8 [[L21]] ; entry: %b = bitcast i32* @a2 to i8* @@ -3158,61 +2166,33 @@ } 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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@phi_no_store_3 +; MODULE-SAME: () #[[ATTR4]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: br label [[LOOP:%.*]] +; MODULE: loop: +; MODULE-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a3 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a3 to i8*), i64 2), [[LOOP]] ] +; MODULE-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] +; MODULE-NEXT: [[O]] = add nsw i8 [[I]], 1 +; MODULE-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7 +; MODULE-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] +; MODULE: end: +; MODULE-NEXT: ret i8 1 +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@phi_no_store_3 +; CGSCC-SAME: () #[[ATTR4]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br label [[LOOP:%.*]] +; CGSCC: loop: +; CGSCC-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a3 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a3 to i8*), i64 2), [[LOOP]] ] +; CGSCC-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] +; CGSCC-NEXT: [[O]] = add nsw i8 [[I]], 1 +; CGSCC-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7 +; CGSCC-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] +; CGSCC: end: +; CGSCC-NEXT: ret i8 1 ; entry: %b = bitcast i32* @a3 to i8* @@ -3237,26 +2217,19 @@ } 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]] +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@cast_and_load_1 +; MODULE-SAME: () #[[ATTR2]] { +; MODULE-NEXT: store i32 42, i32* @bytes1, align 4 +; MODULE-NEXT: [[L:%.*]] = load i8, i8* bitcast (i32* @bytes1 to i8*), align 4 +; MODULE-NEXT: ret i8 [[L]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@cast_and_load_1 +; CGSCC-SAME: () #[[ATTR5]] { +; CGSCC-NEXT: store i32 42, i32* @bytes1, align 4 +; CGSCC-NEXT: [[L:%.*]] = load i8, i8* bitcast (i32* @bytes1 to i8*), align 4 +; CGSCC-NEXT: ret i8 [[L]] ; store i32 42, i32* @bytes1 %bc = bitcast i32* @bytes1 to i8* @@ -3265,26 +2238,19 @@ } 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]] +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@cast_and_load_2 +; MODULE-SAME: () #[[ATTR2]] { +; MODULE-NEXT: store i32 42, i32* @bytes2, align 4 +; MODULE-NEXT: [[L:%.*]] = load i64, i64* bitcast (i32* @bytes2 to i64*), align 4 +; MODULE-NEXT: ret i64 [[L]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@cast_and_load_2 +; CGSCC-SAME: () #[[ATTR5]] { +; CGSCC-NEXT: store i32 42, i32* @bytes2, align 4 +; CGSCC-NEXT: [[L:%.*]] = load i64, i64* bitcast (i32* @bytes2 to i64*), align 4 +; CGSCC-NEXT: ret i64 [[L]] ; store i32 42, i32* @bytes2 %bc = bitcast i32* @bytes2 to i64* @@ -3293,50 +2259,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 +; MODULE: Function Attrs: nofree nosync nounwind writeonly +; MODULE-LABEL: define {{[^@]+}}@recursive_load_store +; MODULE-SAME: (i64 [[N:%.*]], i32 [[V:%.*]]) #[[ATTR6:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: br label [[FOR_COND:%.*]] +; MODULE: for.cond: +; MODULE-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY:%.*]] ], [ 0, [[ENTRY:%.*]] ] +; MODULE-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], [[N]] +; MODULE-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY]], label [[FOR_END:%.*]] +; MODULE: for.body: +; MODULE-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 +; MODULE-NEXT: br label [[FOR_COND]] +; MODULE: for.end: +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind writeonly +; CGSCC-LABEL: define {{[^@]+}}@recursive_load_store +; CGSCC-SAME: (i64 [[N:%.*]], i32 [[V:%.*]]) #[[ATTR8:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br label [[FOR_COND:%.*]] +; CGSCC: for.cond: +; CGSCC-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY:%.*]] ], [ 0, [[ENTRY:%.*]] ] +; CGSCC-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], [[N]] +; CGSCC-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY]], label [[FOR_END:%.*]] +; CGSCC: for.body: +; CGSCC-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 +; CGSCC-NEXT: br label [[FOR_COND]] +; CGSCC: for.end: +; CGSCC-NEXT: ret void ; entry: store i32 %v, i32* @rec_storage @@ -3395,117 +2346,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 } +; MODULE: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; MODULE: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn } +; MODULE: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn } +; MODULE: attributes #[[ATTR3]] = { nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR4]] = { nofree nosync nounwind willreturn writeonly } +; MODULE: attributes #[[ATTR5]] = { nofree nosync nounwind readonly willreturn } +; MODULE: attributes #[[ATTR6]] = { nofree nosync nounwind writeonly } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; CGSCC: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR4]] = { nofree norecurse nosync nounwind willreturn writeonly } +; CGSCC: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR6]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR7]] = { nofree norecurse nosync nounwind readonly willreturn } +; CGSCC: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind writeonly } +; CGSCC: attributes #[[ATTR9]] = { willreturn } +; CGSCC: attributes #[[ATTR10]] = { nounwind willreturn writeonly } +; CGSCC: 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} +; MODULE: [[META0:![0-9]+]] = !{i32 1, !"wchar_size", i32 4} +; MODULE: [[META1:![0-9]+]] = !{i32 7, !"uwtable", i32 1} +; MODULE: [[META2:![0-9]+]] = !{!"clang version 13.0.0"} +; MODULE: [[TBAA3]] = !{!4, !4, i64 0} +; MODULE: [[META4:![0-9]+]] = !{!"int", !5, i64 0} +; MODULE: [[META5:![0-9]+]] = !{!"omnipotent char", !6, i64 0} +; MODULE: [[META6:![0-9]+]] = !{!"Simple C/C++ TBAA"} +; MODULE: [[TBAA7]] = !{!8, !9, i64 12} +; MODULE: [[META8:![0-9]+]] = !{!"S", !4, i64 0, !4, i64 4, !4, i64 8, !9, i64 12, !9, i64 16, !9, i64 20} +; MODULE: [[META9:![0-9]+]] = !{!"float", !5, i64 0} +; MODULE: [[TBAA10]] = !{!8, !9, i64 16} +; MODULE: [[TBAA11]] = !{!8, !9, i64 20} +; MODULE: [[TBAA12]] = !{!8, !4, i64 0} +; MODULE: [[TBAA13]] = !{!8, !4, i64 4} +; MODULE: [[TBAA14]] = !{!8, !4, i64 8} +; MODULE: [[LOOP15]] = distinct !{!15, !16} +; MODULE: [[META16:![0-9]+]] = !{!"llvm.loop.mustprogress"} +; MODULE: [[LOOP17]] = distinct !{!17, !16} +; MODULE: [[LOOP18]] = distinct !{!18, !16} +; MODULE: [[TBAA19]] = !{!5, !5, i64 0} +; MODULE: [[LOOP20]] = distinct !{!20, !16} +; MODULE: [[LOOP21]] = distinct !{!21, !16} +; MODULE: [[LOOP22]] = distinct !{!22, !16} +; MODULE: [[LOOP23]] = distinct !{!23, !16} +; MODULE: [[LOOP24]] = distinct !{!24, !16} +; MODULE: [[LOOP25]] = distinct !{!25, !16} +; MODULE: [[TBAA26]] = !{!9, !9, i64 0} +; MODULE: [[LOOP27]] = distinct !{!27, !16} +; MODULE: [[TBAA28]] = !{!29, !29, i64 0} +; MODULE: [[META29:![0-9]+]] = !{!"long long", !5, i64 0} +; MODULE: [[LOOP30]] = distinct !{!30, !16} +; MODULE: [[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} +; CGSCC: [[META0:![0-9]+]] = !{i32 1, !"wchar_size", i32 4} +; CGSCC: [[META1:![0-9]+]] = !{i32 7, !"uwtable", i32 1} +; CGSCC: [[META2:![0-9]+]] = !{!"clang version 13.0.0"} +; CGSCC: [[TBAA3]] = !{!4, !4, i64 0} +; CGSCC: [[META4:![0-9]+]] = !{!"int", !5, i64 0} +; CGSCC: [[META5:![0-9]+]] = !{!"omnipotent char", !6, i64 0} +; CGSCC: [[META6:![0-9]+]] = !{!"Simple C/C++ TBAA"} +; CGSCC: [[TBAA7]] = !{!8, !9, i64 12} +; CGSCC: [[META8:![0-9]+]] = !{!"S", !4, i64 0, !4, i64 4, !4, i64 8, !9, i64 12, !9, i64 16, !9, i64 20} +; CGSCC: [[META9:![0-9]+]] = !{!"float", !5, i64 0} +; CGSCC: [[TBAA10]] = !{!8, !9, i64 16} +; CGSCC: [[TBAA11]] = !{!8, !9, i64 20} +; CGSCC: [[TBAA12]] = !{!8, !4, i64 0} +; CGSCC: [[TBAA13]] = !{!8, !4, i64 4} +; CGSCC: [[TBAA14]] = !{!8, !4, i64 8} +; CGSCC: [[TBAA15]] = !{!5, !5, i64 0} +; CGSCC: [[LOOP16]] = distinct !{!16, !17} +; CGSCC: [[META17:![0-9]+]] = !{!"llvm.loop.mustprogress"} +; CGSCC: [[TBAA18]] = !{!9, !9, i64 0} +; CGSCC: [[LOOP19]] = distinct !{!19, !17} +; CGSCC: [[TBAA20]] = !{!21, !21, i64 0} +; CGSCC: [[META21:![0-9]+]] = !{!"long long", !5, i64 0} +; CGSCC: [[LOOP22]] = distinct !{!22, !17} +; CGSCC: [[LOOP23]] = distinct !{!23, !17} +; CGSCC: [[LOOP24]] = distinct !{!24, !17} +; CGSCC: [[LOOP25]] = distinct !{!25, !17} +; CGSCC: [[LOOP26]] = distinct !{!26, !17} +; CGSCC: [[LOOP27]] = distinct !{!27, !17} +; CGSCC: [[LOOP28]] = distinct !{!28, !17} +; CGSCC: [[LOOP29]] = distinct !{!29, !17} +; CGSCC: [[LOOP30]] = distinct !{!30, !17} +; CGSCC: [[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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" declare void @f(i32) @@ -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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@const_ptr_return_as3 +; CGSCC-SAME: () #[[ATTR1:[0-9]+]] { +; CGSCC-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@const_ptr_return +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@return0 +; MODULE-SAME: () #[[ATTR1:[0-9]+]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@return0 +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@return1 +; MODULE-SAME: () #[[ATTR1]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@return1 +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test2_1 +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: br i1 [[C]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] +; MODULE: if.true: +; MODULE-NEXT: [[RET0:%.*]] = add i32 0, 1 +; MODULE-NEXT: br label [[END:%.*]] +; MODULE: if.false: +; MODULE-NEXT: br label [[END]] +; MODULE: end: +; MODULE-NEXT: [[RET:%.*]] = phi i32 [ [[RET0]], [[IF_TRUE]] ], [ 1, [[IF_FALSE]] ] +; MODULE-NEXT: ret i32 1 +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test2_1 +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: br i1 [[C]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] +; CGSCC: if.true: +; CGSCC-NEXT: [[RET0:%.*]] = add i32 0, 1 +; CGSCC-NEXT: br label [[END:%.*]] +; CGSCC: if.false: +; CGSCC-NEXT: br label [[END]] +; CGSCC: end: +; CGSCC-NEXT: [[RET:%.*]] = phi i32 [ [[RET0]], [[IF_TRUE]] ], [ 1, [[IF_FALSE]] ] +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test2_2 +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test2_2 +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@ipccp1 +; MODULE-SAME: (i32 returned [[A:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: br i1 true, label [[T:%.*]], label [[F:%.*]] +; MODULE: t: +; MODULE-NEXT: ret i32 [[A]] +; MODULE: f: +; MODULE-NEXT: unreachable +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@ipccp1 +; CGSCC-SAME: (i32 returned [[A:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: br i1 true, label [[T:%.*]], label [[F:%.*]] +; CGSCC: t: +; CGSCC-NEXT: ret i32 [[A]] +; CGSCC: f: +; CGSCC-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@ipccp2i +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-NEXT: br label [[T:%.*]] +; CGSCC: t: +; CGSCC-NEXT: ret i1 undef +; CGSCC: f: +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@ipccp2 +; MODULE-SAME: () #[[ATTR1]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@ipccp2 +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@ipccp2ib +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-NEXT: br label [[T:%.*]] +; CGSCC: t: +; CGSCC-NEXT: ret i1 undef +; CGSCC: f: +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@ipccp2b +; MODULE-SAME: () #[[ATTR1]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@ipccp2b +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@ipccp3i +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-NEXT: br label [[T:%.*]] +; CGSCC: t: +; CGSCC-NEXT: ret i32 undef +; CGSCC: f: +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@ipccp3 +; MODULE-SAME: () #[[ATTR1]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@ipccp3 +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@ipccp4ia +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-NEXT: br label [[T:%.*]] +; CGSCC: t: +; CGSCC-NEXT: ret i32 undef +; CGSCC: f: +; CGSCC-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@ipccp4ib +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-NEXT: [[C:%.*]] = icmp eq i32 7, 7 +; CGSCC-NEXT: br i1 true, label [[T:%.*]], label [[F:%.*]] +; CGSCC: t: +; CGSCC-NEXT: ret i32 undef +; CGSCC: f: +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@ipccp4 +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; MODULE: t: +; MODULE-NEXT: br label [[F]] +; MODULE: f: +; MODULE-NEXT: ret i32 0 +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@ipccp4 +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; CGSCC: t: +; CGSCC-NEXT: br label [[F]] +; CGSCC: f: +; CGSCC-NEXT: ret i32 0 ; br i1 %c, label %t, label %f t: @@ -418,73 +416,60 @@ ; 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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test_inalloca +; MODULE-SAME: (i32* noalias nofree nonnull returned writeonly inalloca(i32) dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { +; MODULE-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]] +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test_inalloca +; CGSCC-SAME: (i32* noalias nofree noundef nonnull returned writeonly inalloca(i32) dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@complicated_args_inalloca +; MODULE-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR1]] { +; MODULE-NEXT: [[CALL:%.*]] = call nonnull dereferenceable(4) i32* @test_inalloca(i32* noalias nofree writeonly inalloca(i32) "no-capture-maybe-returned" [[ARG]]) #[[ATTR1]] +; MODULE-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]] +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@complicated_args_inalloca +; CGSCC-SAME: (i32* nofree noundef nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR1]] { +; CGSCC-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]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test_preallocated +; MODULE-SAME: (i32* noalias nofree noundef nonnull returned writeonly preallocated(i32) align 4294967296 dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { +; MODULE-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]] +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test_preallocated +; CGSCC-SAME: (i32* noalias nofree noundef nonnull returned writeonly preallocated(i32) align 4294967296 dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@complicated_args_preallocated +; MODULE-SAME: () #[[ATTR0:[0-9]+]] { +; MODULE-NEXT: [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR4:[0-9]+]] +; MODULE-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]]) ] +; MODULE-NEXT: ret i32* [[CALL]] +; +; CGSCC: Function Attrs: nofree nosync nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@complicated_args_preallocated +; CGSCC-SAME: () #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR4:[0-9]+]] +; CGSCC-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)] @@ -492,59 +477,56 @@ } 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 -; -; 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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@test_sret +; MODULE-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]+]] { +; MODULE-NEXT: store %struct.X* [[A]], %struct.X** [[B]], align 8 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@test_sret +; 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]+]] { +; CGSCC-NEXT: store %struct.X* [[A]], %struct.X** [[B]], align 8 +; CGSCC-NEXT: ret void ; store %struct.X* %a, %struct.X** %b ret void } ; FIXME: Alignment and dereferenceability are not propagated to the argument define void @complicated_args_sret(%struct.X** %b) { +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@complicated_args_sret +; MODULE-SAME: (%struct.X** nocapture nofree writeonly [[B:%.*]]) #[[ATTR2]] { +; MODULE-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]+]] +; MODULE-NEXT: ret void ; -; -; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; IS__TUNIT____-LABEL: define {{[^@]+}}@complicated_args_sret -; IS__TUNIT____-SAME: (%struct.X** nocapture nofree writeonly [[B:%.*]]) #[[ATTR2]] { -; IS__TUNIT____-NEXT: call void @test_sret(%struct.X* noalias nocapture nofree noundef writeonly sret([[STRUCT_X:%.*]]) align 4294967296 null, %struct.X** nocapture nofree writeonly align 8 [[B]]) #[[ATTR3:[0-9]+]] -; IS__TUNIT____-NEXT: ret void -; -; IS__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 +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@complicated_args_sret +; CGSCC-SAME: (%struct.X** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[B:%.*]]) #[[ATTR2]] { +; CGSCC-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test_nest +; CGSCC-SAME: (%struct.X* nest noalias nocapture nofree readnone align 4294967296 [[A:%.*]]) #[[ATTR1]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@complicated_args_nest +; MODULE-SAME: () #[[ATTR1]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@complicated_args_nest +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-NEXT: ret %struct.X* null ; %call = call %struct.X* @test_nest(%struct.X* null) ret %struct.X* %call @@ -552,67 +534,41 @@ @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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@test_byval +; MODULE-SAME: (i8* [[TMP0:%.*]]) #[[ATTR2]] { +; MODULE-NEXT: [[A_PRIV:%.*]] = alloca [[STRUCT_X:%.*]], align 8 +; MODULE-NEXT: [[A_PRIV_CAST:%.*]] = bitcast %struct.X* [[A_PRIV]] to i8** +; MODULE-NEXT: store i8* [[TMP0]], i8** [[A_PRIV_CAST]], align 8 +; MODULE-NEXT: [[G0:%.*]] = getelementptr [[STRUCT_X]], %struct.X* [[A_PRIV]], i32 0, i32 0 +; MODULE-NEXT: store i8* null, i8** [[G0]], align 8 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test_byval +; CGSCC-SAME: (i8* noalias nocapture nofree readnone [[TMP0:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: [[A_PRIV:%.*]] = alloca [[STRUCT_X:%.*]], align 8 +; CGSCC-NEXT: [[A_PRIV_CAST:%.*]] = bitcast %struct.X* [[A_PRIV]] to i8** +; CGSCC-NEXT: [[G0:%.*]] = getelementptr [[STRUCT_X]], %struct.X* [[A_PRIV]], i32 0, i32 0 +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@complicated_args_byval +; MODULE-SAME: () #[[ATTR3]] { +; MODULE-NEXT: [[S_CAST:%.*]] = bitcast %struct.X* @S to i8** +; MODULE-NEXT: [[TMP1:%.*]] = load i8*, i8** [[S_CAST]], align 8 +; MODULE-NEXT: call void @test_byval(i8* [[TMP1]]) #[[ATTR3]] +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@complicated_args_byval +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-NEXT: ret void ; call void @test_byval(%struct.X* byval(%struct.X) @S) ret void @@ -621,32 +577,25 @@ 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]] +; MODULE-LABEL: define {{[^@]+}}@test_byval2 +; MODULE-SAME: (i8* [[TMP0:%.*]]) { +; MODULE-NEXT: [[A_PRIV:%.*]] = alloca [[STRUCT_X:%.*]], align 8 +; MODULE-NEXT: [[A_PRIV_CAST:%.*]] = bitcast %struct.X* [[A_PRIV]] to i8** +; MODULE-NEXT: store i8* [[TMP0]], i8** [[A_PRIV_CAST]], align 8 +; MODULE-NEXT: call void @sync() +; MODULE-NEXT: [[G0:%.*]] = getelementptr [[STRUCT_X]], %struct.X* [[A_PRIV]], i32 0, i32 0 +; MODULE-NEXT: [[L:%.*]] = load i8*, i8** [[G0]], align 8 +; MODULE-NEXT: ret i8* [[L]] +; +; CGSCC-LABEL: define {{[^@]+}}@test_byval2 +; CGSCC-SAME: (i8* noalias nofree readnone returned "no-capture-maybe-returned" [[TMP0:%.*]]) { +; CGSCC-NEXT: [[A_PRIV:%.*]] = alloca [[STRUCT_X:%.*]], align 8 +; CGSCC-NEXT: [[A_PRIV_CAST:%.*]] = bitcast %struct.X* [[A_PRIV]] to i8** +; CGSCC-NEXT: store i8* [[TMP0]], i8** [[A_PRIV_CAST]], align 8 +; CGSCC-NEXT: call void @sync() +; CGSCC-NEXT: [[G0:%.*]] = getelementptr [[STRUCT_X]], %struct.X* [[A_PRIV]], i32 0, i32 0 +; CGSCC-NEXT: [[L:%.*]] = load i8*, i8** [[G0]], align 8 +; CGSCC-NEXT: ret i8* [[TMP0]] ; call void @sync() %g0 = getelementptr %struct.X, %struct.X* %a, i32 0, i32 0 @@ -654,122 +603,67 @@ ret i8* %l } define i8* @complicated_args_byval2() { +; MODULE-LABEL: define {{[^@]+}}@complicated_args_byval2() { +; MODULE-NEXT: [[S_CAST:%.*]] = bitcast %struct.X* @S to i8** +; MODULE-NEXT: [[TMP1:%.*]] = load i8*, i8** [[S_CAST]], align 8 +; MODULE-NEXT: [[C:%.*]] = call i8* @test_byval2(i8* [[TMP1]]) +; MODULE-NEXT: ret i8* [[C]] ; -; 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]] -; -; 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]] +; CGSCC-LABEL: define {{[^@]+}}@complicated_args_byval2() { +; CGSCC-NEXT: [[TMP1:%.*]] = load i8*, i8** getelementptr inbounds ([[STRUCT_X:%.*]], %struct.X* @S, i32 0, i32 0), align 8 +; CGSCC-NEXT: [[C:%.*]] = call i8* @test_byval2(i8* noalias nofree readnone "no-capture-maybe-returned" [[TMP1]]) +; CGSCC-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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@fixpoint_changed +; MODULE-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR2]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: br label [[FOR_COND:%.*]] +; MODULE: for.cond: +; MODULE-NEXT: [[J_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[SW_EPILOG:%.*]] ] +; MODULE-NEXT: [[CMP:%.*]] = icmp slt i32 [[J_0]], 30 +; MODULE-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_END:%.*]] +; MODULE: for.body: +; MODULE-NEXT: switch i32 [[J_0]], label [[SW_EPILOG]] [ +; MODULE-NEXT: i32 1, label [[SW_BB:%.*]] +; MODULE-NEXT: ] +; MODULE: sw.bb: +; MODULE-NEXT: br label [[SW_EPILOG]] +; MODULE: sw.epilog: +; MODULE-NEXT: [[X_0:%.*]] = phi i32 [ 255, [[FOR_BODY]] ], [ 253, [[SW_BB]] ] +; MODULE-NEXT: store i32 [[X_0]], i32* [[P]], align 4 +; MODULE-NEXT: [[INC]] = add nsw i32 [[J_0]], 1 +; MODULE-NEXT: br label [[FOR_COND]] +; MODULE: for.end: +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@fixpoint_changed +; CGSCC-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br label [[FOR_COND:%.*]] +; CGSCC: for.cond: +; CGSCC-NEXT: [[J_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[SW_EPILOG:%.*]] ] +; CGSCC-NEXT: [[CMP:%.*]] = icmp slt i32 [[J_0]], 30 +; CGSCC-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_END:%.*]] +; CGSCC: for.body: +; CGSCC-NEXT: switch i32 [[J_0]], label [[SW_EPILOG]] [ +; CGSCC-NEXT: i32 1, label [[SW_BB:%.*]] +; CGSCC-NEXT: ] +; CGSCC: sw.bb: +; CGSCC-NEXT: br label [[SW_EPILOG]] +; CGSCC: sw.epilog: +; CGSCC-NEXT: [[X_0:%.*]] = phi i32 [ 255, [[FOR_BODY]] ], [ 253, [[SW_BB]] ] +; CGSCC-NEXT: store i32 [[X_0]], i32* [[P]], align 4 +; CGSCC-NEXT: [[INC]] = add nsw i32 [[J_0]], 1 +; CGSCC-NEXT: br label [[FOR_COND]] +; CGSCC: for.end: +; CGSCC-NEXT: ret void ; entry: br label %for.cond @@ -799,140 +693,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@caller0 +; MODULE-SAME: () #[[ATTR1]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@caller0 +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@caller1 +; MODULE-SAME: () #[[ATTR1]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@caller1 +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@caller2 +; MODULE-SAME: () #[[ATTR1]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@caller2 +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@caller_middle +; MODULE-SAME: () #[[ATTR1]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@caller_middle +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@caller3 +; MODULE-SAME: () #[[ATTR1]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@caller3 +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@caller4 +; MODULE-SAME: () #[[ATTR1]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@caller4 +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@callee +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@user_as3 +; MODULE-SAME: () #[[ATTR3]] { +; MODULE-NEXT: store i32 0, i32 addrspace(3)* @ConstAS3Ptr, align 4 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@user_as3 +; CGSCC-SAME: () #[[ATTR3:[0-9]+]] { +; CGSCC-NEXT: store i32 0, i32 addrspace(3)* @ConstAS3Ptr, align 4 +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@user +; MODULE-SAME: () #[[ATTR3]] { +; MODULE-NEXT: store i32 0, i32* addrspacecast (i32 addrspace(3)* @ConstAS3Ptr to i32*), align 4 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@user +; CGSCC-SAME: () #[[ATTR3]] { +; CGSCC-NEXT: store i32 0, i32* addrspacecast (i32 addrspace(3)* @ConstAS3Ptr to i32*), align 4 +; CGSCC-NEXT: ret void ; %call = call fastcc i32* @const_ptr_return() store i32 0, i32* %call @@ -941,28 +823,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test_merge_with_undef_values_ptr +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test_merge_with_undef_values_ptr +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; CGSCC-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@undef_then_null +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]] +; CGSCC: a: +; CGSCC-NEXT: ret i1 undef +; CGSCC: b: +; CGSCC-NEXT: ret i1 undef ; %cmp1 = icmp eq i32* %i32Aptr, %i32Bptr %cmp2 = icmp eq i1 %cmp1, false @@ -976,29 +858,28 @@ } 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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test_merge_with_undef_values +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test_merge_with_undef_values +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; CGSCC-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@undef_then_1 +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]] +; CGSCC: a: +; CGSCC-NEXT: ret i1 undef +; CGSCC: b: +; CGSCC-NEXT: ret i1 undef ; %cmp1 = icmp eq i32 %i32A, %i32B %cmp2 = icmp eq i1 %cmp1, false @@ -1012,76 +893,74 @@ } 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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test_select +; MODULE-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test_select +; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { +; CGSCC-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@select +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@icmp +; MODULE-SAME: () #[[ATTR1]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@icmp +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-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 +; MODULE-LABEL: define {{[^@]+}}@test_callee_is_undef +; MODULE-SAME: (void (i32)* nocapture nofree [[FN:%.*]]) { +; MODULE-NEXT: call void @callee_is_undef() +; MODULE-NEXT: call void @unknown_calle_arg_is_undef(void (i32)* nocapture nofree [[FN]]) +; MODULE-NEXT: ret void ; -; IS__CGSCC____-LABEL: define {{[^@]+}}@test_callee_is_undef -; IS__CGSCC____-SAME: (void (i32)* nocapture nofree [[FN:%.*]]) { -; IS__CGSCC____-NEXT: unreachable +; CGSCC-LABEL: define {{[^@]+}}@test_callee_is_undef +; CGSCC-SAME: (void (i32)* nocapture nofree [[FN:%.*]]) { +; CGSCC-NEXT: unreachable ; call void @callee_is_undef(void ()* undef) call void @unknown_calle_arg_is_undef(void (i32)* %fn, i32 undef) ret void } define internal void @callee_is_undef(void ()* %fn) { +; MODULE-LABEL: define {{[^@]+}}@callee_is_undef() { +; MODULE-NEXT: call void undef() +; MODULE-NEXT: ret void ; -; IS__TUNIT____-LABEL: define {{[^@]+}}@callee_is_undef() { -; IS__TUNIT____-NEXT: call void undef() -; IS__TUNIT____-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 +; CGSCC-LABEL: define {{[^@]+}}@callee_is_undef +; CGSCC-SAME: (void ()* nocapture nofree noundef nonnull [[FN:%.*]]) { +; CGSCC-NEXT: call void [[FN]]() +; CGSCC-NEXT: ret void ; call void %fn() ret void } define internal void @unknown_calle_arg_is_undef(void (i32)* %fn, i32 %arg) { -; ; CHECK-LABEL: define {{[^@]+}}@unknown_calle_arg_is_undef ; CHECK-SAME: (void (i32)* nocapture nofree noundef nonnull [[FN:%.*]]) { ; CHECK-NEXT: call void [[FN]](i32 undef) @@ -1097,21 +976,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 +; MODULE: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; MODULE-LABEL: define {{[^@]+}}@f1 +; MODULE-SAME: (i8*** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR2]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[X:%.*]] = getelementptr { [2 x i8*] }, { [2 x i8*] }* @g, i32 0, i32 0, i32 0 +; MODULE-NEXT: store i8** [[X]], i8*** [[A]], align 8 +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly +; CGSCC-LABEL: define {{[^@]+}}@f1 +; CGSCC-SAME: (i8*** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[X:%.*]] = getelementptr { [2 x i8*] }, { [2 x i8*] }* @g, i32 0, i32 0, i32 0 +; CGSCC-NEXT: store i8** [[X]], i8*** [[A]], align 8 +; CGSCC-NEXT: ret void ; entry: %x = getelementptr { [2 x i8*] }, { [2 x i8*] }* @g, i32 0, i32 0, i32 0 @@ -1170,24 +1049,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 +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@test_cmp_null_after_cast +; MODULE-SAME: () #[[ATTR1]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@test_cmp_null_after_cast +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-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 +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@cmp_null_after_cast +; CGSCC-SAME: () #[[ATTR1]] { +; CGSCC-NEXT: ret i1 undef ; %t = trunc i32 %a to i8 %c = icmp eq i8 %t, %b @@ -1270,32 +1149,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 } +; MODULE: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn } +; MODULE: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR2]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; MODULE: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn writeonly } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR2]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; CGSCC: attributes #[[ATTR3]] = { nofree norecurse nosync nounwind willreturn writeonly } +; CGSCC: 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,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=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 +; 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,MODULE +; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC 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 +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@only_return +; MODULE-SAME: () #[[ATTR0:[0-9]+]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@only_return +; CGSCC-SAME: () #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: ret void ; ret void } @@ -35,65 +33,35 @@ ; FIXME: missing willreturn define i32 @fib(i32 %0) local_unnamed_addr #0 { -; IS__TUNIT_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fib -; IS__TUNIT_OPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 2 -; IS__TUNIT_OPM-NEXT: br i1 [[TMP2]], label [[TMP9:%.*]], label [[TMP3:%.*]] -; IS__TUNIT_OPM: 3: -; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = add nsw i32 [[TMP0]], -1 -; IS__TUNIT_OPM-NEXT: [[TMP5:%.*]] = tail call i32 @fib(i32 [[TMP4]]) #[[ATTR15:[0-9]+]] -; IS__TUNIT_OPM-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP0]], -2 -; IS__TUNIT_OPM-NEXT: [[TMP7:%.*]] = tail call i32 @fib(i32 [[TMP6]]) #[[ATTR15]] -; IS__TUNIT_OPM-NEXT: [[TMP8:%.*]] = add nsw i32 [[TMP7]], [[TMP5]] -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP8]] -; IS__TUNIT_OPM: 9: -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP0]] -; -; IS__TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@fib -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 2 -; IS__TUNIT_NPM-NEXT: br i1 [[TMP2]], label [[TMP9:%.*]], label [[TMP3:%.*]] -; IS__TUNIT_NPM: 3: -; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = add nsw i32 [[TMP0]], -1 -; IS__TUNIT_NPM-NEXT: [[TMP5:%.*]] = tail call i32 @fib(i32 [[TMP4]]) #[[ATTR16:[0-9]+]] -; IS__TUNIT_NPM-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP0]], -2 -; IS__TUNIT_NPM-NEXT: [[TMP7:%.*]] = tail call i32 @fib(i32 [[TMP6]]) #[[ATTR16]] -; IS__TUNIT_NPM-NEXT: [[TMP8:%.*]] = add nsw i32 [[TMP7]], [[TMP5]] -; IS__TUNIT_NPM-NEXT: ret i32 [[TMP8]] -; IS__TUNIT_NPM: 9: -; IS__TUNIT_NPM-NEXT: ret i32 [[TMP0]] -; -; IS__CGSCC_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@fib -; IS__CGSCC_OPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 2 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP2]], label [[TMP9:%.*]], label [[TMP3:%.*]] -; IS__CGSCC_OPM: 3: -; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = add nsw i32 [[TMP0]], -1 -; IS__CGSCC_OPM-NEXT: [[TMP5:%.*]] = tail call i32 @fib(i32 [[TMP4]]) #[[ATTR26:[0-9]+]] -; IS__CGSCC_OPM-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP0]], -2 -; IS__CGSCC_OPM-NEXT: [[TMP7:%.*]] = tail call i32 @fib(i32 [[TMP6]]) #[[ATTR26]] -; IS__CGSCC_OPM-NEXT: [[TMP8:%.*]] = add nsw i32 [[TMP7]], [[TMP5]] -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP8]] -; IS__CGSCC_OPM: 9: -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP0]] -; -; IS__CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fib -; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 2 -; IS__CGSCC_NPM-NEXT: br i1 [[TMP2]], label [[TMP9:%.*]], label [[TMP3:%.*]] -; IS__CGSCC_NPM: 3: -; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = add nsw i32 [[TMP0]], -1 -; IS__CGSCC_NPM-NEXT: [[TMP5:%.*]] = tail call i32 @fib(i32 [[TMP4]]) #[[ATTR28:[0-9]+]] -; IS__CGSCC_NPM-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP0]], -2 -; IS__CGSCC_NPM-NEXT: [[TMP7:%.*]] = tail call i32 @fib(i32 [[TMP6]]) #[[ATTR28]] -; IS__CGSCC_NPM-NEXT: [[TMP8:%.*]] = add nsw i32 [[TMP7]], [[TMP5]] -; IS__CGSCC_NPM-NEXT: ret i32 [[TMP8]] -; IS__CGSCC_NPM: 9: -; IS__CGSCC_NPM-NEXT: ret i32 [[TMP0]] +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; MODULE-LABEL: define {{[^@]+}}@fib +; MODULE-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] { +; MODULE-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 2 +; MODULE-NEXT: br i1 [[TMP2]], label [[TMP9:%.*]], label [[TMP3:%.*]] +; MODULE: 3: +; MODULE-NEXT: [[TMP4:%.*]] = add nsw i32 [[TMP0]], -1 +; MODULE-NEXT: [[TMP5:%.*]] = tail call i32 @fib(i32 [[TMP4]]) #[[ATTR16:[0-9]+]] +; MODULE-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP0]], -2 +; MODULE-NEXT: [[TMP7:%.*]] = tail call i32 @fib(i32 [[TMP6]]) #[[ATTR16]] +; MODULE-NEXT: [[TMP8:%.*]] = add nsw i32 [[TMP7]], [[TMP5]] +; MODULE-NEXT: ret i32 [[TMP8]] +; MODULE: 9: +; MODULE-NEXT: ret i32 [[TMP0]] +; +; CGSCC: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; CGSCC-LABEL: define {{[^@]+}}@fib +; CGSCC-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] { +; CGSCC-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 2 +; CGSCC-NEXT: br i1 [[TMP2]], label [[TMP9:%.*]], label [[TMP3:%.*]] +; CGSCC: 3: +; CGSCC-NEXT: [[TMP4:%.*]] = add nsw i32 [[TMP0]], -1 +; CGSCC-NEXT: [[TMP5:%.*]] = tail call i32 @fib(i32 [[TMP4]]) #[[ATTR28:[0-9]+]] +; CGSCC-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP0]], -2 +; CGSCC-NEXT: [[TMP7:%.*]] = tail call i32 @fib(i32 [[TMP6]]) #[[ATTR28]] +; CGSCC-NEXT: [[TMP8:%.*]] = add nsw i32 [[TMP7]], [[TMP5]] +; CGSCC-NEXT: ret i32 [[TMP8]] +; CGSCC: 9: +; CGSCC-NEXT: ret i32 [[TMP0]] ; %2 = icmp slt i32 %0, 2 br i1 %2, label %9, label %3 @@ -121,41 +89,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]] +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable +; MODULE-LABEL: define {{[^@]+}}@fact_maybe_not_halt +; MODULE-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] { +; MODULE-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0]], 0 +; MODULE-NEXT: br i1 [[TMP2]], label [[TMP11:%.*]], label [[TMP3:%.*]] +; MODULE: 3: +; MODULE-NEXT: [[TMP4:%.*]] = phi i32 [ [[TMP8:%.*]], [[TMP3]] ], [ [[TMP0]], [[TMP1:%.*]] ] +; MODULE-NEXT: [[TMP5:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP3]] ], [ 1, [[TMP1]] ] +; MODULE-NEXT: [[TMP6:%.*]] = icmp sgt i32 [[TMP4]], 0 +; MODULE-NEXT: [[TMP7:%.*]] = sext i1 [[TMP6]] to i32 +; MODULE-NEXT: [[TMP8]] = add nsw i32 [[TMP4]], [[TMP7]] +; MODULE-NEXT: [[TMP9]] = mul nsw i32 [[TMP4]], [[TMP5]] +; MODULE-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP8]], 0 +; MODULE-NEXT: br i1 [[TMP10]], label [[TMP11]], label [[TMP3]] +; MODULE: 11: +; MODULE-NEXT: [[TMP12:%.*]] = phi i32 [ 1, [[TMP1]] ], [ [[TMP9]], [[TMP3]] ] +; MODULE-NEXT: ret i32 [[TMP12]] +; +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable +; CGSCC-LABEL: define {{[^@]+}}@fact_maybe_not_halt +; CGSCC-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2:[0-9]+]] { +; CGSCC-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0]], 0 +; CGSCC-NEXT: br i1 [[TMP2]], label [[TMP11:%.*]], label [[TMP3:%.*]] +; CGSCC: 3: +; CGSCC-NEXT: [[TMP4:%.*]] = phi i32 [ [[TMP8:%.*]], [[TMP3]] ], [ [[TMP0]], [[TMP1:%.*]] ] +; CGSCC-NEXT: [[TMP5:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP3]] ], [ 1, [[TMP1]] ] +; CGSCC-NEXT: [[TMP6:%.*]] = icmp sgt i32 [[TMP4]], 0 +; CGSCC-NEXT: [[TMP7:%.*]] = sext i1 [[TMP6]] to i32 +; CGSCC-NEXT: [[TMP8]] = add nsw i32 [[TMP4]], [[TMP7]] +; CGSCC-NEXT: [[TMP9]] = mul nsw i32 [[TMP4]], [[TMP5]] +; CGSCC-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP8]], 0 +; CGSCC-NEXT: br i1 [[TMP10]], label [[TMP11]], label [[TMP3]] +; CGSCC: 11: +; CGSCC-NEXT: [[TMP12:%.*]] = phi i32 [ 1, [[TMP1]] ], [ [[TMP9]], [[TMP3]] ] +; CGSCC-NEXT: ret i32 [[TMP12]] ; %2 = icmp eq i32 %0, 0 br i1 %2, label %11, label %3 @@ -187,69 +155,37 @@ ; } define i32 @fact_loop(i32 %0) local_unnamed_addr #0 { -; IS__TUNIT_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fact_loop -; IS__TUNIT_OPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] { -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 -; IS__TUNIT_OPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] -; IS__TUNIT_OPM: 3: -; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP4]] -; IS__TUNIT_OPM: 5: -; IS__TUNIT_OPM-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__TUNIT_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__TUNIT_OPM-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] -; IS__TUNIT_OPM-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 -; IS__TUNIT_OPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] -; IS__TUNIT_OPM-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] -; -; IS__TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@fact_loop -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 -; IS__TUNIT_NPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] -; IS__TUNIT_NPM: 3: -; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] -; IS__TUNIT_NPM-NEXT: ret i32 [[TMP4]] -; IS__TUNIT_NPM: 5: -; IS__TUNIT_NPM-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__TUNIT_NPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__TUNIT_NPM-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] -; IS__TUNIT_NPM-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 -; IS__TUNIT_NPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] -; IS__TUNIT_NPM-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] -; -; IS__CGSCC_OPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@fact_loop -; IS__CGSCC_OPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] -; IS__CGSCC_OPM: 3: -; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP4]] -; IS__CGSCC_OPM: 5: -; IS__CGSCC_OPM-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__CGSCC_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__CGSCC_OPM-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] -; IS__CGSCC_OPM-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 -; IS__CGSCC_OPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] -; IS__CGSCC_OPM-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] -; -; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fact_loop -; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 -; IS__CGSCC_NPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] -; IS__CGSCC_NPM: 3: -; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] -; IS__CGSCC_NPM-NEXT: ret i32 [[TMP4]] -; IS__CGSCC_NPM: 5: -; IS__CGSCC_NPM-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__CGSCC_NPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__CGSCC_NPM-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] -; IS__CGSCC_NPM-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 -; IS__CGSCC_NPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] -; IS__CGSCC_NPM-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@fact_loop +; MODULE-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { +; MODULE-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 +; MODULE-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] +; MODULE: 3: +; MODULE-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] +; MODULE-NEXT: ret i32 [[TMP4]] +; MODULE: 5: +; MODULE-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] +; MODULE-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] +; MODULE-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] +; MODULE-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 +; MODULE-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] +; MODULE-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] +; +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@fact_loop +; CGSCC-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { +; CGSCC-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 +; CGSCC-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] +; CGSCC: 3: +; CGSCC-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] +; CGSCC-NEXT: ret i32 [[TMP4]] +; CGSCC: 5: +; CGSCC-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] +; CGSCC-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] +; CGSCC-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] +; CGSCC-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 +; CGSCC-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] +; CGSCC-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] ; %2 = icmp slt i32 %0, 1 br i1 %2, label %3, label %5 @@ -279,49 +215,27 @@ declare void @sink() nounwind willreturn nosync nofree define void @mutual_recursion1(i1 %c) #0 { -; IS__TUNIT_OPM: Function Attrs: nofree noinline nosync nounwind uwtable -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@mutual_recursion1 -; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] -; IS__TUNIT_OPM: rec: -; IS__TUNIT_OPM-NEXT: call void @sink() #[[ATTR11:[0-9]+]] -; IS__TUNIT_OPM-NEXT: call void @mutual_recursion2(i1 [[C]]) #[[ATTR23:[0-9]+]] -; IS__TUNIT_OPM-NEXT: br label [[END]] -; IS__TUNIT_OPM: end: -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind uwtable -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@mutual_recursion1 -; IS__TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] -; IS__TUNIT_NPM: rec: -; IS__TUNIT_NPM-NEXT: call void @sink() #[[ATTR11:[0-9]+]] -; IS__TUNIT_NPM-NEXT: call void @mutual_recursion2(i1 noundef [[C]]) #[[ATTR25:[0-9]+]] -; IS__TUNIT_NPM-NEXT: br label [[END]] -; IS__TUNIT_NPM: end: -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nofree noinline nosync nounwind uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@mutual_recursion1 -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] -; IS__CGSCC_OPM: rec: -; IS__CGSCC_OPM-NEXT: call void @sink() #[[ATTR14:[0-9]+]] -; IS__CGSCC_OPM-NEXT: call void @mutual_recursion2(i1 [[C]]) #[[ATTR27:[0-9]+]] -; IS__CGSCC_OPM-NEXT: br label [[END]] -; IS__CGSCC_OPM: end: -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind uwtable -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@mutual_recursion1 -; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] -; IS__CGSCC_NPM: rec: -; IS__CGSCC_NPM-NEXT: call void @sink() #[[ATTR14:[0-9]+]] -; IS__CGSCC_NPM-NEXT: call void @mutual_recursion2(i1 noundef [[C]]) #[[ATTR29:[0-9]+]] -; IS__CGSCC_NPM-NEXT: br label [[END]] -; IS__CGSCC_NPM: end: -; IS__CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree noinline nosync nounwind uwtable +; MODULE-LABEL: define {{[^@]+}}@mutual_recursion1 +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR3:[0-9]+]] { +; MODULE-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] +; MODULE: rec: +; MODULE-NEXT: call void @sink() #[[ATTR11:[0-9]+]] +; MODULE-NEXT: call void @mutual_recursion2(i1 noundef [[C]]) #[[ATTR25:[0-9]+]] +; MODULE-NEXT: br label [[END]] +; MODULE: end: +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree noinline nosync nounwind uwtable +; CGSCC-LABEL: define {{[^@]+}}@mutual_recursion1 +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR4:[0-9]+]] { +; CGSCC-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] +; CGSCC: rec: +; CGSCC-NEXT: call void @sink() #[[ATTR14:[0-9]+]] +; CGSCC-NEXT: call void @mutual_recursion2(i1 noundef [[C]]) #[[ATTR29:[0-9]+]] +; CGSCC-NEXT: br label [[END]] +; CGSCC: end: +; CGSCC-NEXT: ret void ; br i1 %c, label %rec, label %end rec: @@ -334,29 +248,17 @@ define void @mutual_recursion2(i1 %c) #0 { -; IS__TUNIT_OPM: Function Attrs: nofree noinline nosync nounwind uwtable -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@mutual_recursion2 -; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { -; IS__TUNIT_OPM-NEXT: call void @mutual_recursion1(i1 [[C]]) #[[ATTR23]] -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind uwtable -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@mutual_recursion2 -; IS__TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { -; IS__TUNIT_NPM-NEXT: call void @mutual_recursion1(i1 [[C]]) #[[ATTR25]] -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: nofree noinline nosync nounwind uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@mutual_recursion2 -; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR4]] { -; IS__CGSCC_OPM-NEXT: call void @mutual_recursion1(i1 [[C]]) #[[ATTR27]] -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind uwtable -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@mutual_recursion2 -; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR4]] { -; IS__CGSCC_NPM-NEXT: call void @mutual_recursion1(i1 [[C]]) #[[ATTR29]] -; IS__CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: nofree noinline nosync nounwind uwtable +; MODULE-LABEL: define {{[^@]+}}@mutual_recursion2 +; MODULE-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { +; MODULE-NEXT: call void @mutual_recursion1(i1 [[C]]) #[[ATTR25]] +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree noinline nosync nounwind uwtable +; CGSCC-LABEL: define {{[^@]+}}@mutual_recursion2 +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: call void @mutual_recursion1(i1 [[C]]) #[[ATTR29]] +; CGSCC-NEXT: ret void ; call void @mutual_recursion1(i1 %c) ret void @@ -366,21 +268,20 @@ ; TEST 5 (negative case) ; call exit/abort (has noreturn attribute) ; CHECK: Function Attrs: noreturn -; CHECK-NEXT: declare void @exit(i32) local_unnamed_add 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 +; MODULE: Function Attrs: noinline noreturn nounwind uwtable +; MODULE-LABEL: define {{[^@]+}}@only_exit +; MODULE-SAME: () local_unnamed_addr #[[ATTR5:[0-9]+]] { +; MODULE-NEXT: tail call void @exit(i32 noundef 0) #[[ATTR4:[0-9]+]] +; MODULE-NEXT: unreachable +; +; CGSCC: Function Attrs: noinline noreturn nounwind uwtable +; CGSCC-LABEL: define {{[^@]+}}@only_exit +; CGSCC-SAME: () local_unnamed_addr #[[ATTR6:[0-9]+]] { +; CGSCC-NEXT: tail call void @exit(i32 noundef 0) #[[ATTR5:[0-9]+]] +; CGSCC-NEXT: unreachable ; tail call void @exit(i32 0) unreachable @@ -397,41 +298,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 +; MODULE: Function Attrs: noinline nounwind uwtable +; MODULE-LABEL: define {{[^@]+}}@conditional_exit +; MODULE-SAME: (i32 [[TMP0:%.*]], i32* nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR6:[0-9]+]] { +; MODULE-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP0]], 0 +; MODULE-NEXT: br i1 [[TMP3]], label [[TMP5:%.*]], label [[TMP4:%.*]] +; MODULE: 4: +; MODULE-NEXT: tail call void @exit(i32 noundef 0) #[[ATTR4]] +; MODULE-NEXT: unreachable +; MODULE: 5: +; MODULE-NEXT: [[TMP6:%.*]] = load i32, i32* [[TMP1]], align 4 +; MODULE-NEXT: [[TMP7:%.*]] = icmp eq i32 [[TMP6]], 0 +; MODULE-NEXT: br i1 [[TMP7]], label [[TMP9:%.*]], label [[TMP8:%.*]] +; MODULE: 8: +; MODULE-NEXT: tail call void @exit(i32 noundef 1) #[[ATTR4]] +; MODULE-NEXT: unreachable +; MODULE: 9: +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: noinline nounwind uwtable +; CGSCC-LABEL: define {{[^@]+}}@conditional_exit +; CGSCC-SAME: (i32 [[TMP0:%.*]], i32* nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR7:[0-9]+]] { +; CGSCC-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP0]], 0 +; CGSCC-NEXT: br i1 [[TMP3]], label [[TMP5:%.*]], label [[TMP4:%.*]] +; CGSCC: 4: +; CGSCC-NEXT: tail call void @exit(i32 noundef 0) #[[ATTR5]] +; CGSCC-NEXT: unreachable +; CGSCC: 5: +; CGSCC-NEXT: [[TMP6:%.*]] = load i32, i32* [[TMP1]], align 4 +; CGSCC-NEXT: [[TMP7:%.*]] = icmp eq i32 [[TMP6]], 0 +; CGSCC-NEXT: br i1 [[TMP7]], label [[TMP9:%.*]], label [[TMP8:%.*]] +; CGSCC: 8: +; CGSCC-NEXT: tail call void @exit(i32 noundef 1) #[[ATTR5]] +; CGSCC-NEXT: unreachable +; CGSCC: 9: +; CGSCC-NEXT: ret void ; %3 = icmp eq i32 %0, 0 br i1 %3, label %5, label %4 @@ -456,48 +357,35 @@ ; TEST 6 (positive case) ; Call intrinsic function ; CHECK: Function Attrs: nofree nosync nounwind readnone speculatable willreturn -; CHECK-NEXT: declare float @llvm.floor.f32(float) 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 +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@call_floor +; MODULE-SAME: (float [[A:%.*]]) #[[ATTR0]] { +; MODULE-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 +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@call_floor +; CGSCC-SAME: (float [[A:%.*]]) #[[ATTR0]] { +; CGSCC-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]] +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@call_floor2 +; MODULE-SAME: (float [[A:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) #[[ATTR26:[0-9]+]] +; MODULE-NEXT: ret float [[C]] +; +; CGSCC: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@call_floor2 +; CGSCC-SAME: (float [[A:%.*]]) #[[ATTR9:[0-9]+]] { +; CGSCC-NEXT: [[C:%.*]] = tail call float @llvm.floor.f32(float [[A]]) #[[ATTR30:[0-9]+]] +; CGSCC-NEXT: ret float [[C]] ; %c = tail call float @llvm.floor.f32(float %a) ret float %c @@ -509,33 +397,20 @@ ; CHECK: Function Attrs: noinline nounwind uwtable ; CHECK-NOT: willreturn -; CHECK-NEXT: declare void @maybe_noreturn() 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 +; MODULE: Function Attrs: noinline nounwind uwtable +; MODULE-LABEL: define {{[^@]+}}@call_maybe_noreturn +; MODULE-SAME: () #[[ATTR6]] { +; MODULE-NEXT: tail call void @maybe_noreturn() #[[ATTR27:[0-9]+]] +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: noinline nounwind uwtable +; CGSCC-LABEL: define {{[^@]+}}@call_maybe_noreturn +; CGSCC-SAME: () #[[ATTR7]] { +; CGSCC-NEXT: tail call void @maybe_noreturn() #[[ATTR31:[0-9]+]] +; CGSCC-NEXT: ret void ; tail call void @maybe_noreturn() ret void @@ -546,50 +421,37 @@ ; Check propagation. ; CHECK: Function Attrs: norecurse willreturn -; CHECK-NEXT: declare void @will_return() 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 +; MODULE: Function Attrs: noinline nounwind uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@f1 +; MODULE-SAME: () #[[ATTR9:[0-9]+]] { +; MODULE-NEXT: tail call void @will_return() #[[ATTR28:[0-9]+]] +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: noinline norecurse nounwind uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@f1 +; CGSCC-SAME: () #[[ATTR11:[0-9]+]] { +; CGSCC-NEXT: tail call void @will_return() #[[ATTR32:[0-9]+]] +; CGSCC-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 +; MODULE: Function Attrs: noinline nounwind uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@f2 +; MODULE-SAME: () #[[ATTR9]] { +; MODULE-NEXT: tail call void @f1() #[[ATTR11]] +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: noinline norecurse nounwind uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@f2 +; CGSCC-SAME: () #[[ATTR11]] { +; CGSCC-NEXT: tail call void @f1() #[[ATTR14]] +; CGSCC-NEXT: ret void ; tail call void @f1() ret void @@ -600,25 +462,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]] +; MODULE: Function Attrs: noinline noreturn nounwind uwtable +; MODULE-LABEL: define {{[^@]+}}@call_will_return_but_has_loop +; MODULE-SAME: () #[[ATTR5]] { +; MODULE-NEXT: br label [[LABEL1:%.*]] +; MODULE: label1: +; MODULE-NEXT: tail call void @will_return() +; MODULE-NEXT: br label [[LABEL2:%.*]] +; MODULE: label2: +; MODULE-NEXT: br label [[LABEL1]] +; +; CGSCC: Function Attrs: noinline norecurse noreturn nounwind uwtable +; CGSCC-LABEL: define {{[^@]+}}@call_will_return_but_has_loop +; CGSCC-SAME: () #[[ATTR12:[0-9]+]] { +; CGSCC-NEXT: br label [[LABEL1:%.*]] +; CGSCC: label1: +; CGSCC-NEXT: tail call void @will_return() +; CGSCC-NEXT: br label [[LABEL2:%.*]] +; CGSCC: label2: +; CGSCC-NEXT: br label [[LABEL1]] ; br label %label1 label1: @@ -633,57 +495,32 @@ ; invoke a function with willreturn ; CHECK: Function Attrs: noinline uwtable willreturn -; CHECK-NEXT: declare i1 @maybe_raise_exception() 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 +; MODULE: Function Attrs: nounwind willreturn +; MODULE-LABEL: define {{[^@]+}}@invoke_test +; MODULE-SAME: () #[[ATTR11]] personality i32 (...)* @__gxx_personality_v0 { +; MODULE-NEXT: [[TMP1:%.*]] = invoke i1 @maybe_raise_exception() #[[ATTR28]] +; MODULE-NEXT: to label [[N:%.*]] unwind label [[F:%.*]] +; MODULE: N: +; MODULE-NEXT: ret void +; MODULE: F: +; MODULE-NEXT: [[VAL:%.*]] = landingpad { i8*, i32 } +; MODULE-NEXT: catch i8* null +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nounwind willreturn +; CGSCC-LABEL: define {{[^@]+}}@invoke_test +; CGSCC-SAME: () #[[ATTR14]] personality i32 (...)* @__gxx_personality_v0 { +; CGSCC-NEXT: [[TMP1:%.*]] = invoke i1 @maybe_raise_exception() #[[ATTR32]] +; CGSCC-NEXT: to label [[N:%.*]] unwind label [[F:%.*]] +; CGSCC: N: +; CGSCC-NEXT: ret void +; CGSCC: F: +; CGSCC-NEXT: [[VAL:%.*]] = landingpad { i8*, i32 } +; CGSCC-NEXT: catch i8* null +; CGSCC-NEXT: ret void ; invoke i1 @maybe_raise_exception() to label %N unwind label %F @@ -709,69 +546,37 @@ ; } define i32 @loop_constant_trip_count(i32* nocapture readonly %0) #0 { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@loop_constant_trip_count -; IS__TUNIT_OPM-SAME: (i32* nocapture nofree readonly [[TMP0:%.*]]) #[[ATTR12:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: br label [[TMP3:%.*]] -; IS__TUNIT_OPM: 2: -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP8:%.*]] -; IS__TUNIT_OPM: 3: -; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = phi i64 [ 0, [[TMP1:%.*]] ], [ [[TMP9:%.*]], [[TMP3]] ] -; IS__TUNIT_OPM-NEXT: [[TMP5:%.*]] = phi i32 [ 0, [[TMP1]] ], [ [[TMP8]], [[TMP3]] ] -; IS__TUNIT_OPM-NEXT: [[TMP6:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 [[TMP4]] -; IS__TUNIT_OPM-NEXT: [[TMP7:%.*]] = load i32, i32* [[TMP6]], align 4 -; IS__TUNIT_OPM-NEXT: [[TMP8]] = add nsw i32 [[TMP7]], [[TMP5]] -; IS__TUNIT_OPM-NEXT: [[TMP9]] = add nuw nsw i64 [[TMP4]], 1 -; IS__TUNIT_OPM-NEXT: [[TMP10:%.*]] = icmp eq i64 [[TMP9]], 10 -; IS__TUNIT_OPM-NEXT: br i1 [[TMP10]], label [[TMP2:%.*]], label [[TMP3]] -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@loop_constant_trip_count -; IS__TUNIT_NPM-SAME: (i32* nocapture nofree nonnull readonly dereferenceable(4) [[TMP0:%.*]]) #[[ATTR12:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: br label [[TMP3:%.*]] -; IS__TUNIT_NPM: 2: -; IS__TUNIT_NPM-NEXT: ret i32 [[TMP8:%.*]] -; IS__TUNIT_NPM: 3: -; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = phi i64 [ 0, [[TMP1:%.*]] ], [ [[TMP9:%.*]], [[TMP3]] ] -; IS__TUNIT_NPM-NEXT: [[TMP5:%.*]] = phi i32 [ 0, [[TMP1]] ], [ [[TMP8]], [[TMP3]] ] -; IS__TUNIT_NPM-NEXT: [[TMP6:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 [[TMP4]] -; IS__TUNIT_NPM-NEXT: [[TMP7:%.*]] = load i32, i32* [[TMP6]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP8]] = add nsw i32 [[TMP7]], [[TMP5]] -; IS__TUNIT_NPM-NEXT: [[TMP9]] = add nuw nsw i64 [[TMP4]], 1 -; IS__TUNIT_NPM-NEXT: [[TMP10:%.*]] = icmp eq i64 [[TMP9]], 10 -; IS__TUNIT_NPM-NEXT: br i1 [[TMP10]], label [[TMP2:%.*]], label [[TMP3]] -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@loop_constant_trip_count -; IS__CGSCC_OPM-SAME: (i32* nocapture nofree readonly [[TMP0:%.*]]) #[[ATTR15:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: br label [[TMP3:%.*]] -; IS__CGSCC_OPM: 2: -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP8:%.*]] -; IS__CGSCC_OPM: 3: -; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = phi i64 [ 0, [[TMP1:%.*]] ], [ [[TMP9:%.*]], [[TMP3]] ] -; IS__CGSCC_OPM-NEXT: [[TMP5:%.*]] = phi i32 [ 0, [[TMP1]] ], [ [[TMP8]], [[TMP3]] ] -; IS__CGSCC_OPM-NEXT: [[TMP6:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 [[TMP4]] -; IS__CGSCC_OPM-NEXT: [[TMP7:%.*]] = load i32, i32* [[TMP6]], align 4 -; IS__CGSCC_OPM-NEXT: [[TMP8]] = add nsw i32 [[TMP7]], [[TMP5]] -; IS__CGSCC_OPM-NEXT: [[TMP9]] = add nuw nsw i64 [[TMP4]], 1 -; IS__CGSCC_OPM-NEXT: [[TMP10:%.*]] = icmp eq i64 [[TMP9]], 10 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP10]], label [[TMP2:%.*]], label [[TMP3]] -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@loop_constant_trip_count -; IS__CGSCC_NPM-SAME: (i32* nocapture nofree nonnull readonly dereferenceable(4) [[TMP0:%.*]]) #[[ATTR15:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: br label [[TMP3:%.*]] -; IS__CGSCC_NPM: 2: -; IS__CGSCC_NPM-NEXT: ret i32 [[TMP8:%.*]] -; IS__CGSCC_NPM: 3: -; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = phi i64 [ 0, [[TMP1:%.*]] ], [ [[TMP9:%.*]], [[TMP3]] ] -; IS__CGSCC_NPM-NEXT: [[TMP5:%.*]] = phi i32 [ 0, [[TMP1]] ], [ [[TMP8]], [[TMP3]] ] -; IS__CGSCC_NPM-NEXT: [[TMP6:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 [[TMP4]] -; IS__CGSCC_NPM-NEXT: [[TMP7:%.*]] = load i32, i32* [[TMP6]], align 4 -; IS__CGSCC_NPM-NEXT: [[TMP8]] = add nsw i32 [[TMP7]], [[TMP5]] -; IS__CGSCC_NPM-NEXT: [[TMP9]] = add nuw nsw i64 [[TMP4]], 1 -; IS__CGSCC_NPM-NEXT: [[TMP10:%.*]] = icmp eq i64 [[TMP9]], 10 -; IS__CGSCC_NPM-NEXT: br i1 [[TMP10]], label [[TMP2:%.*]], label [[TMP3]] +; MODULE: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@loop_constant_trip_count +; MODULE-SAME: (i32* nocapture nofree nonnull readonly dereferenceable(4) [[TMP0:%.*]]) #[[ATTR12:[0-9]+]] { +; MODULE-NEXT: br label [[TMP3:%.*]] +; MODULE: 2: +; MODULE-NEXT: ret i32 [[TMP8:%.*]] +; MODULE: 3: +; MODULE-NEXT: [[TMP4:%.*]] = phi i64 [ 0, [[TMP1:%.*]] ], [ [[TMP9:%.*]], [[TMP3]] ] +; MODULE-NEXT: [[TMP5:%.*]] = phi i32 [ 0, [[TMP1]] ], [ [[TMP8]], [[TMP3]] ] +; MODULE-NEXT: [[TMP6:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 [[TMP4]] +; MODULE-NEXT: [[TMP7:%.*]] = load i32, i32* [[TMP6]], align 4 +; MODULE-NEXT: [[TMP8]] = add nsw i32 [[TMP7]], [[TMP5]] +; MODULE-NEXT: [[TMP9]] = add nuw nsw i64 [[TMP4]], 1 +; MODULE-NEXT: [[TMP10:%.*]] = icmp eq i64 [[TMP9]], 10 +; MODULE-NEXT: br i1 [[TMP10]], label [[TMP2:%.*]], label [[TMP3]] +; +; CGSCC: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@loop_constant_trip_count +; CGSCC-SAME: (i32* nocapture nofree nonnull readonly dereferenceable(4) [[TMP0:%.*]]) #[[ATTR15:[0-9]+]] { +; CGSCC-NEXT: br label [[TMP3:%.*]] +; CGSCC: 2: +; CGSCC-NEXT: ret i32 [[TMP8:%.*]] +; CGSCC: 3: +; CGSCC-NEXT: [[TMP4:%.*]] = phi i64 [ 0, [[TMP1:%.*]] ], [ [[TMP9:%.*]], [[TMP3]] ] +; CGSCC-NEXT: [[TMP5:%.*]] = phi i32 [ 0, [[TMP1]] ], [ [[TMP8]], [[TMP3]] ] +; CGSCC-NEXT: [[TMP6:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 [[TMP4]] +; CGSCC-NEXT: [[TMP7:%.*]] = load i32, i32* [[TMP6]], align 4 +; CGSCC-NEXT: [[TMP8]] = add nsw i32 [[TMP7]], [[TMP5]] +; CGSCC-NEXT: [[TMP9]] = add nuw nsw i64 [[TMP4]], 1 +; CGSCC-NEXT: [[TMP10:%.*]] = icmp eq i64 [[TMP9]], 10 +; CGSCC-NEXT: br i1 [[TMP10]], label [[TMP2:%.*]], label [[TMP3]] ; br label %3 @@ -801,81 +606,43 @@ ; return ans; ; } define i32 @loop_trip_count_unbound(i32 %0, i32 %1, i32* nocapture readonly %2, i32 %3) local_unnamed_addr #0 { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@loop_trip_count_unbound -; IS__TUNIT_OPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]], i32* nocapture nofree readonly [[TMP2:%.*]], i32 [[TMP3:%.*]]) local_unnamed_addr #[[ATTR12]] { -; IS__TUNIT_OPM-NEXT: [[TMP5:%.*]] = icmp eq i32 [[TMP0]], [[TMP1]] -; IS__TUNIT_OPM-NEXT: br i1 [[TMP5]], label [[TMP6:%.*]], label [[TMP8:%.*]] -; IS__TUNIT_OPM: 6: -; IS__TUNIT_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ 0, [[TMP4:%.*]] ], [ [[TMP14:%.*]], [[TMP8]] ] -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP7]] -; IS__TUNIT_OPM: 8: -; IS__TUNIT_OPM-NEXT: [[TMP9:%.*]] = phi i32 [ [[TMP15:%.*]], [[TMP8]] ], [ [[TMP0]], [[TMP4]] ] -; IS__TUNIT_OPM-NEXT: [[TMP10:%.*]] = phi i32 [ [[TMP14]], [[TMP8]] ], [ 0, [[TMP4]] ] -; IS__TUNIT_OPM-NEXT: [[TMP11:%.*]] = zext i32 [[TMP9]] to i64 -; IS__TUNIT_OPM-NEXT: [[TMP12:%.*]] = getelementptr inbounds i32, i32* [[TMP2]], i64 [[TMP11]] -; IS__TUNIT_OPM-NEXT: [[TMP13:%.*]] = load i32, i32* [[TMP12]], align 4 -; IS__TUNIT_OPM-NEXT: [[TMP14]] = add nsw i32 [[TMP13]], [[TMP10]] -; IS__TUNIT_OPM-NEXT: [[TMP15]] = add i32 [[TMP9]], [[TMP3]] -; IS__TUNIT_OPM-NEXT: [[TMP16:%.*]] = icmp eq i32 [[TMP15]], [[TMP1]] -; IS__TUNIT_OPM-NEXT: br i1 [[TMP16]], label [[TMP6]], label [[TMP8]] -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@loop_trip_count_unbound -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]], i32* nocapture nofree readonly [[TMP2:%.*]], i32 [[TMP3:%.*]]) local_unnamed_addr #[[ATTR13:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: [[TMP5:%.*]] = icmp eq i32 [[TMP0]], [[TMP1]] -; IS__TUNIT_NPM-NEXT: br i1 [[TMP5]], label [[TMP6:%.*]], label [[TMP8:%.*]] -; IS__TUNIT_NPM: 6: -; IS__TUNIT_NPM-NEXT: [[TMP7:%.*]] = phi i32 [ 0, [[TMP4:%.*]] ], [ [[TMP14:%.*]], [[TMP8]] ] -; IS__TUNIT_NPM-NEXT: ret i32 [[TMP7]] -; IS__TUNIT_NPM: 8: -; IS__TUNIT_NPM-NEXT: [[TMP9:%.*]] = phi i32 [ [[TMP15:%.*]], [[TMP8]] ], [ [[TMP0]], [[TMP4]] ] -; IS__TUNIT_NPM-NEXT: [[TMP10:%.*]] = phi i32 [ [[TMP14]], [[TMP8]] ], [ 0, [[TMP4]] ] -; IS__TUNIT_NPM-NEXT: [[TMP11:%.*]] = zext i32 [[TMP9]] to i64 -; IS__TUNIT_NPM-NEXT: [[TMP12:%.*]] = getelementptr inbounds i32, i32* [[TMP2]], i64 [[TMP11]] -; IS__TUNIT_NPM-NEXT: [[TMP13:%.*]] = load i32, i32* [[TMP12]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP14]] = add nsw i32 [[TMP13]], [[TMP10]] -; IS__TUNIT_NPM-NEXT: [[TMP15]] = add i32 [[TMP9]], [[TMP3]] -; IS__TUNIT_NPM-NEXT: [[TMP16:%.*]] = icmp eq i32 [[TMP15]], [[TMP1]] -; IS__TUNIT_NPM-NEXT: br i1 [[TMP16]], label [[TMP6]], label [[TMP8]] -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@loop_trip_count_unbound -; IS__CGSCC_OPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]], i32* nocapture nofree readonly [[TMP2:%.*]], i32 [[TMP3:%.*]]) local_unnamed_addr #[[ATTR15]] { -; IS__CGSCC_OPM-NEXT: [[TMP5:%.*]] = icmp eq i32 [[TMP0]], [[TMP1]] -; IS__CGSCC_OPM-NEXT: br i1 [[TMP5]], label [[TMP6:%.*]], label [[TMP8:%.*]] -; IS__CGSCC_OPM: 6: -; IS__CGSCC_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ 0, [[TMP4:%.*]] ], [ [[TMP14:%.*]], [[TMP8]] ] -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP7]] -; IS__CGSCC_OPM: 8: -; IS__CGSCC_OPM-NEXT: [[TMP9:%.*]] = phi i32 [ [[TMP15:%.*]], [[TMP8]] ], [ [[TMP0]], [[TMP4]] ] -; IS__CGSCC_OPM-NEXT: [[TMP10:%.*]] = phi i32 [ [[TMP14]], [[TMP8]] ], [ 0, [[TMP4]] ] -; IS__CGSCC_OPM-NEXT: [[TMP11:%.*]] = zext i32 [[TMP9]] to i64 -; IS__CGSCC_OPM-NEXT: [[TMP12:%.*]] = getelementptr inbounds i32, i32* [[TMP2]], i64 [[TMP11]] -; IS__CGSCC_OPM-NEXT: [[TMP13:%.*]] = load i32, i32* [[TMP12]], align 4 -; IS__CGSCC_OPM-NEXT: [[TMP14]] = add nsw i32 [[TMP13]], [[TMP10]] -; IS__CGSCC_OPM-NEXT: [[TMP15]] = add i32 [[TMP9]], [[TMP3]] -; IS__CGSCC_OPM-NEXT: [[TMP16:%.*]] = icmp eq i32 [[TMP15]], [[TMP1]] -; IS__CGSCC_OPM-NEXT: br i1 [[TMP16]], label [[TMP6]], label [[TMP8]] -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@loop_trip_count_unbound -; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]], i32* nocapture nofree readonly [[TMP2:%.*]], i32 [[TMP3:%.*]]) local_unnamed_addr #[[ATTR16:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: [[TMP5:%.*]] = icmp eq i32 [[TMP0]], [[TMP1]] -; IS__CGSCC_NPM-NEXT: br i1 [[TMP5]], label [[TMP6:%.*]], label [[TMP8:%.*]] -; IS__CGSCC_NPM: 6: -; IS__CGSCC_NPM-NEXT: [[TMP7:%.*]] = phi i32 [ 0, [[TMP4:%.*]] ], [ [[TMP14:%.*]], [[TMP8]] ] -; IS__CGSCC_NPM-NEXT: ret i32 [[TMP7]] -; IS__CGSCC_NPM: 8: -; IS__CGSCC_NPM-NEXT: [[TMP9:%.*]] = phi i32 [ [[TMP15:%.*]], [[TMP8]] ], [ [[TMP0]], [[TMP4]] ] -; IS__CGSCC_NPM-NEXT: [[TMP10:%.*]] = phi i32 [ [[TMP14]], [[TMP8]] ], [ 0, [[TMP4]] ] -; IS__CGSCC_NPM-NEXT: [[TMP11:%.*]] = zext i32 [[TMP9]] to i64 -; IS__CGSCC_NPM-NEXT: [[TMP12:%.*]] = getelementptr inbounds i32, i32* [[TMP2]], i64 [[TMP11]] -; IS__CGSCC_NPM-NEXT: [[TMP13:%.*]] = load i32, i32* [[TMP12]], align 4 -; IS__CGSCC_NPM-NEXT: [[TMP14]] = add nsw i32 [[TMP13]], [[TMP10]] -; IS__CGSCC_NPM-NEXT: [[TMP15]] = add i32 [[TMP9]], [[TMP3]] -; IS__CGSCC_NPM-NEXT: [[TMP16:%.*]] = icmp eq i32 [[TMP15]], [[TMP1]] -; IS__CGSCC_NPM-NEXT: br i1 [[TMP16]], label [[TMP6]], label [[TMP8]] +; MODULE: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable +; MODULE-LABEL: define {{[^@]+}}@loop_trip_count_unbound +; MODULE-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]], i32* nocapture nofree readonly [[TMP2:%.*]], i32 [[TMP3:%.*]]) local_unnamed_addr #[[ATTR13:[0-9]+]] { +; MODULE-NEXT: [[TMP5:%.*]] = icmp eq i32 [[TMP0]], [[TMP1]] +; MODULE-NEXT: br i1 [[TMP5]], label [[TMP6:%.*]], label [[TMP8:%.*]] +; MODULE: 6: +; MODULE-NEXT: [[TMP7:%.*]] = phi i32 [ 0, [[TMP4:%.*]] ], [ [[TMP14:%.*]], [[TMP8]] ] +; MODULE-NEXT: ret i32 [[TMP7]] +; MODULE: 8: +; MODULE-NEXT: [[TMP9:%.*]] = phi i32 [ [[TMP15:%.*]], [[TMP8]] ], [ [[TMP0]], [[TMP4]] ] +; MODULE-NEXT: [[TMP10:%.*]] = phi i32 [ [[TMP14]], [[TMP8]] ], [ 0, [[TMP4]] ] +; MODULE-NEXT: [[TMP11:%.*]] = zext i32 [[TMP9]] to i64 +; MODULE-NEXT: [[TMP12:%.*]] = getelementptr inbounds i32, i32* [[TMP2]], i64 [[TMP11]] +; MODULE-NEXT: [[TMP13:%.*]] = load i32, i32* [[TMP12]], align 4 +; MODULE-NEXT: [[TMP14]] = add nsw i32 [[TMP13]], [[TMP10]] +; MODULE-NEXT: [[TMP15]] = add i32 [[TMP9]], [[TMP3]] +; MODULE-NEXT: [[TMP16:%.*]] = icmp eq i32 [[TMP15]], [[TMP1]] +; MODULE-NEXT: br i1 [[TMP16]], label [[TMP6]], label [[TMP8]] +; +; CGSCC: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable +; CGSCC-LABEL: define {{[^@]+}}@loop_trip_count_unbound +; CGSCC-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]], i32* nocapture nofree readonly [[TMP2:%.*]], i32 [[TMP3:%.*]]) local_unnamed_addr #[[ATTR16:[0-9]+]] { +; CGSCC-NEXT: [[TMP5:%.*]] = icmp eq i32 [[TMP0]], [[TMP1]] +; CGSCC-NEXT: br i1 [[TMP5]], label [[TMP6:%.*]], label [[TMP8:%.*]] +; CGSCC: 6: +; CGSCC-NEXT: [[TMP7:%.*]] = phi i32 [ 0, [[TMP4:%.*]] ], [ [[TMP14:%.*]], [[TMP8]] ] +; CGSCC-NEXT: ret i32 [[TMP7]] +; CGSCC: 8: +; CGSCC-NEXT: [[TMP9:%.*]] = phi i32 [ [[TMP15:%.*]], [[TMP8]] ], [ [[TMP0]], [[TMP4]] ] +; CGSCC-NEXT: [[TMP10:%.*]] = phi i32 [ [[TMP14]], [[TMP8]] ], [ 0, [[TMP4]] ] +; CGSCC-NEXT: [[TMP11:%.*]] = zext i32 [[TMP9]] to i64 +; CGSCC-NEXT: [[TMP12:%.*]] = getelementptr inbounds i32, i32* [[TMP2]], i64 [[TMP11]] +; CGSCC-NEXT: [[TMP13:%.*]] = load i32, i32* [[TMP12]], align 4 +; CGSCC-NEXT: [[TMP14]] = add nsw i32 [[TMP13]], [[TMP10]] +; CGSCC-NEXT: [[TMP15]] = add i32 [[TMP9]], [[TMP3]] +; CGSCC-NEXT: [[TMP16:%.*]] = icmp eq i32 [[TMP15]], [[TMP1]] +; CGSCC-NEXT: br i1 [[TMP16]], label [[TMP6]], label [[TMP8]] ; %5 = icmp eq i32 %0, %1 br i1 %5, label %6, label %8 @@ -909,89 +676,47 @@ define i32 @loop_trip_dec(i32 %0, i32* nocapture readonly %1) local_unnamed_addr #0 { -; IS__TUNIT_OPM: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@loop_trip_dec -; IS__TUNIT_OPM-SAME: (i32 [[TMP0:%.*]], i32* nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR12]] { -; IS__TUNIT_OPM-NEXT: [[TMP3:%.*]] = icmp sgt i32 [[TMP0]], -1 -; IS__TUNIT_OPM-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP14:%.*]] -; IS__TUNIT_OPM: 4: -; IS__TUNIT_OPM-NEXT: [[TMP5:%.*]] = sext i32 [[TMP0]] to i64 -; IS__TUNIT_OPM-NEXT: br label [[TMP6:%.*]] -; IS__TUNIT_OPM: 6: -; IS__TUNIT_OPM-NEXT: [[TMP7:%.*]] = phi i64 [ [[TMP5]], [[TMP4]] ], [ [[TMP12:%.*]], [[TMP6]] ] -; IS__TUNIT_OPM-NEXT: [[TMP8:%.*]] = phi i32 [ 0, [[TMP4]] ], [ [[TMP11:%.*]], [[TMP6]] ] -; IS__TUNIT_OPM-NEXT: [[TMP9:%.*]] = getelementptr inbounds i32, i32* [[TMP1]], i64 [[TMP7]] -; IS__TUNIT_OPM-NEXT: [[TMP10:%.*]] = load i32, i32* [[TMP9]], align 4 -; IS__TUNIT_OPM-NEXT: [[TMP11]] = add nsw i32 [[TMP10]], [[TMP8]] -; IS__TUNIT_OPM-NEXT: [[TMP12]] = add nsw i64 [[TMP7]], -1 -; IS__TUNIT_OPM-NEXT: [[TMP13:%.*]] = icmp sgt i64 [[TMP7]], 0 -; IS__TUNIT_OPM-NEXT: br i1 [[TMP13]], label [[TMP6]], label [[TMP14]] -; IS__TUNIT_OPM: 14: -; IS__TUNIT_OPM-NEXT: [[TMP15:%.*]] = phi i32 [ 0, [[TMP2:%.*]] ], [ [[TMP11]], [[TMP6]] ] -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP15]] -; -; IS__TUNIT_NPM: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@loop_trip_dec -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i32* nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR12]] { -; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = icmp sgt i32 [[TMP0]], -1 -; IS__TUNIT_NPM-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP14:%.*]] -; IS__TUNIT_NPM: 4: -; IS__TUNIT_NPM-NEXT: [[TMP5:%.*]] = sext i32 [[TMP0]] to i64 -; IS__TUNIT_NPM-NEXT: br label [[TMP6:%.*]] -; IS__TUNIT_NPM: 6: -; IS__TUNIT_NPM-NEXT: [[TMP7:%.*]] = phi i64 [ [[TMP5]], [[TMP4]] ], [ [[TMP12:%.*]], [[TMP6]] ] -; IS__TUNIT_NPM-NEXT: [[TMP8:%.*]] = phi i32 [ 0, [[TMP4]] ], [ [[TMP11:%.*]], [[TMP6]] ] -; IS__TUNIT_NPM-NEXT: [[TMP9:%.*]] = getelementptr inbounds i32, i32* [[TMP1]], i64 [[TMP7]] -; IS__TUNIT_NPM-NEXT: [[TMP10:%.*]] = load i32, i32* [[TMP9]], align 4 -; IS__TUNIT_NPM-NEXT: [[TMP11]] = add nsw i32 [[TMP10]], [[TMP8]] -; IS__TUNIT_NPM-NEXT: [[TMP12]] = add nsw i64 [[TMP7]], -1 -; IS__TUNIT_NPM-NEXT: [[TMP13:%.*]] = icmp sgt i64 [[TMP7]], 0 -; IS__TUNIT_NPM-NEXT: br i1 [[TMP13]], label [[TMP6]], label [[TMP14]] -; IS__TUNIT_NPM: 14: -; IS__TUNIT_NPM-NEXT: [[TMP15:%.*]] = phi i32 [ 0, [[TMP2:%.*]] ], [ [[TMP11]], [[TMP6]] ] -; IS__TUNIT_NPM-NEXT: ret i32 [[TMP15]] -; -; IS__CGSCC_OPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@loop_trip_dec -; IS__CGSCC_OPM-SAME: (i32 [[TMP0:%.*]], i32* nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR15]] { -; IS__CGSCC_OPM-NEXT: [[TMP3:%.*]] = icmp sgt i32 [[TMP0]], -1 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP14:%.*]] -; IS__CGSCC_OPM: 4: -; IS__CGSCC_OPM-NEXT: [[TMP5:%.*]] = sext i32 [[TMP0]] to i64 -; IS__CGSCC_OPM-NEXT: br label [[TMP6:%.*]] -; IS__CGSCC_OPM: 6: -; IS__CGSCC_OPM-NEXT: [[TMP7:%.*]] = phi i64 [ [[TMP5]], [[TMP4]] ], [ [[TMP12:%.*]], [[TMP6]] ] -; IS__CGSCC_OPM-NEXT: [[TMP8:%.*]] = phi i32 [ 0, [[TMP4]] ], [ [[TMP11:%.*]], [[TMP6]] ] -; IS__CGSCC_OPM-NEXT: [[TMP9:%.*]] = getelementptr inbounds i32, i32* [[TMP1]], i64 [[TMP7]] -; IS__CGSCC_OPM-NEXT: [[TMP10:%.*]] = load i32, i32* [[TMP9]], align 4 -; IS__CGSCC_OPM-NEXT: [[TMP11]] = add nsw i32 [[TMP10]], [[TMP8]] -; IS__CGSCC_OPM-NEXT: [[TMP12]] = add nsw i64 [[TMP7]], -1 -; IS__CGSCC_OPM-NEXT: [[TMP13:%.*]] = icmp sgt i64 [[TMP7]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP13]], label [[TMP6]], label [[TMP14]] -; IS__CGSCC_OPM: 14: -; IS__CGSCC_OPM-NEXT: [[TMP15:%.*]] = phi i32 [ 0, [[TMP2:%.*]] ], [ [[TMP11]], [[TMP6]] ] -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP15]] -; -; IS__CGSCC_NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@loop_trip_dec -; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]], i32* nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR15]] { -; IS__CGSCC_NPM-NEXT: [[TMP3:%.*]] = icmp sgt i32 [[TMP0]], -1 -; IS__CGSCC_NPM-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP14:%.*]] -; IS__CGSCC_NPM: 4: -; IS__CGSCC_NPM-NEXT: [[TMP5:%.*]] = sext i32 [[TMP0]] to i64 -; IS__CGSCC_NPM-NEXT: br label [[TMP6:%.*]] -; IS__CGSCC_NPM: 6: -; IS__CGSCC_NPM-NEXT: [[TMP7:%.*]] = phi i64 [ [[TMP5]], [[TMP4]] ], [ [[TMP12:%.*]], [[TMP6]] ] -; IS__CGSCC_NPM-NEXT: [[TMP8:%.*]] = phi i32 [ 0, [[TMP4]] ], [ [[TMP11:%.*]], [[TMP6]] ] -; IS__CGSCC_NPM-NEXT: [[TMP9:%.*]] = getelementptr inbounds i32, i32* [[TMP1]], i64 [[TMP7]] -; IS__CGSCC_NPM-NEXT: [[TMP10:%.*]] = load i32, i32* [[TMP9]], align 4 -; IS__CGSCC_NPM-NEXT: [[TMP11]] = add nsw i32 [[TMP10]], [[TMP8]] -; IS__CGSCC_NPM-NEXT: [[TMP12]] = add nsw i64 [[TMP7]], -1 -; IS__CGSCC_NPM-NEXT: [[TMP13:%.*]] = icmp sgt i64 [[TMP7]], 0 -; IS__CGSCC_NPM-NEXT: br i1 [[TMP13]], label [[TMP6]], label [[TMP14]] -; IS__CGSCC_NPM: 14: -; IS__CGSCC_NPM-NEXT: [[TMP15:%.*]] = phi i32 [ 0, [[TMP2:%.*]] ], [ [[TMP11]], [[TMP6]] ] -; IS__CGSCC_NPM-NEXT: ret i32 [[TMP15]] +; MODULE: Function Attrs: argmemonly nofree noinline nosync nounwind readonly uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@loop_trip_dec +; MODULE-SAME: (i32 [[TMP0:%.*]], i32* nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR12]] { +; MODULE-NEXT: [[TMP3:%.*]] = icmp sgt i32 [[TMP0]], -1 +; MODULE-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP14:%.*]] +; MODULE: 4: +; MODULE-NEXT: [[TMP5:%.*]] = sext i32 [[TMP0]] to i64 +; MODULE-NEXT: br label [[TMP6:%.*]] +; MODULE: 6: +; MODULE-NEXT: [[TMP7:%.*]] = phi i64 [ [[TMP5]], [[TMP4]] ], [ [[TMP12:%.*]], [[TMP6]] ] +; MODULE-NEXT: [[TMP8:%.*]] = phi i32 [ 0, [[TMP4]] ], [ [[TMP11:%.*]], [[TMP6]] ] +; MODULE-NEXT: [[TMP9:%.*]] = getelementptr inbounds i32, i32* [[TMP1]], i64 [[TMP7]] +; MODULE-NEXT: [[TMP10:%.*]] = load i32, i32* [[TMP9]], align 4 +; MODULE-NEXT: [[TMP11]] = add nsw i32 [[TMP10]], [[TMP8]] +; MODULE-NEXT: [[TMP12]] = add nsw i64 [[TMP7]], -1 +; MODULE-NEXT: [[TMP13:%.*]] = icmp sgt i64 [[TMP7]], 0 +; MODULE-NEXT: br i1 [[TMP13]], label [[TMP6]], label [[TMP14]] +; MODULE: 14: +; MODULE-NEXT: [[TMP15:%.*]] = phi i32 [ 0, [[TMP2:%.*]] ], [ [[TMP11]], [[TMP6]] ] +; MODULE-NEXT: ret i32 [[TMP15]] +; +; CGSCC: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@loop_trip_dec +; CGSCC-SAME: (i32 [[TMP0:%.*]], i32* nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR15]] { +; CGSCC-NEXT: [[TMP3:%.*]] = icmp sgt i32 [[TMP0]], -1 +; CGSCC-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP14:%.*]] +; CGSCC: 4: +; CGSCC-NEXT: [[TMP5:%.*]] = sext i32 [[TMP0]] to i64 +; CGSCC-NEXT: br label [[TMP6:%.*]] +; CGSCC: 6: +; CGSCC-NEXT: [[TMP7:%.*]] = phi i64 [ [[TMP5]], [[TMP4]] ], [ [[TMP12:%.*]], [[TMP6]] ] +; CGSCC-NEXT: [[TMP8:%.*]] = phi i32 [ 0, [[TMP4]] ], [ [[TMP11:%.*]], [[TMP6]] ] +; CGSCC-NEXT: [[TMP9:%.*]] = getelementptr inbounds i32, i32* [[TMP1]], i64 [[TMP7]] +; CGSCC-NEXT: [[TMP10:%.*]] = load i32, i32* [[TMP9]], align 4 +; CGSCC-NEXT: [[TMP11]] = add nsw i32 [[TMP10]], [[TMP8]] +; CGSCC-NEXT: [[TMP12]] = add nsw i64 [[TMP7]], -1 +; CGSCC-NEXT: [[TMP13:%.*]] = icmp sgt i64 [[TMP7]], 0 +; CGSCC-NEXT: br i1 [[TMP13]], label [[TMP6]], label [[TMP14]] +; CGSCC: 14: +; CGSCC-NEXT: [[TMP15:%.*]] = phi i32 [ 0, [[TMP2:%.*]] ], [ [[TMP11]], [[TMP6]] ] +; CGSCC-NEXT: ret i32 [[TMP15]] ; %3 = icmp sgt i32 %0, -1 br i1 %3, label %4, label %14 @@ -1019,25 +744,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 +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@multiple_return +; MODULE-SAME: (i32 [[A:%.*]]) #[[ATTR0]] { +; MODULE-NEXT: [[B:%.*]] = icmp eq i32 [[A]], 0 +; MODULE-NEXT: br i1 [[B]], label [[T:%.*]], label [[F:%.*]] +; MODULE: t: +; MODULE-NEXT: ret i32 1 +; MODULE: f: +; MODULE-NEXT: ret i32 0 +; +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@multiple_return +; CGSCC-SAME: (i32 [[A:%.*]]) #[[ATTR0]] { +; CGSCC-NEXT: [[B:%.*]] = icmp eq i32 [[A]], 0 +; CGSCC-NEXT: br i1 [[B]], label [[T:%.*]], label [[F:%.*]] +; CGSCC: t: +; CGSCC-NEXT: ret i32 1 +; CGSCC: f: +; CGSCC-NEXT: ret i32 0 ; %b = icmp eq i32 %a, 0 br i1 %b, label %t, label %f @@ -1053,37 +778,21 @@ ; 15.1 (positive case) define void @unreachable_exit_positive1() #0 { -; IS__TUNIT_OPM: Function Attrs: noinline nounwind uwtable willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@unreachable_exit_positive1 -; IS__TUNIT_OPM-SAME: () #[[ATTR9]] { -; IS__TUNIT_OPM-NEXT: tail call void @will_return() #[[ATTR26]] -; IS__TUNIT_OPM-NEXT: ret void -; IS__TUNIT_OPM: unreachable_label: -; IS__TUNIT_OPM-NEXT: unreachable -; -; IS__TUNIT_NPM: Function Attrs: noinline nounwind uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@unreachable_exit_positive1 -; IS__TUNIT_NPM-SAME: () #[[ATTR9]] { -; IS__TUNIT_NPM-NEXT: tail call void @will_return() #[[ATTR28]] -; IS__TUNIT_NPM-NEXT: ret void -; IS__TUNIT_NPM: unreachable_label: -; IS__TUNIT_NPM-NEXT: unreachable -; -; IS__CGSCC_OPM: Function Attrs: noinline norecurse nounwind uwtable willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@unreachable_exit_positive1 -; IS__CGSCC_OPM-SAME: () #[[ATTR11]] { -; IS__CGSCC_OPM-NEXT: tail call void @will_return() #[[ATTR30]] -; IS__CGSCC_OPM-NEXT: ret void -; IS__CGSCC_OPM: unreachable_label: -; IS__CGSCC_OPM-NEXT: unreachable -; -; IS__CGSCC_NPM: Function Attrs: noinline norecurse nounwind uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@unreachable_exit_positive1 -; IS__CGSCC_NPM-SAME: () #[[ATTR11]] { -; IS__CGSCC_NPM-NEXT: tail call void @will_return() #[[ATTR32]] -; IS__CGSCC_NPM-NEXT: ret void -; IS__CGSCC_NPM: unreachable_label: -; IS__CGSCC_NPM-NEXT: unreachable +; MODULE: Function Attrs: noinline nounwind uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@unreachable_exit_positive1 +; MODULE-SAME: () #[[ATTR9]] { +; MODULE-NEXT: tail call void @will_return() #[[ATTR28]] +; MODULE-NEXT: ret void +; MODULE: unreachable_label: +; MODULE-NEXT: unreachable +; +; CGSCC: Function Attrs: noinline norecurse nounwind uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@unreachable_exit_positive1 +; CGSCC-SAME: () #[[ATTR11]] { +; CGSCC-NEXT: tail call void @will_return() #[[ATTR32]] +; CGSCC-NEXT: ret void +; CGSCC: unreachable_label: +; CGSCC-NEXT: unreachable ; tail call void @will_return() ret void @@ -1094,77 +803,41 @@ } define i32 @unreachable_exit_positive2(i32) local_unnamed_addr #0 { -; IS__TUNIT_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@unreachable_exit_positive2 -; IS__TUNIT_OPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] { -; IS__TUNIT_OPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 -; IS__TUNIT_OPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] -; IS__TUNIT_OPM: 3: -; IS__TUNIT_OPM-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] -; IS__TUNIT_OPM-NEXT: ret i32 [[TMP4]] -; IS__TUNIT_OPM: 5: -; IS__TUNIT_OPM-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__TUNIT_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__TUNIT_OPM-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] -; IS__TUNIT_OPM-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 -; IS__TUNIT_OPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] -; IS__TUNIT_OPM-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] -; IS__TUNIT_OPM: unreachable_label: -; IS__TUNIT_OPM-NEXT: unreachable -; -; IS__TUNIT_NPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@unreachable_exit_positive2 -; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 -; IS__TUNIT_NPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] -; IS__TUNIT_NPM: 3: -; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] -; IS__TUNIT_NPM-NEXT: ret i32 [[TMP4]] -; IS__TUNIT_NPM: 5: -; IS__TUNIT_NPM-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__TUNIT_NPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__TUNIT_NPM-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] -; IS__TUNIT_NPM-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 -; IS__TUNIT_NPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] -; IS__TUNIT_NPM-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] -; IS__TUNIT_NPM: unreachable_label: -; IS__TUNIT_NPM-NEXT: unreachable -; -; IS__CGSCC_OPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@unreachable_exit_positive2 -; IS__CGSCC_OPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2]] { -; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 -; IS__CGSCC_OPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] -; IS__CGSCC_OPM: 3: -; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] -; IS__CGSCC_OPM-NEXT: ret i32 [[TMP4]] -; IS__CGSCC_OPM: 5: -; IS__CGSCC_OPM-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__CGSCC_OPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__CGSCC_OPM-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] -; IS__CGSCC_OPM-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 -; IS__CGSCC_OPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] -; IS__CGSCC_OPM-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] -; IS__CGSCC_OPM: unreachable_label: -; IS__CGSCC_OPM-NEXT: unreachable -; -; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@unreachable_exit_positive2 -; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { -; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 -; IS__CGSCC_NPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] -; IS__CGSCC_NPM: 3: -; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] -; IS__CGSCC_NPM-NEXT: ret i32 [[TMP4]] -; IS__CGSCC_NPM: 5: -; IS__CGSCC_NPM-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__CGSCC_NPM-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] -; IS__CGSCC_NPM-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] -; IS__CGSCC_NPM-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 -; IS__CGSCC_NPM-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] -; IS__CGSCC_NPM-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] -; IS__CGSCC_NPM: unreachable_label: -; IS__CGSCC_NPM-NEXT: unreachable +; MODULE: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn +; MODULE-LABEL: define {{[^@]+}}@unreachable_exit_positive2 +; MODULE-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { +; MODULE-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 +; MODULE-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] +; MODULE: 3: +; MODULE-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] +; MODULE-NEXT: ret i32 [[TMP4]] +; MODULE: 5: +; MODULE-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] +; MODULE-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] +; MODULE-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] +; MODULE-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 +; MODULE-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] +; MODULE-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] +; MODULE: unreachable_label: +; MODULE-NEXT: unreachable +; +; CGSCC: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn +; CGSCC-LABEL: define {{[^@]+}}@unreachable_exit_positive2 +; CGSCC-SAME: (i32 [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] { +; CGSCC-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP0]], 1 +; CGSCC-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] +; CGSCC: 3: +; CGSCC-NEXT: [[TMP4:%.*]] = phi i32 [ 1, [[TMP1:%.*]] ], [ [[TMP8:%.*]], [[TMP5]] ] +; CGSCC-NEXT: ret i32 [[TMP4]] +; CGSCC: 5: +; CGSCC-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP9:%.*]], [[TMP5]] ], [ 1, [[TMP1]] ] +; CGSCC-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8]], [[TMP5]] ], [ 1, [[TMP1]] ] +; CGSCC-NEXT: [[TMP8]] = mul nsw i32 [[TMP6]], [[TMP7]] +; CGSCC-NEXT: [[TMP9]] = add nuw nsw i32 [[TMP6]], 1 +; CGSCC-NEXT: [[TMP10:%.*]] = icmp eq i32 [[TMP6]], [[TMP0]] +; CGSCC-NEXT: br i1 [[TMP10]], label [[TMP3]], label [[TMP5]] +; CGSCC: unreachable_label: +; CGSCC-NEXT: unreachable ; %2 = icmp slt i32 %0, 1 br i1 %2, label %3, label %5 @@ -1190,21 +863,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 +; MODULE: Function Attrs: noinline noreturn nounwind uwtable +; MODULE-LABEL: define {{[^@]+}}@unreachable_exit_negative1 +; MODULE-SAME: () #[[ATTR5]] { +; MODULE-NEXT: tail call void @exit(i32 noundef 0) #[[ATTR4]] +; MODULE-NEXT: unreachable +; MODULE: unreachable_label: +; MODULE-NEXT: unreachable +; +; CGSCC: Function Attrs: noinline noreturn nounwind uwtable +; CGSCC-LABEL: define {{[^@]+}}@unreachable_exit_negative1 +; CGSCC-SAME: () #[[ATTR6]] { +; CGSCC-NEXT: tail call void @exit(i32 noundef 0) #[[ATTR5]] +; CGSCC-NEXT: unreachable +; CGSCC: unreachable_label: +; CGSCC-NEXT: unreachable ; tail call void @exit(i32 0) ret void @@ -1215,49 +888,27 @@ } define void @unreachable_exit_negative2() #0 { -; IS__TUNIT_OPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@unreachable_exit_negative2 -; IS__TUNIT_OPM-SAME: () #[[ATTR13:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: br label [[L1:%.*]] -; IS__TUNIT_OPM: L1: -; IS__TUNIT_OPM-NEXT: br label [[L2:%.*]] -; IS__TUNIT_OPM: L2: -; IS__TUNIT_OPM-NEXT: br label [[L1]] -; IS__TUNIT_OPM: unreachable_label: -; IS__TUNIT_OPM-NEXT: unreachable -; -; IS__TUNIT_NPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@unreachable_exit_negative2 -; IS__TUNIT_NPM-SAME: () #[[ATTR14:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: br label [[L1:%.*]] -; IS__TUNIT_NPM: L1: -; IS__TUNIT_NPM-NEXT: br label [[L2:%.*]] -; IS__TUNIT_NPM: L2: -; IS__TUNIT_NPM-NEXT: br label [[L1]] -; IS__TUNIT_NPM: unreachable_label: -; IS__TUNIT_NPM-NEXT: unreachable -; -; IS__CGSCC_OPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@unreachable_exit_negative2 -; IS__CGSCC_OPM-SAME: () #[[ATTR16:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: br label [[L1:%.*]] -; IS__CGSCC_OPM: L1: -; IS__CGSCC_OPM-NEXT: br label [[L2:%.*]] -; IS__CGSCC_OPM: L2: -; IS__CGSCC_OPM-NEXT: br label [[L1]] -; IS__CGSCC_OPM: unreachable_label: -; IS__CGSCC_OPM-NEXT: unreachable -; -; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@unreachable_exit_negative2 -; IS__CGSCC_NPM-SAME: () #[[ATTR17:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: br label [[L1:%.*]] -; IS__CGSCC_NPM: L1: -; IS__CGSCC_NPM-NEXT: br label [[L2:%.*]] -; IS__CGSCC_NPM: L2: -; IS__CGSCC_NPM-NEXT: br label [[L1]] -; IS__CGSCC_NPM: unreachable_label: -; IS__CGSCC_NPM-NEXT: unreachable +; MODULE: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable +; MODULE-LABEL: define {{[^@]+}}@unreachable_exit_negative2 +; MODULE-SAME: () #[[ATTR14:[0-9]+]] { +; MODULE-NEXT: br label [[L1:%.*]] +; MODULE: L1: +; MODULE-NEXT: br label [[L2:%.*]] +; MODULE: L2: +; MODULE-NEXT: br label [[L1]] +; MODULE: unreachable_label: +; MODULE-NEXT: unreachable +; +; CGSCC: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable +; CGSCC-LABEL: define {{[^@]+}}@unreachable_exit_negative2 +; CGSCC-SAME: () #[[ATTR17:[0-9]+]] { +; CGSCC-NEXT: br label [[L1:%.*]] +; CGSCC: L1: +; CGSCC-NEXT: br label [[L2:%.*]] +; CGSCC: L2: +; CGSCC-NEXT: br label [[L1]] +; CGSCC: unreachable_label: +; CGSCC-NEXT: unreachable ; br label %L1 L1: @@ -1271,21 +922,20 @@ } ; CHECK: Function Attrs: noreturn nounwind -; CHECK-NEXT: declare void @llvm.eh.sjlj.longjmp(i8*) 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 +; MODULE: Function Attrs: noinline noreturn nounwind uwtable +; MODULE-LABEL: define {{[^@]+}}@call_longjmp +; MODULE-SAME: (i8* nocapture readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR5]] { +; MODULE-NEXT: tail call void @llvm.eh.sjlj.longjmp(i8* noalias readnone [[TMP0]]) #[[ATTR4]] +; MODULE-NEXT: unreachable +; +; CGSCC: Function Attrs: noinline noreturn nounwind uwtable +; CGSCC-LABEL: define {{[^@]+}}@call_longjmp +; CGSCC-SAME: (i8* nocapture readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR6]] { +; CGSCC-NEXT: tail call void @llvm.eh.sjlj.longjmp(i8* noalias readnone [[TMP0]]) #[[ATTR5]] +; CGSCC-NEXT: unreachable ; tail call void @llvm.eh.sjlj.longjmp(i8* %0) ret void @@ -1303,89 +953,47 @@ ; } define i32 @infinite_loop_inside_bounded_loop(i32 %n) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@infinite_loop_inside_bounded_loop -; IS__TUNIT_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR15]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND:%.*]] -; IS__TUNIT_OPM: for.cond: -; IS__TUNIT_OPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[N]], 0 -; IS__TUNIT_OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__TUNIT_OPM: for.cond.cleanup: -; IS__TUNIT_OPM-NEXT: br label [[FOR_END:%.*]] -; IS__TUNIT_OPM: for.body: -; IS__TUNIT_OPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__TUNIT_OPM: while.cond: -; IS__TUNIT_OPM-NEXT: br label [[WHILE_BODY:%.*]] -; IS__TUNIT_OPM: while.body: -; IS__TUNIT_OPM-NEXT: br label [[WHILE_COND]] -; IS__TUNIT_OPM: for.inc: -; IS__TUNIT_OPM-NEXT: unreachable -; IS__TUNIT_OPM: for.end: -; IS__TUNIT_OPM-NEXT: ret i32 0 -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@infinite_loop_inside_bounded_loop -; IS__TUNIT_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR16]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND:%.*]] -; IS__TUNIT_NPM: for.cond: -; IS__TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[N]], 0 -; IS__TUNIT_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__TUNIT_NPM: for.cond.cleanup: -; IS__TUNIT_NPM-NEXT: br label [[FOR_END:%.*]] -; IS__TUNIT_NPM: for.body: -; IS__TUNIT_NPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__TUNIT_NPM: while.cond: -; IS__TUNIT_NPM-NEXT: br label [[WHILE_BODY:%.*]] -; IS__TUNIT_NPM: while.body: -; IS__TUNIT_NPM-NEXT: br label [[WHILE_COND]] -; IS__TUNIT_NPM: for.inc: -; IS__TUNIT_NPM-NEXT: unreachable -; IS__TUNIT_NPM: for.end: -; IS__TUNIT_NPM-NEXT: ret i32 0 -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@infinite_loop_inside_bounded_loop -; IS__CGSCC_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR18:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND:%.*]] -; IS__CGSCC_OPM: for.cond: -; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[N]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__CGSCC_OPM: for.cond.cleanup: -; IS__CGSCC_OPM-NEXT: br label [[FOR_END:%.*]] -; IS__CGSCC_OPM: for.body: -; IS__CGSCC_OPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__CGSCC_OPM: while.cond: -; IS__CGSCC_OPM-NEXT: br label [[WHILE_BODY:%.*]] -; IS__CGSCC_OPM: while.body: -; IS__CGSCC_OPM-NEXT: br label [[WHILE_COND]] -; IS__CGSCC_OPM: for.inc: -; IS__CGSCC_OPM-NEXT: unreachable -; IS__CGSCC_OPM: for.end: -; IS__CGSCC_OPM-NEXT: ret i32 0 -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@infinite_loop_inside_bounded_loop -; IS__CGSCC_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR19:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND:%.*]] -; IS__CGSCC_NPM: for.cond: -; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp sgt i32 [[N]], 0 -; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__CGSCC_NPM: for.cond.cleanup: -; IS__CGSCC_NPM-NEXT: br label [[FOR_END:%.*]] -; IS__CGSCC_NPM: for.body: -; IS__CGSCC_NPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__CGSCC_NPM: while.cond: -; IS__CGSCC_NPM-NEXT: br label [[WHILE_BODY:%.*]] -; IS__CGSCC_NPM: while.body: -; IS__CGSCC_NPM-NEXT: br label [[WHILE_COND]] -; IS__CGSCC_NPM: for.inc: -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: for.end: -; IS__CGSCC_NPM-NEXT: ret i32 0 +; MODULE: Function Attrs: nofree nosync nounwind readnone +; MODULE-LABEL: define {{[^@]+}}@infinite_loop_inside_bounded_loop +; MODULE-SAME: (i32 [[N:%.*]]) #[[ATTR16]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: br label [[FOR_COND:%.*]] +; MODULE: for.cond: +; MODULE-NEXT: [[CMP:%.*]] = icmp sgt i32 [[N]], 0 +; MODULE-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] +; MODULE: for.cond.cleanup: +; MODULE-NEXT: br label [[FOR_END:%.*]] +; MODULE: for.body: +; MODULE-NEXT: br label [[WHILE_COND:%.*]] +; MODULE: while.cond: +; MODULE-NEXT: br label [[WHILE_BODY:%.*]] +; MODULE: while.body: +; MODULE-NEXT: br label [[WHILE_COND]] +; MODULE: for.inc: +; MODULE-NEXT: unreachable +; MODULE: for.end: +; MODULE-NEXT: ret i32 0 +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone +; CGSCC-LABEL: define {{[^@]+}}@infinite_loop_inside_bounded_loop +; CGSCC-SAME: (i32 [[N:%.*]]) #[[ATTR19:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br label [[FOR_COND:%.*]] +; CGSCC: for.cond: +; CGSCC-NEXT: [[CMP:%.*]] = icmp sgt i32 [[N]], 0 +; CGSCC-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] +; CGSCC: for.cond.cleanup: +; CGSCC-NEXT: br label [[FOR_END:%.*]] +; CGSCC: for.body: +; CGSCC-NEXT: br label [[WHILE_COND:%.*]] +; CGSCC: while.cond: +; CGSCC-NEXT: br label [[WHILE_BODY:%.*]] +; CGSCC: while.body: +; CGSCC-NEXT: br label [[WHILE_COND]] +; CGSCC: for.inc: +; CGSCC-NEXT: unreachable +; CGSCC: for.end: +; CGSCC-NEXT: ret i32 0 ; entry: br label %for.cond @@ -1427,121 +1035,63 @@ ; } define i32 @bounded_nested_loops(i32 %n) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@bounded_nested_loops -; IS__TUNIT_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR15]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND:%.*]] -; IS__TUNIT_OPM: for.cond: -; IS__TUNIT_OPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC1:%.*]], [[FOR_INC:%.*]] ] -; IS__TUNIT_OPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY]] ], [ [[TMP:%.*]], [[FOR_INC]] ] -; IS__TUNIT_OPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[FOR_INC]] ] -; IS__TUNIT_OPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], [[N_ADDR_0]] -; IS__TUNIT_OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__TUNIT_OPM: for.cond.cleanup: -; IS__TUNIT_OPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[FOR_COND]] ] -; IS__TUNIT_OPM-NEXT: br label [[FOR_END:%.*]] -; IS__TUNIT_OPM: for.body: -; IS__TUNIT_OPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__TUNIT_OPM: while.cond: -; IS__TUNIT_OPM-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] -; IS__TUNIT_OPM: while.body: -; IS__TUNIT_OPM-NEXT: unreachable -; IS__TUNIT_OPM: while.end: -; IS__TUNIT_OPM-NEXT: [[TMP]] = add i32 [[N_ADDR_0]], [[ANS_0]] -; IS__TUNIT_OPM-NEXT: br label [[FOR_INC]] -; IS__TUNIT_OPM: for.inc: -; IS__TUNIT_OPM-NEXT: [[INC1]] = add nuw nsw i32 [[I_0]], 1 -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND]] -; IS__TUNIT_OPM: for.end: -; IS__TUNIT_OPM-NEXT: ret i32 [[ANS_0_LCSSA]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@bounded_nested_loops -; IS__TUNIT_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR17:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND:%.*]] -; IS__TUNIT_NPM: for.cond: -; IS__TUNIT_NPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC1:%.*]], [[FOR_INC:%.*]] ] -; IS__TUNIT_NPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY]] ], [ [[TMP:%.*]], [[FOR_INC]] ] -; IS__TUNIT_NPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[FOR_INC]] ] -; IS__TUNIT_NPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], [[N_ADDR_0]] -; IS__TUNIT_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__TUNIT_NPM: for.cond.cleanup: -; IS__TUNIT_NPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[FOR_COND]] ] -; IS__TUNIT_NPM-NEXT: br label [[FOR_END:%.*]] -; IS__TUNIT_NPM: for.body: -; IS__TUNIT_NPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__TUNIT_NPM: while.cond: -; IS__TUNIT_NPM-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] -; IS__TUNIT_NPM: while.body: -; IS__TUNIT_NPM-NEXT: unreachable -; IS__TUNIT_NPM: while.end: -; IS__TUNIT_NPM-NEXT: [[TMP]] = add i32 [[N_ADDR_0]], [[ANS_0]] -; IS__TUNIT_NPM-NEXT: br label [[FOR_INC]] -; IS__TUNIT_NPM: for.inc: -; IS__TUNIT_NPM-NEXT: [[INC1]] = add nuw nsw i32 [[I_0]], 1 -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND]] -; IS__TUNIT_NPM: for.end: -; IS__TUNIT_NPM-NEXT: ret i32 [[ANS_0_LCSSA]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@bounded_nested_loops -; IS__CGSCC_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR18]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND:%.*]] -; IS__CGSCC_OPM: for.cond: -; IS__CGSCC_OPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC1:%.*]], [[FOR_INC:%.*]] ] -; IS__CGSCC_OPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY]] ], [ [[TMP:%.*]], [[FOR_INC]] ] -; IS__CGSCC_OPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[FOR_INC]] ] -; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], [[N_ADDR_0]] -; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__CGSCC_OPM: for.cond.cleanup: -; IS__CGSCC_OPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[FOR_COND]] ] -; IS__CGSCC_OPM-NEXT: br label [[FOR_END:%.*]] -; IS__CGSCC_OPM: for.body: -; IS__CGSCC_OPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__CGSCC_OPM: while.cond: -; IS__CGSCC_OPM-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] -; IS__CGSCC_OPM: while.body: -; IS__CGSCC_OPM-NEXT: unreachable -; IS__CGSCC_OPM: while.end: -; IS__CGSCC_OPM-NEXT: [[TMP]] = add i32 [[N_ADDR_0]], [[ANS_0]] -; IS__CGSCC_OPM-NEXT: br label [[FOR_INC]] -; IS__CGSCC_OPM: for.inc: -; IS__CGSCC_OPM-NEXT: [[INC1]] = add nuw nsw i32 [[I_0]], 1 -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND]] -; IS__CGSCC_OPM: for.end: -; IS__CGSCC_OPM-NEXT: ret i32 [[ANS_0_LCSSA]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@bounded_nested_loops -; IS__CGSCC_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR20:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND:%.*]] -; IS__CGSCC_NPM: for.cond: -; IS__CGSCC_NPM-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC1:%.*]], [[FOR_INC:%.*]] ] -; IS__CGSCC_NPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY]] ], [ [[TMP:%.*]], [[FOR_INC]] ] -; IS__CGSCC_NPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[FOR_INC]] ] -; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], [[N_ADDR_0]] -; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__CGSCC_NPM: for.cond.cleanup: -; IS__CGSCC_NPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[FOR_COND]] ] -; IS__CGSCC_NPM-NEXT: br label [[FOR_END:%.*]] -; IS__CGSCC_NPM: for.body: -; IS__CGSCC_NPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__CGSCC_NPM: while.cond: -; IS__CGSCC_NPM-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] -; IS__CGSCC_NPM: while.body: -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: while.end: -; IS__CGSCC_NPM-NEXT: [[TMP]] = add i32 [[N_ADDR_0]], [[ANS_0]] -; IS__CGSCC_NPM-NEXT: br label [[FOR_INC]] -; IS__CGSCC_NPM: for.inc: -; IS__CGSCC_NPM-NEXT: [[INC1]] = add nuw nsw i32 [[I_0]], 1 -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND]] -; IS__CGSCC_NPM: for.end: -; IS__CGSCC_NPM-NEXT: ret i32 [[ANS_0_LCSSA]] +; MODULE: Function Attrs: nofree nosync nounwind readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@bounded_nested_loops +; MODULE-SAME: (i32 [[N:%.*]]) #[[ATTR17:[0-9]+]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: br label [[FOR_COND:%.*]] +; MODULE: for.cond: +; MODULE-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC1:%.*]], [[FOR_INC:%.*]] ] +; MODULE-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY]] ], [ [[TMP:%.*]], [[FOR_INC]] ] +; MODULE-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[FOR_INC]] ] +; MODULE-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], [[N_ADDR_0]] +; MODULE-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] +; MODULE: for.cond.cleanup: +; MODULE-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[FOR_COND]] ] +; MODULE-NEXT: br label [[FOR_END:%.*]] +; MODULE: for.body: +; MODULE-NEXT: br label [[WHILE_COND:%.*]] +; MODULE: while.cond: +; MODULE-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] +; MODULE: while.body: +; MODULE-NEXT: unreachable +; MODULE: while.end: +; MODULE-NEXT: [[TMP]] = add i32 [[N_ADDR_0]], [[ANS_0]] +; MODULE-NEXT: br label [[FOR_INC]] +; MODULE: for.inc: +; MODULE-NEXT: [[INC1]] = add nuw nsw i32 [[I_0]], 1 +; MODULE-NEXT: br label [[FOR_COND]] +; MODULE: for.end: +; MODULE-NEXT: ret i32 [[ANS_0_LCSSA]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@bounded_nested_loops +; CGSCC-SAME: (i32 [[N:%.*]]) #[[ATTR20:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br label [[FOR_COND:%.*]] +; CGSCC: for.cond: +; CGSCC-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC1:%.*]], [[FOR_INC:%.*]] ] +; CGSCC-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY]] ], [ [[TMP:%.*]], [[FOR_INC]] ] +; CGSCC-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[FOR_INC]] ] +; CGSCC-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], [[N_ADDR_0]] +; CGSCC-NEXT: br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] +; CGSCC: for.cond.cleanup: +; CGSCC-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[FOR_COND]] ] +; CGSCC-NEXT: br label [[FOR_END:%.*]] +; CGSCC: for.body: +; CGSCC-NEXT: br label [[WHILE_COND:%.*]] +; CGSCC: while.cond: +; CGSCC-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] +; CGSCC: while.body: +; CGSCC-NEXT: unreachable +; CGSCC: while.end: +; CGSCC-NEXT: [[TMP]] = add i32 [[N_ADDR_0]], [[ANS_0]] +; CGSCC-NEXT: br label [[FOR_INC]] +; CGSCC: for.inc: +; CGSCC-NEXT: [[INC1]] = add nuw nsw i32 [[I_0]], 1 +; CGSCC-NEXT: br label [[FOR_COND]] +; CGSCC: for.end: +; CGSCC-NEXT: ret i32 [[ANS_0_LCSSA]] ; entry: br label %for.cond @@ -1591,129 +1141,67 @@ ; } define i32 @bounded_loop_inside_unbounded_loop(i32 %n) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@bounded_loop_inside_unbounded_loop -; IS__TUNIT_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR15]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__TUNIT_OPM: while.cond: -; IS__TUNIT_OPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP2:%.*]], [[FOR_END:%.*]] ] -; IS__TUNIT_OPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[INC:%.*]], [[FOR_END]] ] -; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = icmp sgt i32 [[N_ADDR_0]], -1 -; IS__TUNIT_OPM-NEXT: [[SMAX:%.*]] = select i1 [[TMP]], i32 [[N_ADDR_0]], i32 -1 -; IS__TUNIT_OPM-NEXT: [[INC]] = add nsw i32 [[N_ADDR_0]], 1 -; IS__TUNIT_OPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 -; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL]], label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] -; IS__TUNIT_OPM: while.body: -; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = add i32 [[ANS_0]], 1 -; IS__TUNIT_OPM-NEXT: br label [[FOR_COND:%.*]] -; IS__TUNIT_OPM: for.cond: -; IS__TUNIT_OPM-NEXT: br i1 true, label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY:%.*]] -; IS__TUNIT_OPM: for.cond.cleanup: -; IS__TUNIT_OPM-NEXT: [[TMP2]] = add i32 [[TMP1]], [[SMAX]] -; IS__TUNIT_OPM-NEXT: br label [[FOR_END]] -; IS__TUNIT_OPM: for.body: -; IS__TUNIT_OPM-NEXT: unreachable -; IS__TUNIT_OPM: for.inc: -; IS__TUNIT_OPM-NEXT: unreachable -; IS__TUNIT_OPM: for.end: -; IS__TUNIT_OPM-NEXT: br label [[WHILE_COND]] -; IS__TUNIT_OPM: while.end: -; IS__TUNIT_OPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] -; IS__TUNIT_OPM-NEXT: ret i32 [[ANS_0_LCSSA]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@bounded_loop_inside_unbounded_loop -; IS__TUNIT_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR16]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__TUNIT_NPM: while.cond: -; IS__TUNIT_NPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP2:%.*]], [[FOR_END:%.*]] ] -; IS__TUNIT_NPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[INC:%.*]], [[FOR_END]] ] -; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = icmp sgt i32 [[N_ADDR_0]], -1 -; IS__TUNIT_NPM-NEXT: [[SMAX:%.*]] = select i1 [[TMP]], i32 [[N_ADDR_0]], i32 -1 -; IS__TUNIT_NPM-NEXT: [[INC]] = add nsw i32 [[N_ADDR_0]], 1 -; IS__TUNIT_NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 -; IS__TUNIT_NPM-NEXT: br i1 [[TOBOOL]], label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] -; IS__TUNIT_NPM: while.body: -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = add i32 [[ANS_0]], 1 -; IS__TUNIT_NPM-NEXT: br label [[FOR_COND:%.*]] -; IS__TUNIT_NPM: for.cond: -; IS__TUNIT_NPM-NEXT: br i1 true, label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY:%.*]] -; IS__TUNIT_NPM: for.cond.cleanup: -; IS__TUNIT_NPM-NEXT: [[TMP2]] = add i32 [[TMP1]], [[SMAX]] -; IS__TUNIT_NPM-NEXT: br label [[FOR_END]] -; IS__TUNIT_NPM: for.body: -; IS__TUNIT_NPM-NEXT: unreachable -; IS__TUNIT_NPM: for.inc: -; IS__TUNIT_NPM-NEXT: unreachable -; IS__TUNIT_NPM: for.end: -; IS__TUNIT_NPM-NEXT: br label [[WHILE_COND]] -; IS__TUNIT_NPM: while.end: -; IS__TUNIT_NPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] -; IS__TUNIT_NPM-NEXT: ret i32 [[ANS_0_LCSSA]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@bounded_loop_inside_unbounded_loop -; IS__CGSCC_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR18]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__CGSCC_OPM: while.cond: -; IS__CGSCC_OPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP2:%.*]], [[FOR_END:%.*]] ] -; IS__CGSCC_OPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[INC:%.*]], [[FOR_END]] ] -; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = icmp sgt i32 [[N_ADDR_0]], -1 -; IS__CGSCC_OPM-NEXT: [[SMAX:%.*]] = select i1 [[TMP]], i32 [[N_ADDR_0]], i32 -1 -; IS__CGSCC_OPM-NEXT: [[INC]] = add nsw i32 [[N_ADDR_0]], 1 -; IS__CGSCC_OPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL]], label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] -; IS__CGSCC_OPM: while.body: -; IS__CGSCC_OPM-NEXT: [[TMP1:%.*]] = add i32 [[ANS_0]], 1 -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND:%.*]] -; IS__CGSCC_OPM: for.cond: -; IS__CGSCC_OPM-NEXT: br i1 true, label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY:%.*]] -; IS__CGSCC_OPM: for.cond.cleanup: -; IS__CGSCC_OPM-NEXT: [[TMP2]] = add i32 [[TMP1]], [[SMAX]] -; IS__CGSCC_OPM-NEXT: br label [[FOR_END]] -; IS__CGSCC_OPM: for.body: -; IS__CGSCC_OPM-NEXT: unreachable -; IS__CGSCC_OPM: for.inc: -; IS__CGSCC_OPM-NEXT: unreachable -; IS__CGSCC_OPM: for.end: -; IS__CGSCC_OPM-NEXT: br label [[WHILE_COND]] -; IS__CGSCC_OPM: while.end: -; IS__CGSCC_OPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] -; IS__CGSCC_OPM-NEXT: ret i32 [[ANS_0_LCSSA]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@bounded_loop_inside_unbounded_loop -; IS__CGSCC_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR19]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__CGSCC_NPM: while.cond: -; IS__CGSCC_NPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP2:%.*]], [[FOR_END:%.*]] ] -; IS__CGSCC_NPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[INC:%.*]], [[FOR_END]] ] -; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = icmp sgt i32 [[N_ADDR_0]], -1 -; IS__CGSCC_NPM-NEXT: [[SMAX:%.*]] = select i1 [[TMP]], i32 [[N_ADDR_0]], i32 -1 -; IS__CGSCC_NPM-NEXT: [[INC]] = add nsw i32 [[N_ADDR_0]], 1 -; IS__CGSCC_NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 -; IS__CGSCC_NPM-NEXT: br i1 [[TOBOOL]], label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] -; IS__CGSCC_NPM: while.body: -; IS__CGSCC_NPM-NEXT: [[TMP1:%.*]] = add i32 [[ANS_0]], 1 -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND:%.*]] -; IS__CGSCC_NPM: for.cond: -; IS__CGSCC_NPM-NEXT: br i1 true, label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY:%.*]] -; IS__CGSCC_NPM: for.cond.cleanup: -; IS__CGSCC_NPM-NEXT: [[TMP2]] = add i32 [[TMP1]], [[SMAX]] -; IS__CGSCC_NPM-NEXT: br label [[FOR_END]] -; IS__CGSCC_NPM: for.body: -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: for.inc: -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: for.end: -; IS__CGSCC_NPM-NEXT: br label [[WHILE_COND]] -; IS__CGSCC_NPM: while.end: -; IS__CGSCC_NPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] -; IS__CGSCC_NPM-NEXT: ret i32 [[ANS_0_LCSSA]] +; MODULE: Function Attrs: nofree nosync nounwind readnone +; MODULE-LABEL: define {{[^@]+}}@bounded_loop_inside_unbounded_loop +; MODULE-SAME: (i32 [[N:%.*]]) #[[ATTR16]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: br label [[WHILE_COND:%.*]] +; MODULE: while.cond: +; MODULE-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP2:%.*]], [[FOR_END:%.*]] ] +; MODULE-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[INC:%.*]], [[FOR_END]] ] +; MODULE-NEXT: [[TMP:%.*]] = icmp sgt i32 [[N_ADDR_0]], -1 +; MODULE-NEXT: [[SMAX:%.*]] = select i1 [[TMP]], i32 [[N_ADDR_0]], i32 -1 +; MODULE-NEXT: [[INC]] = add nsw i32 [[N_ADDR_0]], 1 +; MODULE-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 +; MODULE-NEXT: br i1 [[TOBOOL]], label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] +; MODULE: while.body: +; MODULE-NEXT: [[TMP1:%.*]] = add i32 [[ANS_0]], 1 +; MODULE-NEXT: br label [[FOR_COND:%.*]] +; MODULE: for.cond: +; MODULE-NEXT: br i1 true, label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY:%.*]] +; MODULE: for.cond.cleanup: +; MODULE-NEXT: [[TMP2]] = add i32 [[TMP1]], [[SMAX]] +; MODULE-NEXT: br label [[FOR_END]] +; MODULE: for.body: +; MODULE-NEXT: unreachable +; MODULE: for.inc: +; MODULE-NEXT: unreachable +; MODULE: for.end: +; MODULE-NEXT: br label [[WHILE_COND]] +; MODULE: while.end: +; MODULE-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] +; MODULE-NEXT: ret i32 [[ANS_0_LCSSA]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone +; CGSCC-LABEL: define {{[^@]+}}@bounded_loop_inside_unbounded_loop +; CGSCC-SAME: (i32 [[N:%.*]]) #[[ATTR19]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br label [[WHILE_COND:%.*]] +; CGSCC: while.cond: +; CGSCC-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP2:%.*]], [[FOR_END:%.*]] ] +; CGSCC-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ [[INC:%.*]], [[FOR_END]] ] +; CGSCC-NEXT: [[TMP:%.*]] = icmp sgt i32 [[N_ADDR_0]], -1 +; CGSCC-NEXT: [[SMAX:%.*]] = select i1 [[TMP]], i32 [[N_ADDR_0]], i32 -1 +; CGSCC-NEXT: [[INC]] = add nsw i32 [[N_ADDR_0]], 1 +; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 +; CGSCC-NEXT: br i1 [[TOBOOL]], label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] +; CGSCC: while.body: +; CGSCC-NEXT: [[TMP1:%.*]] = add i32 [[ANS_0]], 1 +; CGSCC-NEXT: br label [[FOR_COND:%.*]] +; CGSCC: for.cond: +; CGSCC-NEXT: br i1 true, label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY:%.*]] +; CGSCC: for.cond.cleanup: +; CGSCC-NEXT: [[TMP2]] = add i32 [[TMP1]], [[SMAX]] +; CGSCC-NEXT: br label [[FOR_END]] +; CGSCC: for.body: +; CGSCC-NEXT: unreachable +; CGSCC: for.inc: +; CGSCC-NEXT: unreachable +; CGSCC: for.end: +; CGSCC-NEXT: br label [[WHILE_COND]] +; CGSCC: while.end: +; CGSCC-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] +; CGSCC-NEXT: ret i32 [[ANS_0_LCSSA]] ; entry: br label %while.cond @@ -1768,125 +1256,65 @@ ; } define i32 @nested_unbounded_loops(i32 %n) { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@nested_unbounded_loops -; IS__TUNIT_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR15]] { -; IS__TUNIT_OPM-NEXT: entry: -; IS__TUNIT_OPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__TUNIT_OPM: while.cond: -; IS__TUNIT_OPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP1:%.*]], [[WHILE_END10:%.*]] ] -; IS__TUNIT_OPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[WHILE_END10]] ] -; IS__TUNIT_OPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 -; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL]], label [[WHILE_END11:%.*]], label [[WHILE_BODY:%.*]] -; IS__TUNIT_OPM: while.body: -; IS__TUNIT_OPM-NEXT: br label [[WHILE_COND1:%.*]] -; IS__TUNIT_OPM: while.cond1: -; IS__TUNIT_OPM-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY4:%.*]] -; IS__TUNIT_OPM: while.body4: -; IS__TUNIT_OPM-NEXT: unreachable -; IS__TUNIT_OPM: while.end: -; IS__TUNIT_OPM-NEXT: [[TMP:%.*]] = add i32 [[N_ADDR_0]], -2 -; IS__TUNIT_OPM-NEXT: br label [[WHILE_COND5:%.*]] -; IS__TUNIT_OPM: while.cond5: -; IS__TUNIT_OPM-NEXT: br i1 true, label [[WHILE_END10]], label [[WHILE_BODY8:%.*]] -; IS__TUNIT_OPM: while.body8: -; IS__TUNIT_OPM-NEXT: unreachable -; IS__TUNIT_OPM: while.end10: -; IS__TUNIT_OPM-NEXT: [[TMP1]] = add i32 [[TMP]], [[ANS_0]] -; IS__TUNIT_OPM-NEXT: br label [[WHILE_COND]] -; IS__TUNIT_OPM: while.end11: -; IS__TUNIT_OPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] -; IS__TUNIT_OPM-NEXT: ret i32 [[ANS_0_LCSSA]] -; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@nested_unbounded_loops -; IS__TUNIT_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR16]] { -; IS__TUNIT_NPM-NEXT: entry: -; IS__TUNIT_NPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__TUNIT_NPM: while.cond: -; IS__TUNIT_NPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP1:%.*]], [[WHILE_END10:%.*]] ] -; IS__TUNIT_NPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[WHILE_END10]] ] -; IS__TUNIT_NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 -; IS__TUNIT_NPM-NEXT: br i1 [[TOBOOL]], label [[WHILE_END11:%.*]], label [[WHILE_BODY:%.*]] -; IS__TUNIT_NPM: while.body: -; IS__TUNIT_NPM-NEXT: br label [[WHILE_COND1:%.*]] -; IS__TUNIT_NPM: while.cond1: -; IS__TUNIT_NPM-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY4:%.*]] -; IS__TUNIT_NPM: while.body4: -; IS__TUNIT_NPM-NEXT: unreachable -; IS__TUNIT_NPM: while.end: -; IS__TUNIT_NPM-NEXT: [[TMP:%.*]] = add i32 [[N_ADDR_0]], -2 -; IS__TUNIT_NPM-NEXT: br label [[WHILE_COND5:%.*]] -; IS__TUNIT_NPM: while.cond5: -; IS__TUNIT_NPM-NEXT: br i1 true, label [[WHILE_END10]], label [[WHILE_BODY8:%.*]] -; IS__TUNIT_NPM: while.body8: -; IS__TUNIT_NPM-NEXT: unreachable -; IS__TUNIT_NPM: while.end10: -; IS__TUNIT_NPM-NEXT: [[TMP1]] = add i32 [[TMP]], [[ANS_0]] -; IS__TUNIT_NPM-NEXT: br label [[WHILE_COND]] -; IS__TUNIT_NPM: while.end11: -; IS__TUNIT_NPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] -; IS__TUNIT_NPM-NEXT: ret i32 [[ANS_0_LCSSA]] -; -; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@nested_unbounded_loops -; IS__CGSCC_OPM-SAME: (i32 [[N:%.*]]) #[[ATTR18]] { -; IS__CGSCC_OPM-NEXT: entry: -; IS__CGSCC_OPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__CGSCC_OPM: while.cond: -; IS__CGSCC_OPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP1:%.*]], [[WHILE_END10:%.*]] ] -; IS__CGSCC_OPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[WHILE_END10]] ] -; IS__CGSCC_OPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 -; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL]], label [[WHILE_END11:%.*]], label [[WHILE_BODY:%.*]] -; IS__CGSCC_OPM: while.body: -; IS__CGSCC_OPM-NEXT: br label [[WHILE_COND1:%.*]] -; IS__CGSCC_OPM: while.cond1: -; IS__CGSCC_OPM-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY4:%.*]] -; IS__CGSCC_OPM: while.body4: -; IS__CGSCC_OPM-NEXT: unreachable -; IS__CGSCC_OPM: while.end: -; IS__CGSCC_OPM-NEXT: [[TMP:%.*]] = add i32 [[N_ADDR_0]], -2 -; IS__CGSCC_OPM-NEXT: br label [[WHILE_COND5:%.*]] -; IS__CGSCC_OPM: while.cond5: -; IS__CGSCC_OPM-NEXT: br i1 true, label [[WHILE_END10]], label [[WHILE_BODY8:%.*]] -; IS__CGSCC_OPM: while.body8: -; IS__CGSCC_OPM-NEXT: unreachable -; IS__CGSCC_OPM: while.end10: -; IS__CGSCC_OPM-NEXT: [[TMP1]] = add i32 [[TMP]], [[ANS_0]] -; IS__CGSCC_OPM-NEXT: br label [[WHILE_COND]] -; IS__CGSCC_OPM: while.end11: -; IS__CGSCC_OPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] -; IS__CGSCC_OPM-NEXT: ret i32 [[ANS_0_LCSSA]] -; -; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@nested_unbounded_loops -; IS__CGSCC_NPM-SAME: (i32 [[N:%.*]]) #[[ATTR19]] { -; IS__CGSCC_NPM-NEXT: entry: -; IS__CGSCC_NPM-NEXT: br label [[WHILE_COND:%.*]] -; IS__CGSCC_NPM: while.cond: -; IS__CGSCC_NPM-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP1:%.*]], [[WHILE_END10:%.*]] ] -; IS__CGSCC_NPM-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[WHILE_END10]] ] -; IS__CGSCC_NPM-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 -; IS__CGSCC_NPM-NEXT: br i1 [[TOBOOL]], label [[WHILE_END11:%.*]], label [[WHILE_BODY:%.*]] -; IS__CGSCC_NPM: while.body: -; IS__CGSCC_NPM-NEXT: br label [[WHILE_COND1:%.*]] -; IS__CGSCC_NPM: while.cond1: -; IS__CGSCC_NPM-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY4:%.*]] -; IS__CGSCC_NPM: while.body4: -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: while.end: -; IS__CGSCC_NPM-NEXT: [[TMP:%.*]] = add i32 [[N_ADDR_0]], -2 -; IS__CGSCC_NPM-NEXT: br label [[WHILE_COND5:%.*]] -; IS__CGSCC_NPM: while.cond5: -; IS__CGSCC_NPM-NEXT: br i1 true, label [[WHILE_END10]], label [[WHILE_BODY8:%.*]] -; IS__CGSCC_NPM: while.body8: -; IS__CGSCC_NPM-NEXT: unreachable -; IS__CGSCC_NPM: while.end10: -; IS__CGSCC_NPM-NEXT: [[TMP1]] = add i32 [[TMP]], [[ANS_0]] -; IS__CGSCC_NPM-NEXT: br label [[WHILE_COND]] -; IS__CGSCC_NPM: while.end11: -; IS__CGSCC_NPM-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] -; IS__CGSCC_NPM-NEXT: ret i32 [[ANS_0_LCSSA]] +; MODULE: Function Attrs: nofree nosync nounwind readnone +; MODULE-LABEL: define {{[^@]+}}@nested_unbounded_loops +; MODULE-SAME: (i32 [[N:%.*]]) #[[ATTR16]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: br label [[WHILE_COND:%.*]] +; MODULE: while.cond: +; MODULE-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP1:%.*]], [[WHILE_END10:%.*]] ] +; MODULE-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[WHILE_END10]] ] +; MODULE-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 +; MODULE-NEXT: br i1 [[TOBOOL]], label [[WHILE_END11:%.*]], label [[WHILE_BODY:%.*]] +; MODULE: while.body: +; MODULE-NEXT: br label [[WHILE_COND1:%.*]] +; MODULE: while.cond1: +; MODULE-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY4:%.*]] +; MODULE: while.body4: +; MODULE-NEXT: unreachable +; MODULE: while.end: +; MODULE-NEXT: [[TMP:%.*]] = add i32 [[N_ADDR_0]], -2 +; MODULE-NEXT: br label [[WHILE_COND5:%.*]] +; MODULE: while.cond5: +; MODULE-NEXT: br i1 true, label [[WHILE_END10]], label [[WHILE_BODY8:%.*]] +; MODULE: while.body8: +; MODULE-NEXT: unreachable +; MODULE: while.end10: +; MODULE-NEXT: [[TMP1]] = add i32 [[TMP]], [[ANS_0]] +; MODULE-NEXT: br label [[WHILE_COND]] +; MODULE: while.end11: +; MODULE-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] +; MODULE-NEXT: ret i32 [[ANS_0_LCSSA]] +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone +; CGSCC-LABEL: define {{[^@]+}}@nested_unbounded_loops +; CGSCC-SAME: (i32 [[N:%.*]]) #[[ATTR19]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: br label [[WHILE_COND:%.*]] +; CGSCC: while.cond: +; CGSCC-NEXT: [[ANS_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP1:%.*]], [[WHILE_END10:%.*]] ] +; CGSCC-NEXT: [[N_ADDR_0:%.*]] = phi i32 [ [[N]], [[ENTRY]] ], [ -1, [[WHILE_END10]] ] +; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[N_ADDR_0]], 0 +; CGSCC-NEXT: br i1 [[TOBOOL]], label [[WHILE_END11:%.*]], label [[WHILE_BODY:%.*]] +; CGSCC: while.body: +; CGSCC-NEXT: br label [[WHILE_COND1:%.*]] +; CGSCC: while.cond1: +; CGSCC-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY4:%.*]] +; CGSCC: while.body4: +; CGSCC-NEXT: unreachable +; CGSCC: while.end: +; CGSCC-NEXT: [[TMP:%.*]] = add i32 [[N_ADDR_0]], -2 +; CGSCC-NEXT: br label [[WHILE_COND5:%.*]] +; CGSCC: while.cond5: +; CGSCC-NEXT: br i1 true, label [[WHILE_END10]], label [[WHILE_BODY8:%.*]] +; CGSCC: while.body8: +; CGSCC-NEXT: unreachable +; CGSCC: while.end10: +; CGSCC-NEXT: [[TMP1]] = add i32 [[TMP]], [[ANS_0]] +; CGSCC-NEXT: br label [[WHILE_COND]] +; CGSCC: while.end11: +; CGSCC-NEXT: [[ANS_0_LCSSA:%.*]] = phi i32 [ [[ANS_0]], [[WHILE_COND]] ] +; CGSCC-NEXT: ret i32 [[ANS_0_LCSSA]] ; entry: br label %while.cond @@ -1932,7 +1360,6 @@ ; goto entry1; ; else ; goto entry2; -; ; entry1: ; if (fact_loop(n)>5) ; goto exit; @@ -1948,125 +1375,65 @@ ; } 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 +; MODULE: Function Attrs: nofree nosync nounwind readnone +; MODULE-LABEL: define {{[^@]+}}@non_loop_cycle +; MODULE-SAME: (i32 [[N:%.*]]) #[[ATTR16]] { +; MODULE-NEXT: entry: +; MODULE-NEXT: [[CALL:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR16]] +; MODULE-NEXT: [[CMP:%.*]] = icmp sgt i32 [[CALL]], 5 +; MODULE-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] +; MODULE: if.then: +; MODULE-NEXT: br label [[ENTRY1:%.*]] +; MODULE: if.else: +; MODULE-NEXT: br label [[ENTRY2:%.*]] +; MODULE: entry1: +; MODULE-NEXT: [[CALL1:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR16]] +; MODULE-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[CALL1]], 5 +; MODULE-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_ELSE4:%.*]] +; MODULE: if.then3: +; MODULE-NEXT: br label [[EXIT:%.*]] +; MODULE: if.else4: +; MODULE-NEXT: br label [[ENTRY2]] +; MODULE: entry2: +; MODULE-NEXT: [[CALL5:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR16]] +; MODULE-NEXT: [[CMP6:%.*]] = icmp sgt i32 [[CALL5]], 5 +; MODULE-NEXT: br i1 [[CMP6]], label [[IF_THEN7:%.*]], label [[IF_ELSE8:%.*]] +; MODULE: if.then7: +; MODULE-NEXT: br label [[EXIT]] +; MODULE: if.else8: +; MODULE-NEXT: br label [[ENTRY1]] +; MODULE: exit: +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: nofree norecurse nosync nounwind readnone +; CGSCC-LABEL: define {{[^@]+}}@non_loop_cycle +; CGSCC-SAME: (i32 [[N:%.*]]) #[[ATTR19]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[CALL:%.*]] = call i32 @fact_loop(i32 [[N]]) +; CGSCC-NEXT: [[CMP:%.*]] = icmp sgt i32 [[CALL]], 5 +; CGSCC-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] +; CGSCC: if.then: +; CGSCC-NEXT: br label [[ENTRY1:%.*]] +; CGSCC: if.else: +; CGSCC-NEXT: br label [[ENTRY2:%.*]] +; CGSCC: entry1: +; CGSCC-NEXT: [[CALL1:%.*]] = call i32 @fact_loop(i32 [[N]]) +; CGSCC-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[CALL1]], 5 +; CGSCC-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_ELSE4:%.*]] +; CGSCC: if.then3: +; CGSCC-NEXT: br label [[EXIT:%.*]] +; CGSCC: if.else4: +; CGSCC-NEXT: br label [[ENTRY2]] +; CGSCC: entry2: +; CGSCC-NEXT: [[CALL5:%.*]] = call i32 @fact_loop(i32 [[N]]) +; CGSCC-NEXT: [[CMP6:%.*]] = icmp sgt i32 [[CALL5]], 5 +; CGSCC-NEXT: br i1 [[CMP6]], label [[IF_THEN7:%.*]], label [[IF_ELSE8:%.*]] +; CGSCC: if.then7: +; CGSCC-NEXT: br label [[EXIT]] +; CGSCC: if.else8: +; CGSCC-NEXT: br label [[ENTRY1]] +; CGSCC: exit: +; CGSCC-NEXT: ret void ; entry: %call = call i32 @fact_loop(i32 %n) @@ -2112,85 +1479,49 @@ declare void @readonly_mustprogress() readonly mustprogress define void @willreturn_mustprogress_caller_1() mustprogress { -; IS__TUNIT_OPM: Function Attrs: mustprogress -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_1 -; IS__TUNIT_OPM-SAME: () #[[ATTR18:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: call void @unknown() -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: mustprogress -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_1 -; IS__TUNIT_NPM-SAME: () #[[ATTR20:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: call void @unknown() -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: mustprogress -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_1 -; IS__CGSCC_OPM-SAME: () #[[ATTR21:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: call void @unknown() -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: mustprogress -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_1 -; IS__CGSCC_NPM-SAME: () #[[ATTR23:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: call void @unknown() -; IS__CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: mustprogress +; MODULE-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_1 +; MODULE-SAME: () #[[ATTR20:[0-9]+]] { +; MODULE-NEXT: call void @unknown() +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: mustprogress +; CGSCC-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_1 +; CGSCC-SAME: () #[[ATTR23:[0-9]+]] { +; CGSCC-NEXT: call void @unknown() +; CGSCC-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 +; MODULE: Function Attrs: mustprogress readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_2 +; MODULE-SAME: () #[[ATTR22:[0-9]+]] { +; MODULE-NEXT: call void @readonly() #[[ATTR18:[0-9]+]] +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: mustprogress readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_2 +; CGSCC-SAME: () #[[ATTR25:[0-9]+]] { +; CGSCC-NEXT: call void @readonly() #[[ATTR21:[0-9]+]] +; CGSCC-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 +; MODULE: Function Attrs: mustprogress nosync readnone willreturn +; MODULE-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_3 +; MODULE-SAME: () #[[ATTR23:[0-9]+]] { +; MODULE-NEXT: call void @readnone() +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: mustprogress nosync readnone willreturn +; CGSCC-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_3 +; CGSCC-SAME: () #[[ATTR26:[0-9]+]] { +; CGSCC-NEXT: call void @readnone() +; CGSCC-NEXT: ret void ; call void @readnone() ret void @@ -2204,29 +1535,17 @@ ret void } define void @willreturn_mustprogress_callee_2() { -; IS__TUNIT_OPM: Function Attrs: readonly willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_2 -; IS__TUNIT_OPM-SAME: () #[[ATTR22:[0-9]+]] { -; IS__TUNIT_OPM-NEXT: call void @readonly_mustprogress() #[[ATTR22]] -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: readonly willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_2 -; IS__TUNIT_NPM-SAME: () #[[ATTR24:[0-9]+]] { -; IS__TUNIT_NPM-NEXT: call void @readonly_mustprogress() #[[ATTR24]] -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: readonly willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_2 -; IS__CGSCC_OPM-SAME: () #[[ATTR25:[0-9]+]] { -; IS__CGSCC_OPM-NEXT: call void @readonly_mustprogress() #[[ATTR25]] -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: readonly willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_2 -; IS__CGSCC_NPM-SAME: () #[[ATTR27:[0-9]+]] { -; IS__CGSCC_NPM-NEXT: call void @readonly_mustprogress() #[[ATTR27]] -; IS__CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_2 +; MODULE-SAME: () #[[ATTR24:[0-9]+]] { +; MODULE-NEXT: call void @readonly_mustprogress() #[[ATTR24]] +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_2 +; CGSCC-SAME: () #[[ATTR27:[0-9]+]] { +; CGSCC-NEXT: call void @readonly_mustprogress() #[[ATTR27]] +; CGSCC-NEXT: ret void ; call void @readonly_mustprogress() ret void @@ -2240,29 +1559,17 @@ ret void } define void @willreturn_mustprogress_callee_4() { -; IS__TUNIT_OPM: Function Attrs: readonly willreturn -; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_4 -; IS__TUNIT_OPM-SAME: () #[[ATTR22]] { -; IS__TUNIT_OPM-NEXT: call void @willreturn_mustprogress_callee_2() #[[ATTR22]] -; IS__TUNIT_OPM-NEXT: ret void -; -; IS__TUNIT_NPM: Function Attrs: readonly willreturn -; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_4 -; IS__TUNIT_NPM-SAME: () #[[ATTR24]] { -; IS__TUNIT_NPM-NEXT: call void @willreturn_mustprogress_callee_2() #[[ATTR24]] -; IS__TUNIT_NPM-NEXT: ret void -; -; IS__CGSCC_OPM: Function Attrs: readonly willreturn -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_4 -; IS__CGSCC_OPM-SAME: () #[[ATTR25]] { -; IS__CGSCC_OPM-NEXT: call void @willreturn_mustprogress_callee_2() #[[ATTR25]] -; IS__CGSCC_OPM-NEXT: ret void -; -; IS__CGSCC_NPM: Function Attrs: readonly willreturn -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_4 -; IS__CGSCC_NPM-SAME: () #[[ATTR27]] { -; IS__CGSCC_NPM-NEXT: call void @willreturn_mustprogress_callee_2() #[[ATTR27]] -; IS__CGSCC_NPM-NEXT: ret void +; MODULE: Function Attrs: readonly willreturn +; MODULE-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_4 +; MODULE-SAME: () #[[ATTR24]] { +; MODULE-NEXT: call void @willreturn_mustprogress_callee_2() #[[ATTR24]] +; MODULE-NEXT: ret void +; +; CGSCC: Function Attrs: readonly willreturn +; CGSCC-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_4 +; CGSCC-SAME: () #[[ATTR27]] { +; CGSCC-NEXT: call void @willreturn_mustprogress_callee_2() #[[ATTR27]] +; CGSCC-NEXT: ret void ; call void @willreturn_mustprogress_callee_2() ret void @@ -2271,128 +1578,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 } +; MODULE: attributes #[[ATTR0]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; MODULE: attributes #[[ATTR1]] = { nofree noinline nosync nounwind readnone uwtable } +; MODULE: attributes #[[ATTR2:[0-9]+]] = { nofree nosync nounwind willreturn } +; MODULE: attributes #[[ATTR3]] = { nofree noinline nosync nounwind uwtable } +; MODULE: attributes #[[ATTR4]] = { noreturn } +; MODULE: attributes #[[ATTR5]] = { noinline noreturn nounwind uwtable } +; MODULE: attributes #[[ATTR6]] = { noinline nounwind uwtable } +; MODULE: attributes #[[ATTR7:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } +; MODULE: attributes #[[ATTR8:[0-9]+]] = { norecurse willreturn } +; MODULE: attributes #[[ATTR9]] = { noinline nounwind uwtable willreturn } +; MODULE: attributes #[[ATTR10:[0-9]+]] = { noinline uwtable willreturn } +; MODULE: attributes #[[ATTR11]] = { nounwind willreturn } +; MODULE: attributes #[[ATTR12]] = { argmemonly nofree noinline nosync nounwind readonly uwtable willreturn } +; MODULE: attributes #[[ATTR13]] = { argmemonly nofree noinline nosync nounwind readonly uwtable } +; MODULE: attributes #[[ATTR14]] = { nofree noinline noreturn nosync nounwind readnone uwtable } +; MODULE: attributes #[[ATTR15:[0-9]+]] = { noreturn nounwind } +; MODULE: attributes #[[ATTR16]] = { nofree nosync nounwind readnone } +; MODULE: attributes #[[ATTR17]] = { nofree nosync nounwind readnone willreturn } +; MODULE: attributes #[[ATTR18]] = { readonly } +; MODULE: attributes #[[ATTR19:[0-9]+]] = { readnone } +; MODULE: attributes #[[ATTR20]] = { mustprogress } +; MODULE: attributes #[[ATTR21:[0-9]+]] = { mustprogress readonly } +; MODULE: attributes #[[ATTR22]] = { mustprogress readonly willreturn } +; MODULE: attributes #[[ATTR23]] = { mustprogress nosync readnone willreturn } +; MODULE: attributes #[[ATTR24]] = { readonly willreturn } +; MODULE: attributes #[[ATTR25]] = { nofree nosync nounwind } +; MODULE: attributes #[[ATTR26]] = { readnone willreturn } +; MODULE: attributes #[[ATTR27]] = { nounwind } +; MODULE: 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 } +; CGSCC: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } +; CGSCC: attributes #[[ATTR1]] = { nofree noinline nosync nounwind readnone uwtable } +; CGSCC: attributes #[[ATTR2]] = { nofree noinline norecurse nosync nounwind readnone uwtable } +; CGSCC: attributes #[[ATTR3:[0-9]+]] = { nofree nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR4]] = { nofree noinline nosync nounwind uwtable } +; CGSCC: attributes #[[ATTR5]] = { noreturn } +; CGSCC: attributes #[[ATTR6]] = { noinline noreturn nounwind uwtable } +; CGSCC: attributes #[[ATTR7]] = { noinline nounwind uwtable } +; CGSCC: attributes #[[ATTR8:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } +; CGSCC: attributes #[[ATTR9]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; CGSCC: attributes #[[ATTR10:[0-9]+]] = { norecurse willreturn } +; CGSCC: attributes #[[ATTR11]] = { noinline norecurse nounwind uwtable willreturn } +; CGSCC: attributes #[[ATTR12]] = { noinline norecurse noreturn nounwind uwtable } +; CGSCC: attributes #[[ATTR13:[0-9]+]] = { noinline uwtable willreturn } +; CGSCC: attributes #[[ATTR14]] = { nounwind willreturn } +; CGSCC: attributes #[[ATTR15]] = { argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn } +; CGSCC: attributes #[[ATTR16]] = { argmemonly nofree noinline norecurse nosync nounwind readonly uwtable } +; CGSCC: attributes #[[ATTR17]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable } +; CGSCC: attributes #[[ATTR18:[0-9]+]] = { noreturn nounwind } +; CGSCC: attributes #[[ATTR19]] = { nofree norecurse nosync nounwind readnone } +; CGSCC: attributes #[[ATTR20]] = { nofree norecurse nosync nounwind readnone willreturn } +; CGSCC: attributes #[[ATTR21]] = { readonly } +; CGSCC: attributes #[[ATTR22:[0-9]+]] = { readnone } +; CGSCC: attributes #[[ATTR23]] = { mustprogress } +; CGSCC: attributes #[[ATTR24:[0-9]+]] = { mustprogress readonly } +; CGSCC: attributes #[[ATTR25]] = { mustprogress readonly willreturn } +; CGSCC: attributes #[[ATTR26]] = { mustprogress nosync readnone willreturn } +; CGSCC: attributes #[[ATTR27]] = { readonly willreturn } +; CGSCC: attributes #[[ATTR28]] = { nofree nosync nounwind readnone } +; CGSCC: attributes #[[ATTR29]] = { nofree nosync nounwind } +; CGSCC: attributes #[[ATTR30]] = { readnone willreturn } +; CGSCC: attributes #[[ATTR31]] = { nounwind } +; CGSCC: attributes #[[ATTR32]] = { willreturn } ;.