[PATCH] D138027: Clean up CFG on JumpThreading

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 19 06:01:37 PST 2022


lebedev.ri added a comment.

In D138027#4004728 <https://reviews.llvm.org/D138027#4004728>, @arkangath wrote:

> I am aware that the IR after the transformation is legal (as I mentioned in a previous comment).
>
> In the larger scope of things, LLVm is being used as a compiler toolchain for a commercial project (sorry for being coy, but you know how big corp is... and I'm not particularly happy about it either).
> There is another transform pass being run after JumpThreading which iterates over the blocks on a function, without checking their reachability or checking the CFG.

Is that an upstream pass, or a downstream one?

> That pass errors beause it finds a self-referencing instruction. Whether that instruction is reachable or not is irrelevant. I suggested to the team to just run CFGSimplify (or CSE I guess), but that has a compile-time cost, and if JumpThreading already knows the blocks are dead, might as well drop them there and then.
>
> As for more complicated inputs, I would welcome an example. I thought that JumpThreading would eventually reduce any unreachable CFG into a self-referencing block. Nevertheless, _some_ clean up is better than no clean up?




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138027



More information about the llvm-commits mailing list