[llvm] 246c236 - [ConstantFolding] Use getSigned()

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 12 07:37:54 PDT 2024


Author: Nikita Popov
Date: 2024-08-12T16:37:42+02:00
New Revision: 246c236ff9761920f5098878aba651e2112618bf

URL: https://github.com/llvm/llvm-project/commit/246c236ff9761920f5098878aba651e2112618bf
DIFF: https://github.com/llvm/llvm-project/commit/246c236ff9761920f5098878aba651e2112618bf.diff

LOG: [ConstantFolding] Use getSigned()

Split out from https://github.com/llvm/llvm-project/pull/80309.

Added: 
    

Modified: 
    llvm/lib/Analysis/ConstantFolding.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp
index 084647b1d9d93..defcacdfa8b10 100644
--- a/llvm/lib/Analysis/ConstantFolding.cpp
+++ b/llvm/lib/Analysis/ConstantFolding.cpp
@@ -3400,8 +3400,9 @@ ConstantFoldScalarFrexpCall(Constant *Op, Type *IntTy) {
 
   // The exponent is an "unspecified value" for inf/nan. We use zero to avoid
   // using undef.
-  Constant *Result1 = FrexpMant.isFinite() ? ConstantInt::get(IntTy, FrexpExp)
-                                           : ConstantInt::getNullValue(IntTy);
+  Constant *Result1 = FrexpMant.isFinite()
+                          ? ConstantInt::getSigned(IntTy, FrexpExp)
+                          : ConstantInt::getNullValue(IntTy);
   return {Result0, Result1};
 }
 


        


More information about the llvm-commits mailing list