-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
[SystemZ] Test improvements for atomic load/store instructions (NFC). #75630
Conversation
The IR specs say: "align must be explicitly specified on atomic loads, and the load has undefined behavior if the alignment is not set to a value which is at least the size in bytes of the pointee" -- given that, does it really make sense to add test cases that are undefined IR according to the spec? |
Ahh.. maybe not. Maybe then AtomicExpand should not even emit libcalls, but rather assert and abort? It seems that AtomicExpand decides to handle the unaligned cases with libcall:
SelectionDAGBuilder however rejects this:
So with the notion of supporting unaligned atomics, it's a little unclear to me as indeed the spec says " the load has undefined behavior if the alignment is not set to a value which is at least the size in bytes of the pointee." If there is library support for the unaligned cases, I guess the libcalls should be allowed. If not, the libcalls should not get emitted by AtomicExpand. |
8163bb9
to
62bb1e7
Compare
Per our discussion, I reverted the previous test changes for <=64 bits, but updated the 128-bit tests as they actually should have been changed with c568927, since the default alignment for _Atomic long double is now 16 bytes, right? |
Yes; the non-size-specialized |
I made a suggestion here for the spec: #75871 |
Let's wait until we have agreement whether or not misaligned atomic load/store is supposed to be supported at the IR level. If yes, we should test the relevant cases for us: which would mean both 8-byte and 16-byte aligned 128-bit accesses. Also, the related test case improvement from #75879 should be pulled in here: missing checks for serialization, test all 128-bit operations on both z10 and z13. |
Make sure to test atomic load and store instructions with and w/out natural alignment.
62bb1e7
to
b0a0e6a
Compare
Now that the spec was updated (#75871), I have updated the tests here again per previous discussion. |
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.
LGTM, thanks!
Make sure to test atomic load and store instructions with and w/out natural alignment.