diff options
author | Craig Topper <craig.topper@sifive.com> | 2025-07-22 08:06:30 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-22 08:06:30 -0700 |
commit | 8d549cf036b6facf455b9add2d878012dfeb3d0d (patch) | |
tree | 68fc5ba9bfee5f9f87cb4f2ba577896c5a9a35fc /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | d5099722e8ae0972a4a95927cb8ed415eda17298 (diff) | |
download | llvm-8d549cf036b6facf455b9add2d878012dfeb3d0d.zip llvm-8d549cf036b6facf455b9add2d878012dfeb3d0d.tar.gz llvm-8d549cf036b6facf455b9add2d878012dfeb3d0d.tar.bz2 |
[SelectionDAG] Pass SDNodeFlags through getNode instead of setFlags. (#149852)
getNode updates flags correctly for CSE. Calling setFlags after getNode
may set the flags where they don't apply.
I've added a Flags argument to getSelectCC and the signature of getNode that takes
an ArrayRef of EVTs.
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index e1f2e95..e471d22 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -10695,7 +10695,16 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT, SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, ArrayRef<EVT> ResultTys, ArrayRef<SDValue> Ops) { - return getNode(Opcode, DL, getVTList(ResultTys), Ops); + SDNodeFlags Flags; + if (Inserter) + Flags = Inserter->getFlags(); + return getNode(Opcode, DL, getVTList(ResultTys), Ops, Flags); +} + +SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, + ArrayRef<EVT> ResultTys, ArrayRef<SDValue> Ops, + const SDNodeFlags Flags) { + return getNode(Opcode, DL, getVTList(ResultTys), Ops, Flags); } SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList, |