[llvm] 67eb2f1 - [SelectionDAG] Add AssertAlign to AddNodeIDCustom so that it will CSE properly.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 24 09:07:01 PDT 2022
Author: Craig Topper
Date: 2022-03-24T08:59:09-07:00
New Revision: 67eb2f144e9ef9094d122076c4b976aa586ac0f3
URL: https://github.com/llvm/llvm-project/commit/67eb2f144e9ef9094d122076c4b976aa586ac0f3
DIFF: https://github.com/llvm/llvm-project/commit/67eb2f144e9ef9094d122076c4b976aa586ac0f3.diff
LOG: [SelectionDAG] Add AssertAlign to AddNodeIDCustom so that it will CSE properly.
The alignment needs to be part of the folding set hash. This is
handled by getAssertAlign when nodes are created, but needs to repeated here.
No test case as I found it as part of a very early experimental patch.
Reviewed By: spatel
Differential Revision: https://reviews.llvm.org/D122279
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 2eef18f267d33..77e6e8ac437aa 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -844,6 +844,9 @@ static void AddNodeIDCustom(FoldingSetNodeID &ID, const SDNode *N) {
ID.AddInteger(BA->getTargetFlags());
break;
}
+ case ISD::AssertAlign:
+ ID.AddInteger(cast<AssertAlignSDNode>(N)->getAlign().value());
+ break;
} // end switch (N->getOpcode())
// Target specific memory nodes could also have address spaces and flags
More information about the llvm-commits
mailing list