[llvm] 5405f54 - [Lanai] Use getSignedTargetConstant() for signed immediate

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 22 05:57:42 PST 2024


Author: Nikita Popov
Date: 2024-11-22T14:57:30+01:00
New Revision: 5405f54b014666fb8fe9c981a71593e3861cb3d7

URL: https://github.com/llvm/llvm-project/commit/5405f54b014666fb8fe9c981a71593e3861cb3d7
DIFF: https://github.com/llvm/llvm-project/commit/5405f54b014666fb8fe9c981a71593e3861cb3d7.diff

LOG: [Lanai] Use getSignedTargetConstant() for signed immediate

Added: 
    

Modified: 
    llvm/lib/Target/Lanai/LanaiInstrInfo.td

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/Lanai/LanaiInstrInfo.td b/llvm/lib/Target/Lanai/LanaiInstrInfo.td
index 638b3c94d05447..6feed27b7047b1 100644
--- a/llvm/lib/Target/Lanai/LanaiInstrInfo.td
+++ b/llvm/lib/Target/Lanai/LanaiInstrInfo.td
@@ -74,7 +74,8 @@ def HI16 : SDNodeXForm<imm, [{
 }]>;
 
 def NEG : SDNodeXForm<imm, [{
-  return CurDAG->getTargetConstant(-N->getSExtValue(), SDLoc(N), MVT::i32);
+  return CurDAG->getSignedTargetConstant(-N->getSExtValue(), SDLoc(N),
+                                         MVT::i32);
 }]>;
 
 def LO21 : SDNodeXForm<imm, [{


        


More information about the llvm-commits mailing list