@@ -47,7 +47,7 @@ define i8 @call_simplifiable_1() {
47
47
; CGSCC-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16
48
48
; CGSCC-NEXT: [[I0:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 2
49
49
; 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]+]]
51
51
; CGSCC-NEXT: ret i8 [[R]]
52
52
;
53
53
entry:
@@ -77,8 +77,8 @@ define internal i8 @sum_two_same_loads(ptr %p) {
77
77
; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read)
78
78
; CGSCC-LABEL: define {{[^@]+}}@sum_two_same_loads
79
79
; 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 ]]
82
82
; CGSCC-NEXT: [[Z:%.*]] = add nsw i8 [[X]], [[Y]]
83
83
; CGSCC-NEXT: ret i8 [[Z]]
84
84
;
@@ -107,7 +107,7 @@ define i8 @call_simplifiable_2() {
107
107
; CGSCC-NEXT: store i8 2, ptr [[I0]], align 2
108
108
; CGSCC-NEXT: [[I1:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 3
109
109
; 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 ]]
111
111
; CGSCC-NEXT: ret i8 [[R]]
112
112
;
113
113
entry:
@@ -136,7 +136,7 @@ define i8 @call_simplifiable_3() {
136
136
; CGSCC-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16
137
137
; CGSCC-NEXT: [[I2:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 2
138
138
; 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 ]]
140
140
; CGSCC-NEXT: ret i8 [[R]]
141
141
;
142
142
entry:
@@ -174,16 +174,16 @@ define internal i8 @sum_two_different_loads(ptr %p, ptr %q) {
174
174
; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read)
175
175
; TUNIT-LABEL: define {{[^@]+}}@sum_two_different_loads
176
176
; 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 ]]
179
179
; TUNIT-NEXT: [[Z:%.*]] = add nsw i8 [[X]], [[Y]]
180
180
; TUNIT-NEXT: ret i8 [[Z]]
181
181
;
182
182
; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read)
183
183
; CGSCC-LABEL: define {{[^@]+}}@sum_two_different_loads
184
184
; 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 ]]
187
187
; CGSCC-NEXT: [[Z:%.*]] = add nsw i8 [[X]], [[Y]]
188
188
; CGSCC-NEXT: ret i8 [[Z]]
189
189
;
@@ -204,7 +204,7 @@ define i8 @call_partially_simplifiable_1() {
204
204
; TUNIT-NEXT: [[I3:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 3
205
205
; TUNIT-NEXT: store i8 3, ptr [[I3]], align 1
206
206
; 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]+ ]]
208
208
; TUNIT-NEXT: ret i8 [[R]]
209
209
;
210
210
; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
@@ -218,7 +218,7 @@ define i8 @call_partially_simplifiable_1() {
218
218
; CGSCC-NEXT: store i8 3, ptr [[I3]], align 1
219
219
; CGSCC-NEXT: [[I4:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 4
220
220
; 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 ]]
222
222
; CGSCC-NEXT: ret i8 [[R]]
223
223
;
224
224
entry:
@@ -235,9 +235,9 @@ entry:
235
235
}
236
236
237
237
define 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)
239
239
; TUNIT-LABEL: define {{[^@]+}}@call_partially_simplifiable_2
240
- ; TUNIT-SAME: (i1 [[COND:%.*]]) #[[ATTR2:[0-9]+ ]] {
240
+ ; TUNIT-SAME: (i1 [[COND:%.*]]) #[[ATTR0 ]] {
241
241
; TUNIT-NEXT: entry:
242
242
; TUNIT-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16
243
243
; 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) {
250
250
; 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]]
251
251
; TUNIT-NEXT: ret i8 [[R]]
252
252
;
253
- ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn
253
+ ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
254
254
; CGSCC-LABEL: define {{[^@]+}}@call_partially_simplifiable_2
255
- ; CGSCC-SAME: (i1 [[COND:%.*]]) #[[ATTR3:[0-9]+ ]] {
255
+ ; CGSCC-SAME: (i1 [[COND:%.*]]) #[[ATTR1 ]] {
256
256
; CGSCC-NEXT: entry:
257
257
; CGSCC-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16
258
258
; 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) {
263
263
; CGSCC-NEXT: [[I54:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 54
264
264
; CGSCC-NEXT: store i8 4, ptr [[I54]], align 2
265
265
; 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 ]]
267
267
; CGSCC-NEXT: ret i8 [[R]]
268
268
;
269
269
entry:
@@ -284,12 +284,11 @@ entry:
284
284
;.
285
285
; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
286
286
; 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) }
289
289
;.
290
290
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) }
291
291
; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
292
292
; 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) }
295
294
;.
0 commit comments