[PATCH] D139565: [IR] add new callbrpad instruction

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 7 14:09:50 PST 2022


nickdesaulniers added inline comments.


================
Comment at: llvm/docs/LangRef.rst:12159
+
+The '``callbrpad``' instruction takes one argument, which must be a
+`callbr <i_callbr>`. The type of the '``callbrpad``' corresponds to the type of
----------------
efriedma wrote:
> Having the callbr as an operand seems redundant.  We can already look up the corresponding callbr by just grabbing the terminator of the predecessor.
My patch relies heavily on the fact that given a `callbr`, what was the first virtual register assigned as its output. `FuncInfo.ValueMap` is that mapping.  Without any explicit users of a value in IR, SelectionDAG does not retain the mapping for that value.

SelectionDAG also doesn't contain a mapping of `callbr` Instruction to `INLINEASM_BR` MachineInstr.

So if you query `FuncInfo.ValueMap` for the callbr (whether it's an explicit operand or not where you look at the terminator of your predecessor), you will get either the first virtual register after the INLINEASM_BR, or nothing.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139565/new/

https://reviews.llvm.org/D139565



More information about the llvm-commits mailing list