Revise my previous change 68996 as suggested by Duncan.
llvm-svn: 69607
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index be0102c..33103cb 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -2556,7 +2556,8 @@
if (Elt.getValueType() != VT) {
// If the vector element type is not legal, the BUILD_VECTOR operands
// are promoted and implicitly truncated. Make that explicit here.
- assert(Elt.getValueType() == TLI.getTypeToTransformTo(VT) &&
+ assert(VT.isInteger() && Elt.getValueType().isInteger() &&
+ VT.bitsLE(Elt.getValueType()) &&
"Bad type for BUILD_VECTOR operand");
Elt = getNode(ISD::TRUNCATE, DL, VT, Elt);
}