[llvm] 9e00b66 - [SelectionDAG] Remove unneeded vector resize from the end of FoldConstantArithmetic. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 31 12:33:33 PDT 2021


Author: Craig Topper
Date: 2021-03-31T12:33:10-07:00
New Revision: 9e00b6660d2b6ffa83a7fb8c82fc6862d6b80c05

URL: https://github.com/llvm/llvm-project/commit/9e00b6660d2b6ffa83a7fb8c82fc6862d6b80c05
DIFF: https://github.com/llvm/llvm-project/commit/9e00b6660d2b6ffa83a7fb8c82fc6862d6b80c05.diff

LOG: [SelectionDAG] Remove unneeded vector resize from the end of FoldConstantArithmetic. NFC

There's an assert right before that makes sure the size already matches.
Earlier in this function's life, scalars and vectors shared more
code.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 8bf9410e332b0..a60610dfccf34 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -5150,9 +5150,6 @@ SDValue SelectionDAG::FoldConstantArithmetic(unsigned Opcode, const SDLoc &DL,
   assert(VT.getVectorNumElements() == Outputs.size() &&
          "Vector size mismatch!");
 
-  // We may have a vector type but a scalar result. Create a splat.
-  Outputs.resize(VT.getVectorNumElements(), Outputs.back());
-
   // Build a big vector out of the scalar elements we generated.
   return getBuildVector(VT, SDLoc(), Outputs);
 }


        


More information about the llvm-commits mailing list