[llvm] 6960b63 - [LSR] Use getSigned() for negated immediate

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 9 07:19:45 PST 2025


Author: Nikita Popov
Date: 2025-12-09T16:19:36+01:00
New Revision: 6960b633ee7633d0ed7e9853baea296dbe201ab2

URL: https://github.com/llvm/llvm-project/commit/6960b633ee7633d0ed7e9853baea296dbe201ab2
DIFF: https://github.com/llvm/llvm-project/commit/6960b633ee7633d0ed7e9853baea296dbe201ab2.diff

LOG: [LSR] Use getSigned() for negated immediate

Added: 
    

Modified: 
    llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 63b228efe3b11..68cffd4c18688 100644
--- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -5805,7 +5805,7 @@ Value *LSRInstance::Expand(const LSRUse &LU, const LSRFixup &LF,
       // negated immediate.
       if (!ICmpScaledV)
         ICmpScaledV =
-            ConstantInt::get(IntTy, -(uint64_t)Offset.getFixedValue());
+            ConstantInt::getSigned(IntTy, -(uint64_t)Offset.getFixedValue());
       else {
         Ops.push_back(SE.getUnknown(ICmpScaledV));
         ICmpScaledV = ConstantInt::get(IntTy, Offset.getFixedValue());


        


More information about the llvm-commits mailing list