diff options
author | Nikita Popov <npopov@redhat.com> | 2024-08-15 18:08:27 +0200 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2024-08-15 18:18:19 +0200 |
commit | afa0f53f96b5563a80fbdf8c41c8153bf8cd2685 (patch) | |
tree | 57ae2fc554494664608628d4349bf21d702bf5fa /llvm/lib/Analysis/ValueTracking.cpp | |
parent | 46fb225f3ac602970ebb8973a5376cd9216ba38f (diff) | |
download | llvm-afa0f53f96b5563a80fbdf8c41c8153bf8cd2685.zip llvm-afa0f53f96b5563a80fbdf8c41c8153bf8cd2685.tar.gz llvm-afa0f53f96b5563a80fbdf8c41c8153bf8cd2685.tar.bz2 |
[ValueTracking] Fix f16 fptosi range for large integers
We were missing the signed flag on the negative value, so the
range was incorrectly interpreted for integers larger than 64-bit.
Split out from https://github.com/llvm/llvm-project/pull/80309.
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r-- | llvm/lib/Analysis/ValueTracking.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index b6414a3..014a703 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -9671,7 +9671,7 @@ static void setLimitForFPToI(const Instruction *I, APInt &Lower, APInt &Upper) { if (!I->getOperand(0)->getType()->getScalarType()->isHalfTy()) return; if (isa<FPToSIInst>(I) && BitWidth >= 17) { - Lower = APInt(BitWidth, -65504); + Lower = APInt(BitWidth, -65504, true); Upper = APInt(BitWidth, 65505); } |