[llvm] [NVPTX] Remove unnecessary casts (NFC) (PR #156275)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 31 21:21:51 PDT 2025


================
@@ -432,7 +432,7 @@ void NVPTXAsmPrinter::emitKernelFunctionDirectives(const Function &F,
   // .maxclusterrank directive requires SM_90 or higher, make sure that we
   // filter it out for lower SM versions, as it causes a hard ptxas crash.
   const NVPTXTargetMachine &NTM = static_cast<const NVPTXTargetMachine &>(TM);
-  const auto *STI = static_cast<const NVPTXSubtarget *>(NTM.getSubtargetImpl());
+  const auto *STI = NTM.getSubtargetImpl();
----------------
arsenm wrote:

No auto. Also the usual way to do this is to use `getSubtarget<TargetSubtargetInfo>()`

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


More information about the llvm-commits mailing list