aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@sifive.com>2025-07-22 08:06:30 -0700
committerGitHub <noreply@github.com>2025-07-22 08:06:30 -0700
commit8d549cf036b6facf455b9add2d878012dfeb3d0d (patch)
tree68fc5ba9bfee5f9f87cb4f2ba577896c5a9a35fc /llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
parentd5099722e8ae0972a4a95927cb8ed415eda17298 (diff)
downloadllvm-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/TargetLowering.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 94d1b3b..f2238ef 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -8634,9 +8634,8 @@ TargetLowering::createSelectForFMINNUM_FMAXNUM(SDNode *Node,
return SDValue();
SDValue Op1 = Node->getOperand(0);
SDValue Op2 = Node->getOperand(1);
- SDValue SelCC = DAG.getSelectCC(SDLoc(Node), Op1, Op2, Op1, Op2, Pred);
- SelCC->setFlags(Node->getFlags());
- return SelCC;
+ return DAG.getSelectCC(SDLoc(Node), Op1, Op2, Op1, Op2, Pred,
+ Node->getFlags());
}
return SDValue();