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

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 30 12:39:52 PDT 2025


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/156203

getInstrInfo() already returns const ARMBaseInstrInfo *.


>From 1c54e56516d91b50ff849550103ebcbf64d1c508 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Sat, 30 Aug 2025 10:17:10 -0700
Subject: [PATCH] [ARM] Remove an unnecessary cast (NFC)

getInstrInfo() already returns const ARMBaseInstrInfo *.
---
 llvm/lib/Target/ARM/ARMBlockPlacement.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/Target/ARM/ARMBlockPlacement.cpp b/llvm/lib/Target/ARM/ARMBlockPlacement.cpp
index ec907995e3abc..3d8ebfeae81da 100644
--- a/llvm/lib/Target/ARM/ARMBlockPlacement.cpp
+++ b/llvm/lib/Target/ARM/ARMBlockPlacement.cpp
@@ -218,7 +218,7 @@ bool ARMBlockPlacement::runOnMachineFunction(MachineFunction &MF) {
     return false;
   LLVM_DEBUG(dbgs() << DEBUG_PREFIX << "Running on " << MF.getName() << "\n");
   MLI = &getAnalysis<MachineLoopInfoWrapperPass>().getLI();
-  TII = static_cast<const ARMBaseInstrInfo *>(ST.getInstrInfo());
+  TII = ST.getInstrInfo();
   BBUtils = std::make_unique<ARMBasicBlockUtils>(MF);
   MF.RenumberBlocks();
   BBUtils->computeAllBlockSizes();



More information about the llvm-commits mailing list