@@ -47,7 +47,7 @@ define i8 @call_simplifiable_1() {
4747; CGSCC-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16
4848; CGSCC-NEXT: [[I0:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 2
4949; CGSCC-NEXT: store i8 2, ptr [[I0]], align 2
50- ; CGSCC-NEXT: [[R:%.*]] = call i8 @read_arg(ptr nocapture nofree noundef nonnull readonly align 2 dereferenceable(1022) [[I0]]) #[[ATTR4 :[0-9]+]]
50+ ; CGSCC-NEXT: [[R:%.*]] = call i8 @read_arg(ptr nocapture nofree noundef nonnull readonly align 2 dereferenceable(1022) [[I0]]) #[[ATTR3 :[0-9]+]]
5151; CGSCC-NEXT: ret i8 [[R]]
5252;
5353entry:
@@ -77,8 +77,8 @@ define internal i8 @sum_two_same_loads(ptr %p) {
7777; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read)
7878; CGSCC-LABEL: define {{[^@]+}}@sum_two_same_loads
7979; CGSCC-SAME: (ptr nocapture nofree noundef nonnull readonly dereferenceable(1022) [[P:%.*]]) #[[ATTR2:[0-9]+]] {
80- ; CGSCC-NEXT: [[X:%.*]] = call i8 @read_arg_1(ptr nocapture nofree noundef nonnull readonly dereferenceable(1022) [[P]]) #[[ATTR4 ]]
81- ; CGSCC-NEXT: [[Y:%.*]] = call i8 @read_arg_1(ptr nocapture nofree noundef nonnull readonly dereferenceable(1022) [[P]]) #[[ATTR4 ]]
80+ ; CGSCC-NEXT: [[X:%.*]] = call i8 @read_arg_1(ptr nocapture nofree noundef nonnull readonly dereferenceable(1022) [[P]]) #[[ATTR3 ]]
81+ ; CGSCC-NEXT: [[Y:%.*]] = call i8 @read_arg_1(ptr nocapture nofree noundef nonnull readonly dereferenceable(1022) [[P]]) #[[ATTR3 ]]
8282; CGSCC-NEXT: [[Z:%.*]] = add nsw i8 [[X]], [[Y]]
8383; CGSCC-NEXT: ret i8 [[Z]]
8484;
@@ -107,7 +107,7 @@ define i8 @call_simplifiable_2() {
107107; CGSCC-NEXT: store i8 2, ptr [[I0]], align 2
108108; CGSCC-NEXT: [[I1:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 3
109109; CGSCC-NEXT: store i8 3, ptr [[I1]], align 1
110- ; CGSCC-NEXT: [[R:%.*]] = call i8 @sum_two_same_loads(ptr nocapture nofree noundef nonnull readonly align 2 dereferenceable(1022) [[I0]]) #[[ATTR4 ]]
110+ ; CGSCC-NEXT: [[R:%.*]] = call i8 @sum_two_same_loads(ptr nocapture nofree noundef nonnull readonly align 2 dereferenceable(1022) [[I0]]) #[[ATTR3 ]]
111111; CGSCC-NEXT: ret i8 [[R]]
112112;
113113entry:
@@ -136,7 +136,7 @@ define i8 @call_simplifiable_3() {
136136; CGSCC-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16
137137; CGSCC-NEXT: [[I2:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 2
138138; CGSCC-NEXT: store i8 2, ptr [[I2]], align 2
139- ; CGSCC-NEXT: [[R:%.*]] = call i8 @read_arg_index(ptr nocapture nofree noundef nonnull readonly align 16 dereferenceable(1024) [[BYTES]]) #[[ATTR4 ]]
139+ ; CGSCC-NEXT: [[R:%.*]] = call i8 @read_arg_index(ptr nocapture nofree noundef nonnull readonly align 16 dereferenceable(1024) [[BYTES]]) #[[ATTR3 ]]
140140; CGSCC-NEXT: ret i8 [[R]]
141141;
142142entry:
@@ -174,16 +174,16 @@ define internal i8 @sum_two_different_loads(ptr %p, ptr %q) {
174174; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read)
175175; TUNIT-LABEL: define {{[^@]+}}@sum_two_different_loads
176176; TUNIT-SAME: (ptr nocapture nofree nonnull readonly dereferenceable(972) [[P:%.*]], ptr nocapture nofree noundef nonnull readonly dereferenceable(971) [[Q:%.*]]) #[[ATTR1]] {
177- ; TUNIT-NEXT: [[X:%.*]] = call i8 @read_arg_2(ptr nocapture nofree noundef nonnull readonly dereferenceable(972) [[P]]) #[[ATTR3 :[0-9]+]]
178- ; TUNIT-NEXT: [[Y:%.*]] = call i8 @read_arg_2(ptr nocapture nofree noundef nonnull readonly dereferenceable(971) [[Q]]) #[[ATTR3 ]]
177+ ; TUNIT-NEXT: [[X:%.*]] = call i8 @read_arg_2(ptr nocapture nofree noundef nonnull readonly dereferenceable(972) [[P]]) #[[ATTR2 :[0-9]+]]
178+ ; TUNIT-NEXT: [[Y:%.*]] = call i8 @read_arg_2(ptr nocapture nofree noundef nonnull readonly dereferenceable(971) [[Q]]) #[[ATTR2 ]]
179179; TUNIT-NEXT: [[Z:%.*]] = add nsw i8 [[X]], [[Y]]
180180; TUNIT-NEXT: ret i8 [[Z]]
181181;
182182; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read)
183183; CGSCC-LABEL: define {{[^@]+}}@sum_two_different_loads
184184; CGSCC-SAME: (ptr nocapture nofree noundef nonnull readonly dereferenceable(972) [[P:%.*]], ptr nocapture nofree noundef nonnull readonly dereferenceable(971) [[Q:%.*]]) #[[ATTR2]] {
185- ; CGSCC-NEXT: [[X:%.*]] = call i8 @read_arg_2(ptr nocapture nofree noundef nonnull readonly dereferenceable(972) [[P]]) #[[ATTR4 ]]
186- ; CGSCC-NEXT: [[Y:%.*]] = call i8 @read_arg_2(ptr nocapture nofree noundef nonnull readonly dereferenceable(971) [[Q]]) #[[ATTR4 ]]
185+ ; CGSCC-NEXT: [[X:%.*]] = call i8 @read_arg_2(ptr nocapture nofree noundef nonnull readonly dereferenceable(972) [[P]]) #[[ATTR3 ]]
186+ ; CGSCC-NEXT: [[Y:%.*]] = call i8 @read_arg_2(ptr nocapture nofree noundef nonnull readonly dereferenceable(971) [[Q]]) #[[ATTR3 ]]
187187; CGSCC-NEXT: [[Z:%.*]] = add nsw i8 [[X]], [[Y]]
188188; CGSCC-NEXT: ret i8 [[Z]]
189189;
@@ -204,7 +204,7 @@ define i8 @call_partially_simplifiable_1() {
204204; TUNIT-NEXT: [[I3:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 3
205205; TUNIT-NEXT: store i8 3, ptr [[I3]], align 1
206206; TUNIT-NEXT: [[I4:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 4
207- ; TUNIT-NEXT: [[R:%.*]] = call i8 @sum_two_different_loads(ptr nocapture nofree noundef nonnull readonly align 2 dereferenceable(1022) [[I2]], ptr nocapture nofree noundef nonnull readonly dereferenceable(1021) [[I3]]) #[[ATTR3]]
207+ ; TUNIT-NEXT: [[R:%.*]] = call i8 @sum_two_different_loads(ptr nocapture nofree noundef nonnull readonly align 2 dereferenceable(1022) [[I2]], ptr nocapture nofree noundef nonnull readonly dereferenceable(1021) [[I3]]) #[[ATTR3:[0-9]+ ]]
208208; TUNIT-NEXT: ret i8 [[R]]
209209;
210210; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
@@ -218,7 +218,7 @@ define i8 @call_partially_simplifiable_1() {
218218; CGSCC-NEXT: store i8 3, ptr [[I3]], align 1
219219; CGSCC-NEXT: [[I4:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 4
220220; CGSCC-NEXT: store i8 4, ptr [[I4]], align 4
221- ; CGSCC-NEXT: [[R:%.*]] = call i8 @sum_two_different_loads(ptr nocapture nofree noundef nonnull readonly align 2 dereferenceable(1022) [[I2]], ptr nocapture nofree noundef nonnull readonly dereferenceable(1021) [[I3]]) #[[ATTR4 ]]
221+ ; CGSCC-NEXT: [[R:%.*]] = call i8 @sum_two_different_loads(ptr nocapture nofree noundef nonnull readonly align 2 dereferenceable(1022) [[I2]], ptr nocapture nofree noundef nonnull readonly dereferenceable(1021) [[I3]]) #[[ATTR3 ]]
222222; CGSCC-NEXT: ret i8 [[R]]
223223;
224224entry:
@@ -235,9 +235,9 @@ entry:
235235}
236236
237237define i8 @call_partially_simplifiable_2 (i1 %cond ) {
238- ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn
238+ ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
239239; TUNIT-LABEL: define {{[^@]+}}@call_partially_simplifiable_2
240- ; TUNIT-SAME: (i1 [[COND:%.*]]) #[[ATTR2:[0-9]+ ]] {
240+ ; TUNIT-SAME: (i1 [[COND:%.*]]) #[[ATTR0 ]] {
241241; TUNIT-NEXT: entry:
242242; TUNIT-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16
243243; TUNIT-NEXT: [[I51:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 51
@@ -250,9 +250,9 @@ define i8 @call_partially_simplifiable_2(i1 %cond) {
250250; TUNIT-NEXT: [[R:%.*]] = call i8 @sum_two_different_loads(ptr nocapture nofree nonnull readonly dereferenceable(972) [[SEL]], ptr nocapture nofree noundef nonnull readonly dereferenceable(971) [[I53]]) #[[ATTR3]]
251251; TUNIT-NEXT: ret i8 [[R]]
252252;
253- ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn
253+ ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
254254; CGSCC-LABEL: define {{[^@]+}}@call_partially_simplifiable_2
255- ; CGSCC-SAME: (i1 [[COND:%.*]]) #[[ATTR3:[0-9]+ ]] {
255+ ; CGSCC-SAME: (i1 [[COND:%.*]]) #[[ATTR1 ]] {
256256; CGSCC-NEXT: entry:
257257; CGSCC-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16
258258; CGSCC-NEXT: [[I51:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 51
@@ -263,7 +263,7 @@ define i8 @call_partially_simplifiable_2(i1 %cond) {
263263; CGSCC-NEXT: [[I54:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 54
264264; CGSCC-NEXT: store i8 4, ptr [[I54]], align 2
265265; CGSCC-NEXT: [[SEL:%.*]] = select i1 [[COND]], ptr [[I51]], ptr [[I52]]
266- ; CGSCC-NEXT: [[R:%.*]] = call i8 @sum_two_different_loads(ptr nocapture nofree noundef nonnull readonly dereferenceable(972) [[SEL]], ptr nocapture nofree noundef nonnull readonly dereferenceable(971) [[I53]]) #[[ATTR4 ]]
266+ ; CGSCC-NEXT: [[R:%.*]] = call i8 @sum_two_different_loads(ptr nocapture nofree noundef nonnull readonly dereferenceable(972) [[SEL]], ptr nocapture nofree noundef nonnull readonly dereferenceable(971) [[I53]]) #[[ATTR3 ]]
267267; CGSCC-NEXT: ret i8 [[R]]
268268;
269269entry:
@@ -284,12 +284,11 @@ entry:
284284;.
285285; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
286286; TUNIT: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) }
287- ; TUNIT: attributes #[[ATTR2]] = { mustprogress nofree norecurse nosync nounwind willreturn }
288- ; TUNIT: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn memory(read) }
287+ ; TUNIT: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn memory(read) }
288+ ; TUNIT: attributes #[[ATTR3]] = { nofree norecurse nosync nounwind willreturn memory(read) }
289289;.
290290; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) }
291291; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
292292; CGSCC: attributes #[[ATTR2]] = { mustprogress nofree nosync nounwind willreturn memory(argmem: read) }
293- ; CGSCC: attributes #[[ATTR3]] = { mustprogress nofree nosync nounwind willreturn }
294- ; CGSCC: attributes #[[ATTR4]] = { nofree willreturn memory(read) }
293+ ; CGSCC: attributes #[[ATTR3]] = { nofree willreturn memory(read) }
295294;.
0 commit comments