[llvm] a9d39ce - [RISCV][GISel] Pass APInt by const reference. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 17 11:57:56 PDT 2024


Author: Craig Topper
Date: 2024-10-17T11:55:36-07:00
New Revision: a9d39ce5d2e93e76598732e2caeaae0dbe155f1c

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

LOG: [RISCV][GISel] Pass APInt by const reference. NFC

Added: 
    

Modified: 
    llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
    llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.h

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp b/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
index d1449f751b40a0..c06ab061ddc338 100644
--- a/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
+++ b/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
@@ -670,7 +670,7 @@ bool RISCVLegalizerInfo::legalizeVAStart(MachineInstr &MI,
   return true;
 }
 
-bool RISCVLegalizerInfo::shouldBeInConstantPool(APInt APImm,
+bool RISCVLegalizerInfo::shouldBeInConstantPool(const APInt &APImm,
                                                 bool ShouldOptForSize) const {
   assert(APImm.getBitWidth() == 32 || APImm.getBitWidth() == 64);
   int64_t Imm = APImm.getSExtValue();

diff  --git a/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.h b/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.h
index d2afb175ae42bb..ee8b08bc9e3162 100644
--- a/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.h
+++ b/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.h
@@ -38,7 +38,7 @@ class RISCVLegalizerInfo : public LegalizerInfo {
                          MachineInstr &MI) const override;
 
 private:
-  bool shouldBeInConstantPool(APInt APImm, bool ShouldOptForSize) const;
+  bool shouldBeInConstantPool(const APInt &APImm, bool ShouldOptForSize) const;
   bool legalizeShlAshrLshr(MachineInstr &MI, MachineIRBuilder &MIRBuilder,
                            GISelChangeObserver &Observer) const;
 


        


More information about the llvm-commits mailing list