1- ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
1+ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
22; RUN: opt -O2 -S %s | FileCheck %s --check-prefix=WITHGLOBALSAA
33; RUN: opt -O2 -enable-global-analyses=0 -S %s | FileCheck %s --check-prefix=NOGLOBALSAA
44
55@glb = internal global i8 0
66
7+ ;.
8+ ; WITHGLOBALSAA: @glb = internal unnamed_addr global i1 false
9+ ;.
10+ ; NOGLOBALSAA: @glb = internal unnamed_addr global i1 false
11+ ;.
712define i8 @f (ptr %ptr ) {
813; WITHGLOBALSAA-LABEL: @f(
914; WITHGLOBALSAA-NEXT: store i8 1, ptr [[PTR:%.*]], align 1
@@ -22,17 +27,32 @@ define i8 @f(ptr %ptr) {
2227 ret i8 %r
2328}
2429
25- define i8 @dummy () {
30+ define i8 @dummy () !prof !0 {
2631; WITHGLOBALSAA-LABEL: @dummy(
2732; WITHGLOBALSAA-NEXT: [[VAL_B:%.*]] = load i1, ptr @glb, align 1
28- ; WITHGLOBALSAA-NEXT: [[VAL:%.*]] = select i1 [[VAL_B]], i8 2, i8 0
33+ ; WITHGLOBALSAA-NEXT: [[VAL:%.*]] = select i1 [[VAL_B]], i8 2, i8 0, !prof [[PROF1:![0-9]+]]
2934; WITHGLOBALSAA-NEXT: ret i8 [[VAL]]
3035;
3136; NOGLOBALSAA-LABEL: @dummy(
3237; NOGLOBALSAA-NEXT: [[VAL_B:%.*]] = load i1, ptr @glb, align 1
33- ; NOGLOBALSAA-NEXT: [[VAL:%.*]] = select i1 [[VAL_B]], i8 2, i8 0
38+ ; NOGLOBALSAA-NEXT: [[VAL:%.*]] = select i1 [[VAL_B]], i8 2, i8 0, !prof [[PROF1:![0-9]+]]
3439; NOGLOBALSAA-NEXT: ret i8 [[VAL]]
3540;
3641 %val = load i8 , ptr @glb
3742 ret i8 %val
3843}
44+
45+ !0 = !{!"function_entry_count" , i32 10 }
46+ ;.
47+ ; WITHGLOBALSAA: attributes #[[ATTR0:[0-9]+]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none, target_mem0: none, target_mem1: none) }
48+ ; WITHGLOBALSAA: attributes #[[ATTR1:[0-9]+]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none, target_mem0: none, target_mem1: none) }
49+ ;.
50+ ; NOGLOBALSAA: attributes #[[ATTR0:[0-9]+]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none, target_mem0: none, target_mem1: none) }
51+ ; NOGLOBALSAA: attributes #[[ATTR1:[0-9]+]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none, target_mem0: none, target_mem1: none) }
52+ ;.
53+ ; WITHGLOBALSAA: [[META0:![0-9]+]] = !{!"function_entry_count", i32 10}
54+ ; WITHGLOBALSAA: [[PROF1]] = !{!"unknown", !"globalopt"}
55+ ;.
56+ ; NOGLOBALSAA: [[META0:![0-9]+]] = !{!"function_entry_count", i32 10}
57+ ; NOGLOBALSAA: [[PROF1]] = !{!"unknown", !"globalopt"}
58+ ;.
0 commit comments