diff options
author | Bob Wilson <bob.wilson@apple.com> | 2009-04-20 17:27:09 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2009-04-20 17:27:09 +0000 |
commit | c885165e664f3b465403e1b6ce57ba63f57c5f0c (patch) | |
tree | 023d820d0928c026d30d9375a52de53ed3679249 /lib/CodeGen/SelectionDAG | |
parent | c4f718a3a7990a13888836902ecac034a9d6a235 (diff) | |
download | external_llvm-c885165e664f3b465403e1b6ce57ba63f57c5f0c.zip external_llvm-c885165e664f3b465403e1b6ce57ba63f57c5f0c.tar.gz external_llvm-c885165e664f3b465403e1b6ce57ba63f57c5f0c.tar.bz2 |
Revise my previous change 68996 as suggested by Duncan.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69607 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG')
-rw-r--r-- | lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 8 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp | 3 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 3 |
3 files changed, 5 insertions, 9 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index d1ef081..72b3e36 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -3811,12 +3811,8 @@ ConstantFoldBIT_CONVERTofBUILD_VECTOR(SDNode *BV, MVT DstEltVT) { SDValue Op = BV->getOperand(i); // If the vector element type is not legal, the BUILD_VECTOR operands // are promoted and implicitly truncated. Make that explicit here. - if (Op.getValueType() != SrcEltVT) { - if (Op.getOpcode() == ISD::UNDEF) - Op = DAG.getUNDEF(SrcEltVT); - else - Op = DAG.getNode(ISD::TRUNCATE, BV->getDebugLoc(), SrcEltVT, Op); - } + if (Op.getValueType() != SrcEltVT) + Op = DAG.getNode(ISD::TRUNCATE, BV->getDebugLoc(), SrcEltVT, Op); Ops.push_back(DAG.getNode(ISD::BIT_CONVERT, BV->getDebugLoc(), DstEltVT, Op)); AddToWorkList(Ops.back().getNode()); diff --git a/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp index 2dfe0e3..b258113 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp @@ -808,9 +808,8 @@ SDValue DAGTypeLegalizer::PromoteIntOp_BUILD_VECTOR(SDNode *N) { "Type of inserted value narrower than vector element type!"); SmallVector<SDValue, 16> NewOps; - for (unsigned i = 0; i < NumElts; ++i) { + for (unsigned i = 0; i < NumElts; ++i) NewOps.push_back(GetPromotedInteger(N->getOperand(i))); - } return DAG.UpdateNodeOperands(SDValue(N, 0), &NewOps[0], NumElts); } diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index be0102c..33103cb 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -2556,7 +2556,8 @@ SDValue SelectionDAG::getNode(unsigned Opcode, DebugLoc DL, MVT VT, 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); } |