[llvm] c97a8e4 - [AMDGPU] Remove unneed static_cast from GCNSubtarget constructor. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 10 12:54:38 PDT 2024


Author: Craig Topper
Date: 2024-07-10T12:54:17-07:00
New Revision: c97a8e4bcf6f11d87c7137a4c31c468299687420

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

LOG: [AMDGPU] Remove unneed static_cast from GCNSubtarget constructor. NFC

RegBankInfo is a std::unique_ptr<AMDGPURegisterBankInfo> so we don't
need the cast.

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp b/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp
index b46adb9f1a0b3..21fe1bc31a27e 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp
@@ -199,8 +199,7 @@ GCNSubtarget::GCNSubtarget(const Triple &TT, StringRef GPU, StringRef FS,
   InlineAsmLoweringInfo.reset(new InlineAsmLowering(getTargetLowering()));
   Legalizer.reset(new AMDGPULegalizerInfo(*this, TM));
   RegBankInfo.reset(new AMDGPURegisterBankInfo(*this));
-  InstSelector.reset(new AMDGPUInstructionSelector(
-  *this, *static_cast<AMDGPURegisterBankInfo *>(RegBankInfo.get()), TM));
+  InstSelector.reset(new AMDGPUInstructionSelector(*this, *RegBankInfo, TM));
 }
 
 unsigned GCNSubtarget::getConstantBusLimit(unsigned Opcode) const {


        


More information about the llvm-commits mailing list