[llvm] 123d4d9 - [AMGGPUInstCombine] Use getSigned() for frexp exponent

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 12 02:15:59 PST 2025


Author: Nikita Popov
Date: 2025-12-12T11:15:45+01:00
New Revision: 123d4d9b85e090a7e75e256a80a146ffcc8ac5c3

URL: https://github.com/llvm/llvm-project/commit/123d4d9b85e090a7e75e256a80a146ffcc8ac5c3
DIFF: https://github.com/llvm/llvm-project/commit/123d4d9b85e090a7e75e256a80a146ffcc8ac5c3.diff

LOG: [AMGGPUInstCombine] Use getSigned() for frexp exponent

It may be negative.

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp b/llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp
index 47926734d64d4..f7c4d739ac990 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp
@@ -788,7 +788,8 @@ GCNTTIImpl::instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) const {
       if (Exp == APFloat::IEK_NaN || Exp == APFloat::IEK_Inf)
         Exp = 0;
 
-      return IC.replaceInstUsesWith(II, ConstantInt::get(II.getType(), Exp));
+      return IC.replaceInstUsesWith(II,
+                                    ConstantInt::getSigned(II.getType(), Exp));
     }
 
     if (isa<PoisonValue>(Src))


        


More information about the llvm-commits mailing list