[llvm][SelectionDAGBuilder] codegen callbr.landingpad intrinsic
authorNick Desaulniers <ndesaulniers@google.com>
Fri, 17 Feb 2023 01:47:37 +0000 (17:47 -0800)
committerNick Desaulniers <ndesaulniers@google.com>
Fri, 17 Feb 2023 01:58:34 +0000 (17:58 -0800)
commit5cc1016a57b38595262026ba3c482f6108b12e5b
tree38d88d841f4f32adfa3b5d02ed3c901691311e0c
parent28d45c843cd07514c9a7260d285ff59e14280ecf
[llvm][SelectionDAGBuilder] codegen callbr.landingpad intrinsic

Given a CallBrInst, retain its first virtual register in SelectionDagBuilder's
FunctionLoweringInfo if there's corresponding landingpad. Walk the list
of COPY MachineInstr to find the original virtual and physical registers
defined by the INLINEASM_BR MachineInst.

Test cases from https://reviews.llvm.org/D139565.
Link: https://github.com/llvm/llvm-project/issues/59538
Part 3 from
https://discourse.llvm.org/t/rfc-syncing-asm-goto-with-outputs-with-gcc/65453/8

Follow up patches still need to wire up CallBrPrepare into the pass
pipelines.

Reviewed By: efriedma, void

Differential Revision: https://reviews.llvm.org/D140160
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
llvm/test/CodeGen/AArch64/callbr-asm-outputs-indirect-isel.ll [new file with mode: 0644]
llvm/test/CodeGen/PowerPC/callbr-asm-outputs-indirect-isel.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/callbr-asm-outputs-indirect-isel-m32.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/callbr-asm-outputs-indirect-isel.ll [new file with mode: 0644]