[llvm] [ExpandLargeFpConvert] Fix incorrect value in fp-to-int conversion. (PR #86514)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 26 01:04:15 PDT 2024
================
@@ -176,8 +176,8 @@ static void expandFPToI(Instruction *FPToI) {
Builder.SetInsertPoint(IfEnd);
Value *Add1 = Builder.CreateAdd(
And2, ConstantInt::getSigned(IntTy, -int64_t(ExponentBias + BitWidth)));
- Value *Cmp3 =
- Builder.CreateICmpULT(Add1, ConstantInt::getSigned(IntTy, -BitWidth));
+ Value *Cmp3 = Builder.CreateICmpULT(
+ Add1, ConstantInt::getSigned(IntTy, -int64_t(BitWidth)));
----------------
arsenm wrote:
Prefer using static_cast<int64_t>
https://github.com/llvm/llvm-project/pull/86514
More information about the llvm-commits
mailing list