1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes 2; 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 3; 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 4; 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 5; 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 6; PR 32917 7 8@b = common local_unnamed_addr global i32 0, align 4 9@a = common local_unnamed_addr global i32 0, align 4 10 11define i32 @fn2() local_unnamed_addr { 12; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn 13; IS__TUNIT____-LABEL: define {{[^@]+}}@fn2 14; IS__TUNIT____-SAME: () local_unnamed_addr [[ATTR0:#.*]] { 15; IS__TUNIT____-NEXT: [[TMP1:%.*]] = load i32, i32* @b, align 4 16; IS__TUNIT____-NEXT: [[TMP2:%.*]] = sext i32 [[TMP1]] to i64 17; IS__TUNIT____-NEXT: [[TMP3:%.*]] = inttoptr i64 [[TMP2]] to i32* 18; IS__TUNIT____-NEXT: call fastcc void @fn1(i32* nocapture nofree readonly align 4 [[TMP3]]) [[ATTR0]] 19; IS__TUNIT____-NEXT: ret i32 undef 20; 21; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn 22; IS__CGSCC____-LABEL: define {{[^@]+}}@fn2 23; IS__CGSCC____-SAME: () local_unnamed_addr [[ATTR0:#.*]] { 24; IS__CGSCC____-NEXT: [[TMP1:%.*]] = load i32, i32* @b, align 4 25; IS__CGSCC____-NEXT: [[TMP2:%.*]] = sext i32 [[TMP1]] to i64 26; IS__CGSCC____-NEXT: [[TMP3:%.*]] = inttoptr i64 [[TMP2]] to i32* 27; IS__CGSCC____-NEXT: call fastcc void @fn1(i32* nocapture nofree nonnull readonly align 4 [[TMP3]]) [[ATTR1:#.*]] 28; IS__CGSCC____-NEXT: ret i32 undef 29; 30 %1 = load i32, i32* @b, align 4 31 %2 = sext i32 %1 to i64 32 %3 = inttoptr i64 %2 to i32* 33 call fastcc void @fn1(i32* %3) 34 ret i32 undef 35} 36 37define internal fastcc void @fn1(i32* nocapture readonly) unnamed_addr { 38; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn 39; IS__TUNIT____-LABEL: define {{[^@]+}}@fn1 40; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readonly align 4 [[TMP0:%.*]]) unnamed_addr [[ATTR0]] { 41; IS__TUNIT____-NEXT: [[TMP2:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 -1 42; IS__TUNIT____-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4 43; IS__TUNIT____-NEXT: store i32 [[TMP3]], i32* @a, align 4 44; IS__TUNIT____-NEXT: ret void 45; 46; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn 47; IS__CGSCC____-LABEL: define {{[^@]+}}@fn1 48; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readonly align 4 [[TMP0:%.*]]) unnamed_addr [[ATTR0]] { 49; IS__CGSCC____-NEXT: [[TMP2:%.*]] = getelementptr inbounds i32, i32* [[TMP0]], i64 -1 50; IS__CGSCC____-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4 51; IS__CGSCC____-NEXT: store i32 [[TMP3]], i32* @a, align 4 52; IS__CGSCC____-NEXT: ret void 53; 54 %2 = getelementptr inbounds i32, i32* %0, i64 -1 55 %3 = load i32, i32* %2, align 4 56 store i32 %3, i32* @a, align 4 57 ret void 58} 59