diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp index 80d34f6f16c2..2287f20086c9 100644 --- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -697,7 +697,7 @@ static bool useSIToFPInst(ConstantFP &InitV, ConstantFP &ExitV, // If the iteration range can be handled by SIToFPInst then use it. APInt Max = APInt::getSignedMaxValue(32); - if (Max.getZExtValue() > static_cast(abs(intEV - intIV))) + if (Max.getZExtValue() > static_cast(abs64(intEV - intIV))) return true; return false;