This is an archive of the discontinued LLVM Phabricator instance.

TableGen/GlobalISel: Hack the operand order for atomic_store
ClosedPublic

Authored by arsenm on Aug 3 2020, 5:21 AM.

Details

Summary

ISD::ATOMIC_STORE arbitrarily has the operands in the opposite order
from regular ISD::STORE, which always introduced an annoying
duplication of patterns to handle both cases. Since in GlobalISel
there's just the one G_STORE, we need to swap the operands to
correctly emit the type check for the pointer operand.

Some work started in 20aafa31569b5157e792daa8860d71dd0df8a53a to
migrate SelectionDAG to use ISD::STORE for atomics, but that work
seems to have stalled. Since this is the pretty much the last
operation which matters which isn't supported for AMDGPU, use this
compatibility hack to unblock declaring it functionally complete.

Not sure what's going on with the pending_phis AArch64 test. It seems
it didn't always use atomics, and I'm not sure what it was originally
testing matters anymore.

Diff Detail

Event Timeline

arsenm created this revision.Aug 3 2020, 5:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 3 2020, 5:21 AM
arsenm requested review of this revision.Aug 3 2020, 5:21 AM
foad added a subscriber: foad.Aug 10 2020, 3:15 AM
aemerson accepted this revision.Aug 10 2020, 10:29 PM
aemerson added inline comments.
llvm/test/CodeGen/AArch64/GlobalISel/arm64-fallback.ll
40

If there's no fallback here we can just delete the function.

This revision is now accepted and ready to land.Aug 10 2020, 10:29 PM