[llvm] 3c621b1 - [MSP430] Use getSignedTargetConstant()

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 22 04:06:44 PST 2024


Author: Nikita Popov
Date: 2024-11-22T13:06:33+01:00
New Revision: 3c621b1e2069d7853ebd849b0dd796bea5f732bf

URL: https://github.com/llvm/llvm-project/commit/3c621b1e2069d7853ebd849b0dd796bea5f732bf
DIFF: https://github.com/llvm/llvm-project/commit/3c621b1e2069d7853ebd849b0dd796bea5f732bf.diff

LOG: [MSP430] Use getSignedTargetConstant()

The displacement is signed.

Added: 
    

Modified: 
    llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp b/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp
index 4338fc3c6ebba4..85ebe71fa967d2 100644
--- a/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp
+++ b/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp
@@ -278,7 +278,7 @@ bool MSP430DAGToDAGISel::SelectAddr(SDValue N,
     Disp = CurDAG->getTargetBlockAddress(AM.BlockAddr, MVT::i32, 0,
                                          0/*AM.SymbolFlags*/);
   else
-    Disp = CurDAG->getTargetConstant(AM.Disp, SDLoc(N), MVT::i16);
+    Disp = CurDAG->getSignedTargetConstant(AM.Disp, SDLoc(N), MVT::i16);
 
   return true;
 }


        


More information about the llvm-commits mailing list