[llvm] [SelectionDAG] Pass LoadExtType when ATOMIC_LOAD is created. (PR #136653)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 21 22:44:24 PDT 2025


================
@@ -8992,12 +8992,13 @@ SDValue SelectionDAG::getAtomicMemset(SDValue Chain, const SDLoc &dl,
 
 SDValue SelectionDAG::getAtomic(unsigned Opcode, const SDLoc &dl, EVT MemVT,
                                 SDVTList VTList, ArrayRef<SDValue> Ops,
-                                MachineMemOperand *MMO) {
+                                MachineMemOperand *MMO,
+                                ISD::LoadExtType ExtType) {
   FoldingSetNodeID ID;
   AddNodeIDNode(ID, Opcode, VTList, Ops);
   ID.AddInteger(MemVT.getRawBits());
   ID.AddInteger(getSyntheticNodeSubclassData<AtomicSDNode>(
-      Opcode, dl.getIROrder(), VTList, MemVT, MMO));
+      dl.getIROrder(), Opcode, VTList, MemVT, MMO, ExtType));
----------------
topperc wrote:

I had to move `Opcode` later so that the variadic template version of `getSyntheticNodeSubclassData` would work. Previously we the other signature that hardcodes that arguments as Opcode, Order, VTList, MemVT, and MMO. The extra ExtType made the hardcoded signature not match.

Changing the operand order seemed better than adding another signature with a hardcoded argument list.

https://github.com/llvm/llvm-project/pull/136653


More information about the llvm-commits mailing list