-
-
Notifications
You must be signed in to change notification settings - Fork 271
[LLVM21] codegen/align.d these are now memcpy'd and captures(none)
#5004
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,12 +21,12 @@ Outer passAndReturnOuterByVal(Outer arg) { return arg; } | |
| // CHECK-SAME: ptr {{noalias sret.*|inreg noalias}} align 32 %.sret_arg | ||
| /* How the arg is passed by value is ABI-specific, but the pointer must be aligned. | ||
| * When the argument is passed as a byte array and copied into a stack alloc, that stack alloca must be aligned. */ | ||
| // CHECK: {{(align 32 %arg|%arg = alloca %align.Outer, align 32)}} | ||
| // CHECK: {{(align 32 %arg|%arg = alloca %align.Outer, align 32|call void @llvm.memcpy)}} | ||
|
|
||
| Inner passAndReturnInnerByVal(Inner arg) { return arg; } | ||
| // CHECK: define{{.*}} void @{{.*}}_D5align23passAndReturnInnerByValFSQBh5InnerZQl | ||
| // CHECK-SAME: ptr {{noalias sret.*|inreg noalias}} align 32 %.sret_arg | ||
| // CHECK: {{(align 32 %arg|%arg = alloca %align.Inner, align 32)}} | ||
| // CHECK: {{(align 32 %arg|%arg = alloca %align.Inner, align 32|call void @llvm.memcpy)}} | ||
|
|
||
| void main() { | ||
| Outer outer; | ||
|
|
@@ -61,11 +61,11 @@ void main() { | |
| // CHECK: call{{.*}} void @{{.*}}_D5align23passAndReturnOuterByValFSQBh5OuterZQl | ||
| // CHECK-SAME: ptr {{noalias sret.*|inreg noalias}} align 32 %.sret_tmp | ||
| // The argument is either passed by aligned (optimizer hint) pointer or as an array of i32/64 and copied into an aligned stack slot inside the callee. | ||
| // CHECK-SAME: {{(align 32 %|\[[0-9]+ x i..\])}} | ||
| // CHECK-SAME: {{(align 32 .*%|\[[0-9]+ x i..\])}} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there any reason not to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because I suck at regex |
||
|
|
||
| inner = passAndReturnInnerByVal(inner); | ||
| // CHECK: call{{.*}} void @{{.*}}_D5align23passAndReturnInnerByValFSQBh5InnerZQl | ||
| // CHECK-SAME: ptr {{noalias sret.*|inreg noalias}} align 32 %.sret_tmp | ||
| // The argument is either passed by aligned (optimizer hint) pointer or as an array of i32/64 and copied into an aligned stack slot inside the callee. | ||
| // CHECK-SAME: {{(align 32 %|\[[0-9]+ x i..\])}} | ||
| // CHECK-SAME: {{(align 32 .*%|\[[0-9]+ x i..\])}} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are now memcpy'd directly instead of being alloca'd. I don't see an easy way to check the alignment here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe force the stack alloc by modifying the parameter in the function body (i.e. add some code to the test function, to disable the direct memcpy optimization)