[PATCH] D140180: [llvm] add CallBrPrepare pass to pipelines
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 26 11:13:17 PST 2023
efriedma added inline comments.
================
Comment at: llvm/docs/LangRef.rst:8537
+To support outputs along indirect edges, LLVM may need to split critical edges.
+This means that basic blocks may be synthesized; ``indirect labels`` from
+inline asm may not compare equal to the label when passed as a
----------------
nickdesaulniers wrote:
> efriedma wrote:
> > jyknight wrote:
> > > efriedma wrote:
> > > > Labels aren't a thing in LLVM IR; if you mean "blockaddress", please state that explicitly. Otherwise, I'm not sure what you're referring to.
> > > "indirect labels" are one of the arguments to the "callbr" instruction (see above syntax description and below description in "Arguments")
> > Okay, but then how do you pass a label as a "function args"?
> > Labels aren't a thing in LLVM IR
>
> ```
> callbr void asm "", "r,!i"(i32 %x)
> to label %fallthrough [label %indirect]
> ```
>
> I see the word label twice there.
>
> I'm also using language consistent with the rest of this section of the langref.
> https://llvm.org/docs/LangRef.html#callbr-instruction
>
> Perhaps the langref could use a fresh coat of paint here? But can that be orthogonal to this patch?
The part I'm confused about is that I'm not sure what you mean by passing a label as a function argument. (Yes, labels exist in LLVM IR in the sense you're talking about, but they don't have an address you can pass as an argument.)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D140180/new/
https://reviews.llvm.org/D140180
More information about the llvm-commits
mailing list