SeparateConstOffsetFromGEP: Pass address space to isLegalAddressingMode
[oota-llvm.git] / lib / Transforms / Scalar / Float2Int.cpp
index 3d7457ea5dc90aa17f32351b55fc96e29c59358d..c9314229c38bd38031bbf112a1ce841beaad7c25 100644 (file)
@@ -446,7 +446,7 @@ Value *Float2Int::convert(Instruction *I, Type *ToTy) {
     } else if (Instruction *VI = dyn_cast<Instruction>(V)) {
       NewOperands.push_back(convert(VI, ToTy));
     } else if (ConstantFP *CF = dyn_cast<ConstantFP>(V)) {
-      APSInt Val(ToTy->getPrimitiveSizeInBits(), true);
+      APSInt Val(ToTy->getPrimitiveSizeInBits(), /*IsUnsigned=*/false);
       bool Exact;
       CF->getValueAPF().convertToInteger(Val,
                                          APFloat::rmNearestTiesToEven,
@@ -511,6 +511,9 @@ void Float2Int::cleanup() {
 }
 
 bool Float2Int::runOnFunction(Function &F) {
+  if (skipOptnoneFunction(F))
+    return false;
+
   DEBUG(dbgs() << "F2I: Looking at function " << F.getName() << "\n");
   // Clear out all state.
   ECs = EquivalenceClasses<Instruction*>();