[PATCH] D65186: [MustExec] Add a generic "must-be-executed-context" explorer

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 29 22:54:57 PDT 2019


jdoerfert added a comment.

Thanks for taking a look at this!

You are right, this is not what we actually want to do. What we want to do is shown in D64975 <https://reviews.llvm.org/D64975>, basically the final version of this which I haven't mentioned here before.
In a nutshell, the final version can find join points in the CFG (forward/backward direction), enter functions in the CallGraph (forward/backward direction), and use analyses to improve the result.
This commit introduces most of the boilerplate, the interface so we can start implementing users, and a testable subset of the rather large logic part.

In D65186#1605214 <https://reviews.llvm.org/D65186#1605214>, @nikic wrote:

> I'm not sure I understand the design/purpose of this utility. As far as I can see, the main benefit this has over a standard guaranteed-to-transfer loop is that it will be able to continue into a unique successor BB. As most must-exec uses I've seen (including your ArgPromotion example, as well as attribute deduction uses) are interested in instructions that must-exec from entry, this will not happen for non-degenerate CFGs (where BBs have not been merged).


While beyond the point, the statement is not true. Take the loop header (=the loop body of "do-style" loops) as an example where the unique successor block is not mergeable with the predecessor.
(Basically anytime control merges in the unique successor we cannot merge.)

> To get something more accurate than a guaranteed-to-transfer loop over the entry block for purposes like attribute deduction, a different interface would be needed that can handle multiple successor blocks. Basically a backwards propagation that discards facts if there's no guaranteed-transfer.

Site note: We do not only want to do entry block exploration but that is also beyond the point here (see D65402 <https://reviews.llvm.org/D65402>).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65186





More information about the llvm-commits mailing list