[PATCH] D81607: BreakCriticalEdges for callbr indirect dests
Bill Wendling via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 12 13:42:19 PDT 2020
void added a comment.
In D81607#2090671 <https://reviews.llvm.org/D81607#2090671>, @nickdesaulniers wrote:
> In D81607#2090510 <https://reviews.llvm.org/D81607#2090510>, @efriedma wrote:
>
> > If the plan is to drop blockaddresses from callbr, then this LGTM.
>
>
> Disclaimer: I don't plan to rework `callbr`'s operands before landing this. Was that a conditional LGTM?
>
> I would like to resolve @fhahn 's question. TBH, I understand what a critical edge is, but I don't understand why splitting them is necessary? I assume there's something important @fhahn was alluding to, but I'm not sure precisely what, and I would like to make sure everyone's happy with this.
In general, splitting a critical edge is necessary because of how PHI nodes are resolved. A PHI node isn't a "real" instruction, but needs to be converted to a "copy to register" when translating to machine code. Because the edge is "critical" you can't just place the copy to register at the end of the parent block. So you need a place to put the copy, which is where the block created by splitting the edge comes into play.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D81607/new/
https://reviews.llvm.org/D81607
More information about the llvm-commits
mailing list