[CodeGen] Assert on getNode(FP_EXTEND) with a smaller dst type.
authorAhmed Bougacha <ahmed.bougacha@gmail.com>
Thu, 13 Aug 2015 01:10:29 +0000 (01:10 +0000)
committerAhmed Bougacha <ahmed.bougacha@gmail.com>
Thu, 13 Aug 2015 01:10:29 +0000 (01:10 +0000)
This would have caught the problem in r244858.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244859 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index b696c33d9f6c3590c59b43a052b3ff37d35589e2..0e3e83748a1f4d8d321e7179c6a1d4ec3bf5207b 100644 (file)
@@ -3010,6 +3010,8 @@ SDValue SelectionDAG::getNode(unsigned Opcode, SDLoc DL,
             VT.getVectorNumElements() ==
             Operand.getValueType().getVectorNumElements()) &&
            "Vector element count mismatch!");
+    assert(Operand.getValueType().bitsLT(VT) &&
+           "Invalid fpext node, dst < src!");
     if (Operand.getOpcode() == ISD::UNDEF)
       return getUNDEF(VT);
     break;