[SelectionDAG] Strengthen assertions about usage of AtomicSDNodes
authorPhilip Reames <listmail@philipreames.com>
Thu, 28 Feb 2019 04:07:23 +0000 (04:07 +0000)
committerPhilip Reames <listmail@philipreames.com>
Thu, 28 Feb 2019 04:07:23 +0000 (04:07 +0000)
commit21020bf015aa15af503e9ae8a56314b15ee93e07
tree28de4679626f25895df54ab924c0adfba42d9500
parentb37a70f40e1229d44b967c339f65f4acfd56b0ce
[SelectionDAG] Strengthen assertions about usage of AtomicSDNodes

In D57601, I described the expectations around usage of AtomicSDNode and LoadSDNode/StoreSDNode w.r.t. atomic and volatiles. This patch simply embeds those expectations in assertions so that they can't be accidentally weakened.

Note: The reason only AtomicSDNodes of ATOMIC_LOAD and ATOMIC_STORE opcode are currently checked is that AMDGPU has an intrinsic which gets lowered to an ATOMIC_LOAD_FADD w/o a corresponding atomic MMO. This is suspicious, and I've brought it to the attention of the relevant developers. Once resolved, I'll strengthen that assertion.

Note 2: If this breaks your out-of-tree backend, go read the update instructions associated w/the previously mentioned patch. This will assert on (a subset of) things you need to update per those instructions.

Differential Revision: https://reviews.llvm.org/D58738

llvm-svn: 355069
llvm/include/llvm/CodeGen/SelectionDAGNodes.h