[llvm] 50896e7 - [ARM] Use getSignedConstant. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 30 22:05:21 PDT 2024


Author: Craig Topper
Date: 2024-10-30T21:43:16-07:00
New Revision: 50896e7ef5794a74ff91066f845d24ad664bc0dc

URL: https://github.com/llvm/llvm-project/commit/50896e7ef5794a74ff91066f845d24ad664bc0dc
DIFF: https://github.com/llvm/llvm-project/commit/50896e7ef5794a74ff91066f845d24ad664bc0dc.diff

LOG: [ARM] Use getSignedConstant. NFC

Added: 
    

Modified: 
    llvm/lib/Target/ARM/ARMISelLowering.cpp
    llvm/lib/Target/ARM/ARMInstrThumb2.td

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp
index a98b7a8420927e..e0022190d87c18 100644
--- a/llvm/lib/Target/ARM/ARMISelLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp
@@ -6051,7 +6051,7 @@ static SDValue LowerFP_TO_INT_SAT(SDValue Op, SelectionDAG &DAG,
                             DAG.getConstant((1 << BW) - 1, DL, VT));
   if (IsSigned)
     Max = DAG.getNode(ISD::SMAX, DL, VT, Max,
-                      DAG.getConstant(-(1 << BW), DL, VT));
+                      DAG.getSignedConstant(-(1 << BW), DL, VT));
   return Max;
 }
 

diff  --git a/llvm/lib/Target/ARM/ARMInstrThumb2.td b/llvm/lib/Target/ARM/ARMInstrThumb2.td
index 61635bd1629eb8..cb20aacb539ad9 100644
--- a/llvm/lib/Target/ARM/ARMInstrThumb2.td
+++ b/llvm/lib/Target/ARM/ARMInstrThumb2.td
@@ -77,8 +77,8 @@ def t2_so_imm_not_XFORM : SDNodeXForm<imm, [{
 
 // t2_so_imm_neg_XFORM - Return the negation of a t2_so_imm value
 def t2_so_imm_neg_XFORM : SDNodeXForm<imm, [{
-  return CurDAG->getTargetConstant(-((int)N->getZExtValue()), SDLoc(N),
-                                   MVT::i32);
+  return CurDAG->getSignedConstant(-((int)N->getZExtValue()), SDLoc(N),
+                                   MVT::i32, /*isTarget=*/true);
 }]>;
 
 // so_imm_notSext_XFORM - Return a so_imm value packed into the format


        


More information about the llvm-commits mailing list