TableGen/GlobalISel: Hack the operand order for atomic_store
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Sun, 2 Aug 2020 21:23:52 +0000 (17:23 -0400)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 11 Aug 2020 14:22:44 +0000 (10:22 -0400)
commit53f21e0fb754799fc9a7ad7243a9161e2411b51d
tree82dce123c3e2f15fc363048678c9c360d73fc7a7
parenta9795b6f639f976e2d6f690066c61f890eed534f
TableGen/GlobalISel: Hack the operand order for atomic_store

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.
llvm/include/llvm/Target/GlobalISel/SelectionDAGCompat.td
llvm/lib/Target/AMDGPU/AMDGPUGISel.td
llvm/lib/Target/AMDGPU/DSInstructions.td
llvm/test/CodeGen/AArch64/GlobalISel/arm64-fallback.ll
llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-store-atomic-flat.mir [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-store-atomic-local.mir [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-store-flat.mir
llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-store-global.mir
llvm/test/TableGen/Common/GlobalISelEmitterCommon.td
llvm/test/TableGen/GlobalISelEmitter-atomic_store.td [new file with mode: 0644]
llvm/utils/TableGen/GlobalISelEmitter.cpp