-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[SystemZ] WRONG code with packed struct with bitfield members. #81417
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
Comments
I think this is related SystemZ handling of i128, after all. In SystemZTargetLowering::LowerCall() there is a special handling ("// Allocate the full stack space for a promoted (and split) argument."), that checks explicitly for an argument occupying two registers. So with -EC12, that handling takes action as the argument is split, but with vector and legal i128 it does not as there is only one part. |
Hi @JonPsson1 I think this line at https://github.com/llvm/llvm-project/blob/7f3980a7b2c9f95ab3b106a94fe6e63158155b0b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp#L1926C1-L1926C32:
is simply wrong. It should be Can you try out and test that change? Thanks! |
When an integer argument is promoted and *not* split (like i72 -> i128 on a new machine with vector support), the SlotVT should be i128, which is stored in VT - not ArgVT. Fixes #81417
When an integer argument is promoted and *not* split (like i72 -> i128 on a new machine with vector support), the SlotVT should be i128, which is stored in VT - not ArgVT. Fixes llvm#81417 (cherry picked from commit 9c0e45d)
When an integer argument is promoted and *not* split (like i72 -> i128 on a new machine with vector support), the SlotVT should be i128, which is stored in VT - not ArgVT. Fixes llvm#81417 (cherry picked from commit 9c0e45d)
This program uses struct bitfields, where the first one is 4 bytes of padding, and should print 2:
With packed structs it however prints 0:
The argument to @func_5 has a size of 9, but 16 bytes are stored, which looks wrong. The i72 is rounded up to i128, which seems counterproductive in regards to the packing. In any case the frame object size must match. Should an i72 struct that is packed maybe be split instead of promoted?
In the output, the vst overwrites the mvi...
tc_packedstructbitfields.tar.gz
llc -mtriple=s390x-linux-gnu -mcpu=z16 -O3 tc_packedstructbitfields.ll
@uweigand
The text was updated successfully, but these errors were encountered: