[llvm] 497382e - [SelectionDAG] Make the FoldingSet profile in getAtomic match AddNodeIDCustom. (#136651)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 21 22:39:35 PDT 2025
Author: Craig Topper
Date: 2025-04-21T22:39:31-07:00
New Revision: 497382ee07100f3698621fc48b66a0bd50a1ca2a
URL: https://github.com/llvm/llvm-project/commit/497382ee07100f3698621fc48b66a0bd50a1ca2a
DIFF: https://github.com/llvm/llvm-project/commit/497382ee07100f3698621fc48b66a0bd50a1ca2a.diff
LOG: [SelectionDAG] Make the FoldingSet profile in getAtomic match AddNodeIDCustom. (#136651)
In theory, the mismatch would have made CSE of AtomicSDNodes not work,
but I don't know how to test it.
Added:
Modified:
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index ba6c5d884d381..5269962ea2062 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -8994,8 +8994,10 @@ SDValue SelectionDAG::getAtomic(unsigned Opcode, const SDLoc &dl, EVT MemVT,
SDVTList VTList, ArrayRef<SDValue> Ops,
MachineMemOperand *MMO) {
FoldingSetNodeID ID;
- ID.AddInteger(MemVT.getRawBits());
AddNodeIDNode(ID, Opcode, VTList, Ops);
+ ID.AddInteger(MemVT.getRawBits());
+ ID.AddInteger(getSyntheticNodeSubclassData<AtomicSDNode>(
+ Opcode, dl.getIROrder(), VTList, MemVT, MMO));
ID.AddInteger(MMO->getPointerInfo().getAddrSpace());
ID.AddInteger(MMO->getFlags());
void* IP = nullptr;
More information about the llvm-commits
mailing list