summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-03-24 02:20:47 +0000
committerChris Lattner <sabre@nondot.org>2006-03-24 02:20:47 +0000
commit6b05290922db6ca1a5335d3afa5721e1b5d5e5b6 (patch)
tree97d2bba0802f76a853bf3d5eb2d1b26f535e9f96 /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parentf80d2289e9a210f75721bab1f2c7fb23bf2597d1 (diff)
downloadbcm5719-llvm-6b05290922db6ca1a5335d3afa5721e1b5d5e5b6.tar.gz
bcm5719-llvm-6b05290922db6ca1a5335d3afa5721e1b5d5e5b6.zip
fix some bogus assertions: noop bitconverts are legal
llvm-svn: 27032
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 13a262508e0..97b4095fcf9 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -956,13 +956,10 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
case ISD::SINT_TO_FP: return getConstantFP(C->getSignExtended(), VT);
case ISD::UINT_TO_FP: return getConstantFP(C->getValue(), VT);
case ISD::BIT_CONVERT:
- if (VT == MVT::f32) {
- assert(C->getValueType(0) == MVT::i32 && "Invalid bit_convert!");
+ if (VT == MVT::f32 && C->getValueType(0) == MVT::i32)
return getConstantFP(BitsToFloat(Val), VT);
- } else if (VT == MVT::f64) {
- assert(C->getValueType(0) == MVT::i64 && "Invalid bit_convert!");
+ else if (VT == MVT::f64 && C->getValueType(0) == MVT::i64)
return getConstantFP(BitsToDouble(Val), VT);
- }
break;
case ISD::BSWAP:
switch(VT) {
@@ -1035,13 +1032,10 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
case ISD::FP_TO_UINT:
return getConstant((uint64_t)C->getValue(), VT);
case ISD::BIT_CONVERT:
- if (VT == MVT::i32) {
- assert(C->getValueType(0) == MVT::f32 && "Invalid bit_convert!");
+ if (VT == MVT::i32 && C->getValueType(0) == MVT::f32)
return getConstant(FloatToBits(C->getValue()), VT);
- } else if (VT == MVT::i64) {
- assert(C->getValueType(0) == MVT::f64 && "Invalid bit_convert!");
+ else if (VT == MVT::i64 && C->getValueType(0) == MVT::f64)
return getConstant(DoubleToBits(C->getValue()), VT);
- }
break;
}
OpenPOWER on IntegriCloud