[llvm] r250616 - [DAG] Ensure vector constant folding uses correct scalar undef types

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 17 09:49:43 PDT 2015


Author: rksimon
Date: Sat Oct 17 11:49:43 2015
New Revision: 250616

URL: http://llvm.org/viewvc/llvm-project?rev=250616&view=rev
Log:
[DAG] Ensure vector constant folding uses correct scalar undef types

Minor fix to D13665 found during post-commit review.


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

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=250616&r1=250615&r2=250616&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Sat Oct 17 11:49:43 2015
@@ -3321,11 +3321,11 @@ SDValue SelectionDAG::FoldConstantVector
   for (unsigned i = 0; i != NumElts; i++) {
     SmallVector<SDValue, 4> ScalarOps;
     for (SDValue Op : Ops) {
-      EVT InSVT = Op->getValueType(0).getScalarType();
+      EVT InSVT = Op.getValueType().getScalarType();
       BuildVectorSDNode *InBV = dyn_cast<BuildVectorSDNode>(Op);
       if (!InBV) {
         // We've checked that this is UNDEF above.
-        ScalarOps.push_back(getUNDEF(LegalSVT));
+        ScalarOps.push_back(getUNDEF(InSVT));
         continue;
       }
 




More information about the llvm-commits mailing list