[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Chris Lattner lattner at cs.uiuc.edu
Thu Mar 23 18:21:00 PST 2006



Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAG.cpp updated: 1.280 -> 1.281
---
Log message:

fix some bogus assertions: noop bitconverts are legal


---
Diffs of the changes:  (+4 -10)

 SelectionDAG.cpp |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.280 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.281
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.280	Thu Mar 23 19:04:30 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp	Thu Mar 23 20:20:47 2006
@@ -956,13 +956,10 @@
     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 @@
     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;
     }
 






More information about the llvm-commits mailing list