-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[SelectionDAG] Make the FoldingSet profile in getAtomic match AddNodeIDCustom. #136651
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…IDCustom. The code in AddNodeIDCustom: const AtomicSDNode *AT = cast<AtomicSDNode>(N); ID.AddInteger(AT->getMemoryVT().getRawBits()); ID.AddInteger(AT->getRawSubclassData()); ID.AddInteger(AT->getPointerInfo().getAddrSpace()); ID.AddInteger(AT->getMemOperand()->getFlags()); In theory, the mismatch would have made CSE of AtomicSDNodes not work, but I don't know how to test it.
@llvm/pr-subscribers-llvm-selectiondag Author: Craig Topper (topperc) ChangesThe code in AddNodeIDCustom: const AtomicSDNode *AT = cast<AtomicSDNode>(N); In theory, the mismatch would have made CSE of AtomicSDNodes not work, but I don't know how to test it. Full diff: https://github.com/llvm/llvm-project/pull/136651.diff 1 Files Affected:
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;
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/195/builds/7936 Here is the relevant piece of the build log for the reference
|
…IDCustom. (llvm#136651) In theory, the mismatch would have made CSE of AtomicSDNodes not work, but I don't know how to test it.
…IDCustom. (llvm#136651) In theory, the mismatch would have made CSE of AtomicSDNodes not work, but I don't know how to test it.
…IDCustom. (llvm#136651) In theory, the mismatch would have made CSE of AtomicSDNodes not work, but I don't know how to test it.
The code in AddNodeIDCustom:
const AtomicSDNode *AT = cast(N);
ID.AddInteger(AT->getMemoryVT().getRawBits());
ID.AddInteger(AT->getRawSubclassData());
ID.AddInteger(AT->getPointerInfo().getAddrSpace()); ID.AddInteger(AT->getMemOperand()->getFlags());
In theory, the mismatch would have made CSE of AtomicSDNodes not work, but I don't know how to test it.