[llvm] [Hexagon] Remove a redundant cast (NFC) (PR #165654)

via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 29 22:34:45 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-hexagon

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>

*getInstrInfo() is already of type const HexagonInstrInfo &.


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


1 Files Affected:

- (modified) llvm/lib/Target/Hexagon/HexagonSubtarget.cpp (+1-1) 


``````````diff
diff --git a/llvm/lib/Target/Hexagon/HexagonSubtarget.cpp b/llvm/lib/Target/Hexagon/HexagonSubtarget.cpp
index b9cdd6a2a3767..ce2de752f3b3a 100644
--- a/llvm/lib/Target/Hexagon/HexagonSubtarget.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonSubtarget.cpp
@@ -544,7 +544,7 @@ int HexagonSubtarget::updateLatency(MachineInstr &SrcInst,
   if (!hasV60Ops())
     return Latency;
 
-  auto &QII = static_cast<const HexagonInstrInfo &>(*getInstrInfo());
+  const HexagonInstrInfo &QII = *getInstrInfo();
   // BSB scheduling.
   if (QII.isHVXVec(SrcInst) || useBSBScheduling())
     Latency = (Latency + 1) >> 1;

``````````

</details>


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


More information about the llvm-commits mailing list