[llvm] dac9042 - [RISCV] Use uint64_t operations instead of APInt operations. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 5 10:37:38 PDT 2024


Author: Craig Topper
Date: 2024-08-05T10:37:04-07:00
New Revision: dac9042cc6a4dcb23e85b13232e2b233d55eda57

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

LOG: [RISCV] Use uint64_t operations instead of APInt operations. NFC

We already know the type is i64 here. Just extract the uint64_t.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
index 9ee60b9db2837..b7a1a27a0f69c 100644
--- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -15515,7 +15515,7 @@ static SDValue performSRACombine(SDNode *N, SelectionDAG &DAG,
       return SDValue();
 
     // AddC needs to have at least 32 trailing zeros.
-    if (AddC->getAPIntValue().countr_zero() < 32)
+    if (llvm::countr_zero(AddC->getZExtValue()) < 32)
       return SDValue();
 
     // All users should be a shift by constant less than or equal to 32. This
@@ -15553,7 +15553,7 @@ static SDValue performSRACombine(SDNode *N, SelectionDAG &DAG,
   // constant.
   if (AddC) {
     SDValue ShiftedAddC =
-        DAG.getConstant(AddC->getAPIntValue().lshr(32), DL, MVT::i64);
+        DAG.getConstant(AddC->getZExtValue() >> 32, DL, MVT::i64);
     if (IsAdd)
       In = DAG.getNode(ISD::ADD, DL, MVT::i64, In, ShiftedAddC);
     else


        


More information about the llvm-commits mailing list