[llvm-commits] CVS: llvm/lib/Transforms/ExprTypeConvert.cpp

Chris Lattner lattner at cs.uiuc.edu
Tue Sep 10 14:43:05 PDT 2002


Changes in directory llvm/lib/Transforms:

ExprTypeConvert.cpp updated: 1.53 -> 1.54

---
Log message:

Fix bug: test/Regression/Transforms/LevelRaise/2002-09-10-PointerAdds.ll


---
Diffs of the changes:

Index: llvm/lib/Transforms/ExprTypeConvert.cpp
diff -u llvm/lib/Transforms/ExprTypeConvert.cpp:1.53 llvm/lib/Transforms/ExprTypeConvert.cpp:1.54
--- llvm/lib/Transforms/ExprTypeConvert.cpp:1.53	Tue Sep 10 12:02:54 2002
+++ llvm/lib/Transforms/ExprTypeConvert.cpp	Tue Sep 10 14:42:53 2002
@@ -177,6 +177,7 @@
 
   case Instruction::Add:
   case Instruction::Sub:
+    if (!Ty->isInteger() && !Ty->isFloatingPoint()) return false;
     if (!ExpressionConvertableToType(I->getOperand(0), Ty, CTMap) ||
         !ExpressionConvertableToType(I->getOperand(1), Ty, CTMap))
       return false;
@@ -610,6 +611,8 @@
     }
     // FALLTHROUGH
   case Instruction::Sub: {
+    if (!Ty->isInteger() && !Ty->isFloatingPoint()) return false;
+
     Value *OtherOp = I->getOperand((V == I->getOperand(0)) ? 1 : 0);
     return ValueConvertableToType(I, Ty, CTMap) &&
            ExpressionConvertableToType(OtherOp, Ty, CTMap);





More information about the llvm-commits mailing list