[llvm] [SelectionDAG] Recover callbr outputs from INLINEASM_BR defs (PR #219792)

Oscar Priego via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 7 17:08:25 PDT 2026


Opriego wrote:

> This looks like a workaround, other instructions could also end up appearing here.

Good point. I reworked this to avoid the `CallBrInst` special case entirely.

The root cause was in `visitCallBrLandingPad()`: it was recovering the original `INLINEASM_BR` output by following a COPY chain from `FuncInfo.ValueMap[CBR]`, but that exported value can legally be materialized through target-preferred extension/legalization instructions.

The updated patch now recovers the register outputs directly from the associated `INLINEASM_BR` operand groups (`RegDef` / `RegDefEarlyClobber`) and uses those to rebuild the landing-pad value. `CopyValueToVirtualRegister()` is back to its generic behavior.

I also strengthened the RISC-V regression so the normal path is explicitly lowered through sign-extension instructions rather than a COPY, while the indirect path still uses the original inline-asm output.


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


More information about the llvm-commits mailing list