Fix based on post-commit comment on D7816 & rL230177 - BUILD_VECTOR operand truncatio...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 23 Feb 2015 23:04:28 +0000 (23:04 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 23 Feb 2015 23:04:28 +0000 (23:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230278 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/DAGCombiner.cpp

index 1f98fde13a89b0f54946a85f009842c99fbcb8af..fecbe9fec8dfc8a6fa565f7756e4868df01ae09b 100644 (file)
@@ -11447,10 +11447,11 @@ SDValue DAGCombiner::visitCONCAT_VECTORS(SDNode *N) {
     if (!SVT.isFloatingPoint())
       // If BUILD_VECTOR are from built from integer, they may have different
       // operand types. Get the smaller type and truncate all operands to it.
-      for (const SDValue &Op : N->ops()) {
-        EVT OpSVT = Op.getValueType().getScalarType();
-        MinVT = MinVT.bitsLE(OpSVT) ? MinVT : OpSVT;
-      }
+      for (const SDValue &Op : N->ops())
+        if (ISD::BUILD_VECTOR == Op.getOpcode()) {
+          EVT OpSVT = Op.getOperand(0)->getValueType(0);
+          MinVT = MinVT.bitsLE(OpSVT) ? MinVT : OpSVT;
+        }
 
     for (const SDValue &Op : N->ops()) {
       EVT OpVT = Op.getValueType();