[PATCH] D81607: BreakCriticalEdges for callbr indirect dests

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 12 16:34:11 PDT 2020


nickdesaulniers 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.


Wait, that sounds like a problem.  Imagine we have 3 `callbr`s, two that share the same indirect destination, and we decide to split one their critical edges. Then we update the `blockaddress` of that `callbr`, but not the others where the others' indirect branch now doesn't preserve the previous operations.  As if we added another `callbr` in the entry of this test case with an indirect destination of `%CallSiteBB`.


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