[NFC] Strenghten isInteger condition for rL364940
llvm-svn: 364969
diff --git a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
index 79b1b86..54961f3 100644
--- a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
@@ -1543,8 +1543,9 @@
APSInt IntExpo(32, /*isUnsigned=*/false);
// powf(x, C) -> powi(x, C) iff C is a constant signed integer value
- if (ExpoF->convertToInteger(IntExpo, APFloat::rmTowardZero, &Ignored) ==
- APFloat::opOK) {
+ if (ExpoF->isInteger() &&
+ ExpoF->convertToInteger(IntExpo, APFloat::rmTowardZero, &Ignored) ==
+ APFloat::opOK) {
return createPowWithIntegerExponent(
Base, ConstantInt::get(B.getInt32Ty(), IntExpo), M, B);
}