diff options
author | Duncan Sands <baldrick@free.fr> | 2008-03-12 20:30:08 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2008-03-12 20:30:08 +0000 |
commit | 25eb043759c23b61769108f78382eb9701c41db2 (patch) | |
tree | 4007f1c5e0c4cb5943b61789e30d2beeb7274432 /lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | 58d74910c6b82e622ecbb57d6644d48fec5a5c0f (diff) |
Don't try to extract an i32 from an f64. This
getCopyToParts problem was noticed by the new
LegalizeTypes infrastructure. In order to avoid
this kind of thing in the future I've added a
check that EXTRACT_ELEMENT is only used with
integers. Once LegalizeTypes is up and running
most likely BUILD_PAIR and EXTRACT_ELEMENT can
be removed, in favour of using apints instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48294 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 6e15318a16..03ca532787 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -2090,13 +2090,17 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT, break; case ISD::EXTRACT_ELEMENT: assert(N2C && (unsigned)N2C->getValue() < 2 && "Bad EXTRACT_ELEMENT!"); - + assert(!MVT::isVector(N1.getValueType()) && + MVT::isInteger(N1.getValueType()) && + !MVT::isVector(VT) && MVT::isInteger(VT) && + "EXTRACT_ELEMENT only applies to integers!"); + // EXTRACT_ELEMENT of BUILD_PAIR is often formed while legalize is expanding // 64-bit integers into 32-bit parts. Instead of building the extract of // the BUILD_PAIR, only to have legalize rip it apart, just do it now. if (N1.getOpcode() == ISD::BUILD_PAIR) return N1.getOperand(N2C->getValue()); - + // EXTRACT_ELEMENT of a constant int is also very common. if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(N1)) { unsigned Shift = MVT::getSizeInBits(VT) * N2C->getValue(); |