Skip to content

Commit

Permalink
[SelectionDAG] Add AssertAlign to AddNodeIDCustom so that it will CSE…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
topperc committed Mar 24, 2022
1 parent bef928f commit 67eb2f1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Expand Up @@ -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
Expand Down

0 comments on commit 67eb2f1

Please sign in to comment.