Skip to content

[LLVM21] codegen/align.d these are now memcpy'd and captures(none)#5004

Closed
thewilsonator wants to merge 2 commits intoldc-developers:masterfrom
thewilsonator:thewilsonator-patch-7
Closed

[LLVM21] codegen/align.d these are now memcpy'd and captures(none)#5004
thewilsonator wants to merge 2 commits intoldc-developers:masterfrom
thewilsonator:thewilsonator-patch-7

Conversation

@thewilsonator
Copy link
Copy Markdown
Contributor

No description provided.

/* 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)}}
Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Member

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)

@thewilsonator
Copy link
Copy Markdown
Contributor Author

Fix is 158a8f0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants