[llvm] [ARM] Remove an unnecessary cast (NFC) (PR #148869)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 15 08:37:29 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-arm

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>

TII is already of const ARMBaseInstrInfo *.  This patch removes AII in
favor of TII.


---
Full diff: https://github.com/llvm/llvm-project/pull/148869.diff


1 Files Affected:

- (modified) llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp (+1-3) 


``````````diff
diff --git a/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp b/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp
index 52302241fe365..57141ab69223f 100644
--- a/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp
+++ b/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp
@@ -2542,9 +2542,7 @@ bool ARMExpandPseudo::ExpandMI(MachineBasicBlock &MBB,
     }
     case ARM::Int_eh_sjlj_dispatchsetup: {
       MachineFunction &MF = *MI.getParent()->getParent();
-      const ARMBaseInstrInfo *AII =
-        static_cast<const ARMBaseInstrInfo*>(TII);
-      const ARMBaseRegisterInfo &RI = AII->getRegisterInfo();
+      const ARMBaseRegisterInfo &RI = TII->getRegisterInfo();
       // For functions using a base pointer, we rematerialize it (via the frame
       // pointer) here since eh.sjlj.setjmp and eh.sjlj.longjmp don't do it
       // for us. Otherwise, expand to nothing.

``````````

</details>


https://github.com/llvm/llvm-project/pull/148869


More information about the llvm-commits mailing list