[llvm] 0167a92 - [RISCV] Use unsigned instead of int64_t for two small positive shift amounts. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 30 13:15:15 PDT 2024


Author: Craig Topper
Date: 2024-10-30T13:10:55-07:00
New Revision: 0167a92e28d5c8eac00595300a1366bdce28678d

URL: https://github.com/llvm/llvm-project/commit/0167a92e28d5c8eac00595300a1366bdce28678d
DIFF: https://github.com/llvm/llvm-project/commit/0167a92e28d5c8eac00595300a1366bdce28678d.diff

LOG: [RISCV] Use unsigned instead of int64_t for two small positive shift amounts. NFC

Added: 
    

Modified: 
    llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp b/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
index dc3f8254cb4e00..6291842e071a3e 100644
--- a/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
@@ -693,7 +693,7 @@ bool RISCVDAGToDAGISel::tryIndexedLoad(SDNode *Node) {
 
   // The constants that can be encoded in the THeadMemIdx instructions
   // are of the form (sign_extend(imm5) << imm2).
-  int64_t Shift;
+  unsigned Shift;
   for (Shift = 0; Shift < 4; Shift++)
     if (isInt<5>(Offset >> Shift) && ((Offset % (1LL << Shift)) == 0))
       break;
@@ -3366,7 +3366,7 @@ bool RISCVDAGToDAGISel::selectSimm5Shl2(SDValue N, SDValue &Simm5,
                                         SDValue &Shl2) {
   if (auto *C = dyn_cast<ConstantSDNode>(N)) {
     int64_t Offset = C->getSExtValue();
-    int64_t Shift;
+    unsigned Shift;
     for (Shift = 0; Shift < 4; Shift++)
       if (isInt<5>(Offset >> Shift) && ((Offset % (1LL << Shift)) == 0))
         break;


        


More information about the llvm-commits mailing list