[llvm] [NVPTX] Simplify BRX emission avoiding pseduo-instruction chain (PR #209952)

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 16 16:59:42 PDT 2026


================
@@ -515,6 +521,15 @@ void NVPTXAsmPrinter::emitFunctionBodyStart() {
   for (const auto &[Id, CB] : MFI->getCallPrototypes())
     emitCallPrototype(*CB, Id, O);
 
+  if (const MachineJumpTableInfo *MJTI = MF->getJumpTableInfo())
+    for (const auto &[Idx, JT] : enumerate(MJTI->getJumpTables())) {
+      O << "$L_brx_" << Idx << ": .branchtargets ";
+      interleaveComma(JT.MBBs, O, [&](const MachineBasicBlock *MBB) {
----------------
rnk wrote:

I think we ought to stick with label-per-line. There are some pretty massive switches out there, and the PTX line will get quite long if we only comma-separate the labels.

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


More information about the llvm-commits mailing list