From 469bb59e0b42ae20e227113679bf5ae75e90d3f9 Mon Sep 17 00:00:00 2001 From: David Bolvansky Date: Tue, 2 Jul 2019 21:16:34 +0000 Subject: [PATCH] [NFC] Strenghten isInteger condition for rL364940 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364969 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/SimplifyLibCalls.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Transforms/Utils/SimplifyLibCalls.cpp b/lib/Transforms/Utils/SimplifyLibCalls.cpp index 79b1b862e65..54961f375d8 100644 --- a/lib/Transforms/Utils/SimplifyLibCalls.cpp +++ b/lib/Transforms/Utils/SimplifyLibCalls.cpp @@ -1543,8 +1543,9 @@ Value *LibCallSimplifier::optimizePow(CallInst *Pow, IRBuilder<> &B) { 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); } -- 2.50.1