[DAG] SimplifyVBinOp - replace FoldConstantVectorArithmetic with FoldConstantArithmetic
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 5 Nov 2021 14:59:14 +0000 (14:59 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sun, 7 Nov 2021 12:11:46 +0000 (12:11 +0000)
Currently FoldConstantArithmetic only handles binops, so replacing other uses of FoldConstantVectorArithmetic (in particular for SETCC nodes), still require more work.

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

index 07a2ac8..d01e3b3 100644 (file)
@@ -22308,8 +22308,8 @@ SDValue DAGCombiner::SimplifyVBinOp(SDNode *N) {
   SDNodeFlags Flags = N->getFlags();
 
   // See if we can constant fold the vector operation.
-  if (SDValue Fold = DAG.FoldConstantVectorArithmetic(Opcode, SDLoc(LHS),
-                                                      LHS.getValueType(), Ops))
+  if (SDValue Fold = DAG.FoldConstantArithmetic(Opcode, SDLoc(LHS),
+                                                LHS.getValueType(), Ops))
     return Fold;
 
   // Move unary shuffles with identical masks after a vector binop: