[llvm] 0ff1ede - [DAG] SimplifyVBinOp - replace FoldConstantVectorArithmetic with FoldConstantArithmetic

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 7 04:44:53 PST 2021


Author: Simon Pilgrim
Date: 2021-11-07T12:11:46Z
New Revision: 0ff1edeeecc818275d685e5c5d7c0db3daa9d70a

URL: https://github.com/llvm/llvm-project/commit/0ff1edeeecc818275d685e5c5d7c0db3daa9d70a
DIFF: https://github.com/llvm/llvm-project/commit/0ff1edeeecc818275d685e5c5d7c0db3daa9d70a.diff

LOG: [DAG] SimplifyVBinOp - replace FoldConstantVectorArithmetic with FoldConstantArithmetic

Currently FoldConstantArithmetic only handles binops, so replacing other uses of FoldConstantVectorArithmetic (in particular for SETCC nodes), still require more work.

Added: 
    

Modified: 
    llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 07a2ac8db511..d01e3b3fd663 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -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:


        


More information about the llvm-commits mailing list