Skip to content

Commit 158d72d

Browse files
authored
[Clang] Set writable and dead_on_unwind attributes on sret arguments (#77116)
Set the writable and dead_on_unwind attributes for sret arguments. These indicate that the argument points to writable memory (and it's legal to introduce spurious writes to it on entry to the function) and that the argument memory will not be used if the call unwinds. This enables additional MemCpyOpt/DSE/LICM optimizations.
1 parent 66eedd1 commit 158d72d

File tree

134 files changed

+815
-837
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+815
-837
lines changed

clang/lib/CodeGen/CGCall.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -2612,6 +2612,8 @@ void CodeGenModule::ConstructAttributeList(StringRef Name,
26122612
if (IRFunctionArgs.hasSRetArg()) {
26132613
llvm::AttrBuilder SRETAttrs(getLLVMContext());
26142614
SRETAttrs.addStructRetAttr(getTypes().ConvertTypeForMem(RetTy));
2615+
SRETAttrs.addAttribute(llvm::Attribute::Writable);
2616+
SRETAttrs.addAttribute(llvm::Attribute::DeadOnUnwind);
26152617
hasUsedSRet = true;
26162618
if (RetAI.getInReg())
26172619
SRETAttrs.addAttribute(llvm::Attribute::InReg);

clang/test/CodeGen/2006-05-19-SingleEltReturn.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ struct Y bar(void) {
2424

2525

2626
// X86_32: define{{.*}} void @foo(ptr noundef %P)
27-
// X86_32: call void @bar(ptr sret(%struct.Y) align 4 %{{[^),]*}})
27+
// X86_32: call void @bar(ptr dead_on_unwind writable sret(%struct.Y) align 4 %{{[^),]*}})
2828

29-
// X86_32: define{{.*}} void @bar(ptr noalias sret(%struct.Y) align 4 %{{[^,)]*}})
29+
// X86_32: define{{.*}} void @bar(ptr dead_on_unwind noalias writable sret(%struct.Y) align 4 %{{[^,)]*}})
3030
// X86_32: ret void

clang/test/CodeGen/64bit-swiftcall.c

+11-11
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ SWIFTCALL int indirect_result_2(OUT int *arg0, OUT float *arg1) { __builtin_unr
3030

3131
typedef struct { char array[1024]; } struct_reallybig;
3232
SWIFTCALL struct_reallybig indirect_result_3(OUT int *arg0, OUT float *arg1) { __builtin_unreachable(); }
33-
// CHECK-LABEL: define {{.*}} void @indirect_result_3(ptr noalias sret(%struct.struct_reallybig) {{.*}}, ptr noalias align 4 dereferenceable(4){{.*}}, ptr noalias align 4 dereferenceable(4){{.*}})
33+
// CHECK-LABEL: define {{.*}} void @indirect_result_3(ptr dead_on_unwind noalias writable sret(%struct.struct_reallybig) {{.*}}, ptr noalias align 4 dereferenceable(4){{.*}}, ptr noalias align 4 dereferenceable(4){{.*}})
3434

3535
SWIFTCALL void context_1(CONTEXT void *self) {}
3636
// CHECK-LABEL: define {{.*}} void @context_1(ptr swiftself
@@ -238,7 +238,7 @@ typedef struct {
238238
} struct_big_1;
239239
TEST(struct_big_1)
240240

241-
// CHECK-LABEL: define {{.*}} void @return_struct_big_1({{.*}} noalias sret
241+
// CHECK-LABEL: define {{.*}} void @return_struct_big_1(ptr dead_on_unwind noalias writable sret
242242

243243
// Should not be byval.
244244
// CHECK-LABEL: define {{.*}} void @take_struct_big_1(ptr{{( %.*)?}})
@@ -522,7 +522,7 @@ typedef struct {
522522
double d4;
523523
} struct_d5;
524524
TEST(struct_d5)
525-
// CHECK: define{{.*}} swiftcc void @return_struct_d5(ptr noalias sret([[STRUCT5:.+]])
525+
// CHECK: define{{.*}} swiftcc void @return_struct_d5(ptr dead_on_unwind noalias writable sret([[STRUCT5:.+]])
526526
// CHECK: define{{.*}} swiftcc void @take_struct_d5(ptr
527527

528528
typedef struct {
@@ -709,7 +709,7 @@ typedef struct {
709709
long long l4;
710710
} struct_l5;
711711
TEST(struct_l5)
712-
// CHECK: define{{.*}} swiftcc void @return_struct_l5(ptr noalias sret([[STRUCT5:.+]])
712+
// CHECK: define{{.*}} swiftcc void @return_struct_l5(ptr dead_on_unwind noalias writable sret([[STRUCT5:.+]])
713713
// CHECK: define{{.*}} swiftcc void @take_struct_l5(ptr
714714

715715
typedef struct {
@@ -754,7 +754,7 @@ typedef struct {
754754
char16 c4;
755755
} struct_vc5;
756756
TEST(struct_vc5)
757-
// CHECK: define{{.*}} swiftcc void @return_struct_vc5(ptr noalias sret([[STRUCT:.+]])
757+
// CHECK: define{{.*}} swiftcc void @return_struct_vc5(ptr dead_on_unwind noalias writable sret([[STRUCT:.+]])
758758
// CHECK: define{{.*}} swiftcc void @take_struct_vc5(ptr
759759

760760
typedef struct {
@@ -799,7 +799,7 @@ typedef struct {
799799
short8 c4;
800800
} struct_vs5;
801801
TEST(struct_vs5)
802-
// CHECK: define{{.*}} swiftcc void @return_struct_vs5(ptr noalias sret([[STRUCT:.+]])
802+
// CHECK: define{{.*}} swiftcc void @return_struct_vs5(ptr dead_on_unwind noalias writable sret([[STRUCT:.+]])
803803
// CHECK: define{{.*}} swiftcc void @take_struct_vs5(ptr
804804

805805
typedef struct {
@@ -844,7 +844,7 @@ typedef struct {
844844
int4 c4;
845845
} struct_vi5;
846846
TEST(struct_vi5)
847-
// CHECK: define{{.*}} swiftcc void @return_struct_vi5(ptr noalias sret([[STRUCT:.+]])
847+
// CHECK: define{{.*}} swiftcc void @return_struct_vi5(ptr dead_on_unwind noalias writable sret([[STRUCT:.+]])
848848
// CHECK: define{{.*}} swiftcc void @take_struct_vi5(ptr
849849

850850
typedef struct {
@@ -872,7 +872,7 @@ typedef struct {
872872
long2 c4;
873873
} struct_vl5;
874874
TEST(struct_vl5)
875-
// CHECK: define{{.*}} swiftcc void @return_struct_vl5(ptr noalias sret([[STRUCT:.+]])
875+
// CHECK: define{{.*}} swiftcc void @return_struct_vl5(ptr dead_on_unwind noalias writable sret([[STRUCT:.+]])
876876
// CHECK: define{{.*}} swiftcc void @take_struct_vl5(ptr
877877

878878
typedef struct {
@@ -900,7 +900,7 @@ typedef struct {
900900
double2 c4;
901901
} struct_vd5;
902902
TEST(struct_vd5)
903-
// CHECK: define{{.*}} swiftcc void @return_struct_vd5(ptr noalias sret([[STRUCT:.+]])
903+
// CHECK: define{{.*}} swiftcc void @return_struct_vd5(ptr dead_on_unwind noalias writable sret([[STRUCT:.+]])
904904
// CHECK: define{{.*}} swiftcc void @take_struct_vd5(ptr
905905

906906
typedef struct {
@@ -924,7 +924,7 @@ typedef struct {
924924
double4 c2;
925925
} struct_vd43;
926926
TEST(struct_vd43)
927-
// CHECK: define{{.*}} swiftcc void @return_struct_vd43(ptr noalias sret([[STRUCT:.+]])
927+
// CHECK: define{{.*}} swiftcc void @return_struct_vd43(ptr dead_on_unwind noalias writable sret([[STRUCT:.+]])
928928
// CHECK: define{{.*}} swiftcc void @take_struct_vd43(ptr
929929

930930
typedef struct {
@@ -960,7 +960,7 @@ typedef struct {
960960
float4 c4;
961961
} struct_vf5;
962962
TEST(struct_vf5)
963-
// CHECK: define{{.*}} swiftcc void @return_struct_vf5(ptr noalias sret([[STRUCT:.+]])
963+
// CHECK: define{{.*}} swiftcc void @return_struct_vf5(ptr dead_on_unwind noalias writable sret([[STRUCT:.+]])
964964
// CHECK: define{{.*}} swiftcc void @take_struct_vf5(ptr
965965

966966
typedef struct {

clang/test/CodeGen/CSKY/csky-abi.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ void f_agg_large(struct large x) {
117117

118118
// The address where the struct should be written to will be the first
119119
// argument
120-
// CHECK-LABEL: define{{.*}} void @f_agg_large_ret(ptr noalias sret(%struct.large) align 4 %agg.result, i32 noundef %i, i8 noundef signext %j)
120+
// CHECK-LABEL: define{{.*}} void @f_agg_large_ret(ptr dead_on_unwind noalias writable sret(%struct.large) align 4 %agg.result, i32 noundef %i, i8 noundef signext %j)
121121
struct large f_agg_large_ret(int32_t i, int8_t j) {
122122
return (struct large){1, 2, 3, 4};
123123
}
@@ -144,7 +144,7 @@ int f_scalar_stack_1(struct tiny a, struct small b, struct small_aligned c,
144144
// the presence of large return values that consume a register due to the need
145145
// to pass a pointer.
146146

147-
// CHECK-LABEL: define{{.*}} void @f_scalar_stack_2(ptr noalias sret(%struct.large) align 4 %agg.result, i32 noundef %a, i64 noundef %b, i64 noundef %c, double noundef %d, i8 noundef zeroext %e, i8 noundef signext %f, i8 noundef zeroext %g)
147+
// CHECK-LABEL: define{{.*}} void @f_scalar_stack_2(ptr dead_on_unwind noalias writable sret(%struct.large) align 4 %agg.result, i32 noundef %a, i64 noundef %b, i64 noundef %c, double noundef %d, i8 noundef zeroext %e, i8 noundef signext %f, i8 noundef zeroext %g)
148148
struct large f_scalar_stack_2(int32_t a, int64_t b, int64_t c, long double d,
149149
uint8_t e, int8_t f, uint8_t g) {
150150
return (struct large){a, e, f, g};

clang/test/CodeGen/CSKY/csky-hard-abi.c

+22-22
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ struct double_float_s {
7272
// CHECK: define{{.*}} void @f_double_double_s_arg([4 x i32] %a.coerce)
7373
void f_double_double_s_arg(struct double_double_s a) {}
7474

75-
// CHECK: define{{.*}} void @f_ret_double_double_s(ptr noalias sret(%struct.double_double_s) align 4 %agg.result)
75+
// CHECK: define{{.*}} void @f_ret_double_double_s(ptr dead_on_unwind noalias writable sret(%struct.double_double_s) align 4 %agg.result)
7676
struct double_double_s f_ret_double_double_s(void) {
7777
return (struct double_double_s){1.0, 2.0};
7878
}
7979

8080
// CHECK: define{{.*}} void @f_double_float_s_arg([3 x i32] %a.coerce)
8181
void f_double_float_s_arg(struct double_float_s a) {}
8282

83-
// CHECK: define{{.*}} void @f_ret_double_float_s(ptr noalias sret(%struct.double_float_s) align 4 %agg.result)
83+
// CHECK: define{{.*}} void @f_ret_double_float_s(ptr dead_on_unwind noalias writable sret(%struct.double_float_s) align 4 %agg.result)
8484
struct double_float_s f_ret_double_float_s(void) {
8585
return (struct double_float_s){1.0, 2.0};
8686
}
@@ -118,47 +118,47 @@ struct double_int8_zbf_s {
118118
// CHECK: define{{.*}} @f_double_int8_s_arg([3 x i32] %a.coerce)
119119
void f_double_int8_s_arg(struct double_int8_s a) {}
120120

121-
// CHECK: define{{.*}} void @f_ret_double_int8_s(ptr noalias sret(%struct.double_int8_s) align 4 %agg.result)
121+
// CHECK: define{{.*}} void @f_ret_double_int8_s(ptr dead_on_unwind noalias writable sret(%struct.double_int8_s) align 4 %agg.result)
122122
struct double_int8_s f_ret_double_int8_s(void) {
123123
return (struct double_int8_s){1.0, 2};
124124
}
125125

126126
// CHECK: define{{.*}} void @f_double_uint8_s_arg([3 x i32] %a.coerce)
127127
void f_double_uint8_s_arg(struct double_uint8_s a) {}
128128

129-
// CHECK: define{{.*}} void @f_ret_double_uint8_s(ptr noalias sret(%struct.double_uint8_s) align 4 %agg.result)
129+
// CHECK: define{{.*}} void @f_ret_double_uint8_s(ptr dead_on_unwind noalias writable sret(%struct.double_uint8_s) align 4 %agg.result)
130130
struct double_uint8_s f_ret_double_uint8_s(void) {
131131
return (struct double_uint8_s){1.0, 2};
132132
}
133133

134134
// CHECK: define{{.*}} void @f_double_int32_s_arg([3 x i32] %a.coerce)
135135
void f_double_int32_s_arg(struct double_int32_s a) {}
136136

137-
// CHECK: define{{.*}} void @f_ret_double_int32_s(ptr noalias sret(%struct.double_int32_s) align 4 %agg.result)
137+
// CHECK: define{{.*}} void @f_ret_double_int32_s(ptr dead_on_unwind noalias writable sret(%struct.double_int32_s) align 4 %agg.result)
138138
struct double_int32_s f_ret_double_int32_s(void) {
139139
return (struct double_int32_s){1.0, 2};
140140
}
141141

142142
// CHECK: define{{.*}} void @f_double_int64_s_arg([4 x i32] %a.coerce)
143143
void f_double_int64_s_arg(struct double_int64_s a) {}
144144

145-
// CHECK: define{{.*}} void @f_ret_double_int64_s(ptr noalias sret(%struct.double_int64_s) align 4 %agg.result)
145+
// CHECK: define{{.*}} void @f_ret_double_int64_s(ptr dead_on_unwind noalias writable sret(%struct.double_int64_s) align 4 %agg.result)
146146
struct double_int64_s f_ret_double_int64_s(void) {
147147
return (struct double_int64_s){1.0, 2};
148148
}
149149

150150
// CHECK: define{{.*}} void @f_double_int64bf_s_arg([3 x i32] %a.coerce)
151151
void f_double_int64bf_s_arg(struct double_int64bf_s a) {}
152152

153-
// CHECK: define{{.*}} void @f_ret_double_int64bf_s(ptr noalias sret(%struct.double_int64bf_s) align 4 %agg.result)
153+
// CHECK: define{{.*}} void @f_ret_double_int64bf_s(ptr dead_on_unwind noalias writable sret(%struct.double_int64bf_s) align 4 %agg.result)
154154
struct double_int64bf_s f_ret_double_int64bf_s(void) {
155155
return (struct double_int64bf_s){1.0, 2};
156156
}
157157

158158
// CHECK: define{{.*}} void @f_double_int8_zbf_s([3 x i32] %a.coerce)
159159
void f_double_int8_zbf_s(struct double_int8_zbf_s a) {}
160160

161-
// CHECK: define{{.*}} void @f_ret_double_int8_zbf_s(ptr noalias sret(%struct.double_int8_zbf_s) align 4 %agg.result)
161+
// CHECK: define{{.*}} void @f_ret_double_int8_zbf_s(ptr dead_on_unwind noalias writable sret(%struct.double_int8_zbf_s) align 4 %agg.result)
162162
struct double_int8_zbf_s f_ret_double_int8_zbf_s(void) {
163163
return (struct double_int8_zbf_s){1.0, 2};
164164
}
@@ -179,7 +179,7 @@ void f_struct_double_int8_insufficient_fprs(float a, double b, double c, double
179179
// CHECK: define{{.*}} void @f_doublecomplex(double noundef %a.coerce0, double noundef %a.coerce1)
180180
void f_doublecomplex(double __complex__ a) {}
181181

182-
// CHECK: define{{.*}} void @f_ret_doublecomplex(ptr noalias sret({ double, double }) align 4 %agg.result)
182+
// CHECK: define{{.*}} void @f_ret_doublecomplex(ptr dead_on_unwind noalias writable sret({ double, double }) align 4 %agg.result)
183183
double __complex__ f_ret_doublecomplex(void) {
184184
return 1.0;
185185
}
@@ -191,7 +191,7 @@ struct doublecomplex_s {
191191
// CHECK: define{{.*}} void @f_doublecomplex_s_arg([4 x i32] %a.coerce)
192192
void f_doublecomplex_s_arg(struct doublecomplex_s a) {}
193193

194-
// CHECK: define{{.*}} void @f_ret_doublecomplex_s(ptr noalias sret(%struct.doublecomplex_s) align 4 %agg.result)
194+
// CHECK: define{{.*}} void @f_ret_doublecomplex_s(ptr dead_on_unwind noalias writable sret(%struct.doublecomplex_s) align 4 %agg.result)
195195
struct doublecomplex_s f_ret_doublecomplex_s(void) {
196196
return (struct doublecomplex_s){1.0};
197197
}
@@ -218,7 +218,7 @@ struct doublearr2_s {
218218
// CHECK: define{{.*}} void @f_doublearr2_s_arg([4 x i32] %a.coerce)
219219
void f_doublearr2_s_arg(struct doublearr2_s a) {}
220220

221-
// CHECK: define{{.*}} void @f_ret_doublearr2_s(ptr noalias sret(%struct.doublearr2_s) align 4 %agg.result)
221+
// CHECK: define{{.*}} void @f_ret_doublearr2_s(ptr dead_on_unwind noalias writable sret(%struct.doublearr2_s) align 4 %agg.result)
222222
struct doublearr2_s f_ret_doublearr2_s(void) {
223223
return (struct doublearr2_s){{1.0, 2.0}};
224224
}
@@ -232,7 +232,7 @@ struct doublearr2_tricky1_s {
232232
// CHECK: define{{.*}} void @f_doublearr2_tricky1_s_arg([4 x i32] %a.coerce)
233233
void f_doublearr2_tricky1_s_arg(struct doublearr2_tricky1_s a) {}
234234

235-
// CHECK: define{{.*}} void @f_ret_doublearr2_tricky1_s(ptr noalias sret(%struct.doublearr2_tricky1_s) align 4 %agg.result)
235+
// CHECK: define{{.*}} void @f_ret_doublearr2_tricky1_s(ptr dead_on_unwind noalias writable sret(%struct.doublearr2_tricky1_s) align 4 %agg.result)
236236
struct doublearr2_tricky1_s f_ret_doublearr2_tricky1_s(void) {
237237
return (struct doublearr2_tricky1_s){{{{1.0}}, {{2.0}}}};
238238
}
@@ -247,7 +247,7 @@ struct doublearr2_tricky2_s {
247247
// CHECK: define{{.*}} void @f_doublearr2_tricky2_s_arg([4 x i32] %a.coerce)
248248
void f_doublearr2_tricky2_s_arg(struct doublearr2_tricky2_s a) {}
249249

250-
// CHECK: define{{.*}} void @f_ret_doublearr2_tricky2_s(ptr noalias sret(%struct.doublearr2_tricky2_s) align 4 %agg.result)
250+
// CHECK: define{{.*}} void @f_ret_doublearr2_tricky2_s(ptr dead_on_unwind noalias writable sret(%struct.doublearr2_tricky2_s) align 4 %agg.result)
251251
struct doublearr2_tricky2_s f_ret_doublearr2_tricky2_s(void) {
252252
return (struct doublearr2_tricky2_s){{}, {{{1.0}}, {{2.0}}}};
253253
}
@@ -262,7 +262,7 @@ struct doublearr2_tricky3_s {
262262
// CHECK: define{{.*}} void @f_doublearr2_tricky3_s_arg([4 x i32] %a.coerce)
263263
void f_doublearr2_tricky3_s_arg(struct doublearr2_tricky3_s a) {}
264264

265-
// CHECK: define{{.*}} void @f_ret_doublearr2_tricky3_s(ptr noalias sret(%struct.doublearr2_tricky3_s) align 4 %agg.result)
265+
// CHECK: define{{.*}} void @f_ret_doublearr2_tricky3_s(ptr dead_on_unwind noalias writable sret(%struct.doublearr2_tricky3_s) align 4 %agg.result)
266266
struct doublearr2_tricky3_s f_ret_doublearr2_tricky3_s(void) {
267267
return (struct doublearr2_tricky3_s){{}, {{{1.0}}, {{2.0}}}};
268268
}
@@ -278,7 +278,7 @@ struct doublearr2_tricky4_s {
278278
// CHECK: define{{.*}} void @f_doublearr2_tricky4_s_arg([4 x i32] %a.coerce)
279279
void f_doublearr2_tricky4_s_arg(struct doublearr2_tricky4_s a) {}
280280

281-
// CHECK: define{{.*}} void @f_ret_doublearr2_tricky4_s(ptr noalias sret(%struct.doublearr2_tricky4_s) align 4 %agg.result)
281+
// CHECK: define{{.*}} void @f_ret_doublearr2_tricky4_s(ptr dead_on_unwind noalias writable sret(%struct.doublearr2_tricky4_s) align 4 %agg.result)
282282
struct doublearr2_tricky4_s f_ret_doublearr2_tricky4_s(void) {
283283
return (struct doublearr2_tricky4_s){{}, {{{}, {1.0}}, {{}, {2.0}}}};
284284
}
@@ -292,7 +292,7 @@ struct int_double_int_s {
292292
// CHECK: define{{.*}} void @f_int_double_int_s_arg([4 x i32] %a.coerce)
293293
void f_int_double_int_s_arg(struct int_double_int_s a) {}
294294

295-
// CHECK: define{{.*}} void @f_ret_int_double_int_s(ptr noalias sret(%struct.int_double_int_s) align 4 %agg.result)
295+
// CHECK: define{{.*}} void @f_ret_int_double_int_s(ptr dead_on_unwind noalias writable sret(%struct.int_double_int_s) align 4 %agg.result)
296296
struct int_double_int_s f_ret_int_double_int_s(void) {
297297
return (struct int_double_int_s){1, 2.0, 3};
298298
}
@@ -305,7 +305,7 @@ struct int64_double_s {
305305
// CHECK: define{{.*}} void @f_int64_double_s_arg([4 x i32] %a.coerce)
306306
void f_int64_double_s_arg(struct int64_double_s a) {}
307307

308-
// CHECK: define{{.*}} void @f_ret_int64_double_s(ptr noalias sret(%struct.int64_double_s) align 4 %agg.result)
308+
// CHECK: define{{.*}} void @f_ret_int64_double_s(ptr dead_on_unwind noalias writable sret(%struct.int64_double_s) align 4 %agg.result)
309309
struct int64_double_s f_ret_int64_double_s(void) {
310310
return (struct int64_double_s){1, 2.0};
311311
}
@@ -319,7 +319,7 @@ struct char_char_double_s {
319319
// CHECK-LABEL: define{{.*}} void @f_char_char_double_s_arg([3 x i32] %a.coerce)
320320
void f_char_char_double_s_arg(struct char_char_double_s a) {}
321321

322-
// CHECK: define{{.*}} void @f_ret_char_char_double_s(ptr noalias sret(%struct.char_char_double_s) align 4 %agg.result)
322+
// CHECK: define{{.*}} void @f_ret_char_char_double_s(ptr dead_on_unwind noalias writable sret(%struct.char_char_double_s) align 4 %agg.result)
323323
struct char_char_double_s f_ret_char_char_double_s(void) {
324324
return (struct char_char_double_s){1, 2, 3.0};
325325
}
@@ -338,19 +338,19 @@ union double_u f_ret_double_u(void) {
338338
return (union double_u){1.0};
339339
}
340340

341-
// CHECK: define{{.*}} void @f_ret_double_int32_s_double_int32_s_just_sufficient_gprs(ptr noalias sret(%struct.double_int32_s) align 4 %agg.result, i32 noundef %a, i32 noundef %b, i32 noundef %c, i32 noundef %d, i32 noundef %e, i32 noundef %f, i32 noundef %g, [3 x i32] %h.coerce)
341+
// CHECK: define{{.*}} void @f_ret_double_int32_s_double_int32_s_just_sufficient_gprs(ptr dead_on_unwind noalias writable sret(%struct.double_int32_s) align 4 %agg.result, i32 noundef %a, i32 noundef %b, i32 noundef %c, i32 noundef %d, i32 noundef %e, i32 noundef %f, i32 noundef %g, [3 x i32] %h.coerce)
342342
struct double_int32_s f_ret_double_int32_s_double_int32_s_just_sufficient_gprs(
343343
int a, int b, int c, int d, int e, int f, int g, struct double_int32_s h) {
344344
return (struct double_int32_s){1.0, 2};
345345
}
346346

347-
// CHECK: define{{.*}} void @f_ret_double_double_s_double_int32_s_just_sufficient_gprs(ptr noalias sret(%struct.double_double_s) align 4 %agg.result, i32 noundef %a, i32 noundef %b, i32 noundef %c, i32 noundef %d, i32 noundef %e, i32 noundef %f, i32 noundef %g, [3 x i32] %h.coerce)
347+
// CHECK: define{{.*}} void @f_ret_double_double_s_double_int32_s_just_sufficient_gprs(ptr dead_on_unwind noalias writable sret(%struct.double_double_s) align 4 %agg.result, i32 noundef %a, i32 noundef %b, i32 noundef %c, i32 noundef %d, i32 noundef %e, i32 noundef %f, i32 noundef %g, [3 x i32] %h.coerce)
348348
struct double_double_s f_ret_double_double_s_double_int32_s_just_sufficient_gprs(
349349
int a, int b, int c, int d, int e, int f, int g, struct double_int32_s h) {
350350
return (struct double_double_s){1.0, 2.0};
351351
}
352352

353-
// CHECK: define{{.*}} void @f_ret_doublecomplex_double_int32_s_just_sufficient_gprs(ptr noalias sret({ double, double }) align 4 %agg.result, i32 noundef %a, i32 noundef %b, i32 noundef %c, i32 noundef %d, i32 noundef %e, i32 noundef %f, i32 noundef %g, [3 x i32] %h.coerce)
353+
// CHECK: define{{.*}} void @f_ret_doublecomplex_double_int32_s_just_sufficient_gprs(ptr dead_on_unwind noalias writable sret({ double, double }) align 4 %agg.result, i32 noundef %a, i32 noundef %b, i32 noundef %c, i32 noundef %d, i32 noundef %e, i32 noundef %f, i32 noundef %g, [3 x i32] %h.coerce)
354354
double __complex__ f_ret_doublecomplex_double_int32_s_just_sufficient_gprs(
355355
int a, int b, int c, int d, int e, int f, int g, struct double_int32_s h) {
356356
return 1.0;
@@ -376,7 +376,7 @@ struct large {
376376
// the presence of large return values that consume a register due to the need
377377
// to pass a pointer.
378378

379-
// CHECK-LABEL: define{{.*}} void @f_scalar_stack_2(ptr noalias sret(%struct.large) align 4 %agg.result, float noundef %a, i64 noundef %b, double noundef %c, double noundef %d, i8 noundef zeroext %e, i8 noundef signext %f, i8 noundef zeroext %g)
379+
// CHECK-LABEL: define{{.*}} void @f_scalar_stack_2(ptr dead_on_unwind noalias writable sret(%struct.large) align 4 %agg.result, float noundef %a, i64 noundef %b, double noundef %c, double noundef %d, i8 noundef zeroext %e, i8 noundef signext %f, i8 noundef zeroext %g)
380380
struct large f_scalar_stack_2(float a, int64_t b, double c, long double d,
381381
uint8_t e, int8_t f, uint8_t g) {
382382
return (struct large){a, e, f, g};

0 commit comments

Comments
 (0)