[PATCH] D81607: BreakCriticalEdges for callbr indirect dests

James Y Knight via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 12 14:49:57 PDT 2020


jyknight added a comment.

In D81607#2090768 <https://reviews.llvm.org/D81607#2090768>, @efriedma wrote:

> > Disclaimer: I don't plan to rework callbr's operands before landing this. Was that a conditional LGTM?
>
> Wasn't intended to be conditional on any code changes.  Just that we don't plan to ever allow jumping to blockaddresses passed in as register operands.
>
> > 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.
>
> The reason we can't split edges coming out of indirectbr instructions is that in general, there is no way to fix the related blockaddresses in functions that contain multiple indirectbrs.  We can't rename the successor in one indirectbr without renaming it in all of them.  And if we rename it in all of them, the edge is still critical after the transform.
>
> We want to be sure the same issue doesn't apply to callbr instructions.  If it does, then we would need to fix the callers of SplitCriticalEdge, not SplitCriticalEdge itself.


While it's not the case right now, I think it would be very desirable to allow this in the future for callbr. Some of the other envisioned use-cases for callbr would require the ability to pass the target block in as a value (in which case there may be no blockaddress arguments directly on the callbr.)


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