This is an archive of the discontinued LLVM Phabricator instance.

[MustExec][WIP] Add a generic "must-be-executed-context" explorer
AbandonedPublic

Authored by jdoerfert on Jul 19 2019, 12:24 AM.

Details

Summary
NOTE: This is not a finished patch, testing and tests are missing. I will add tests and update this revision shortly.

Given an instruction I, the MustBeExecutedContextExplorer allows to
easily traverse all instructions that are guaranteed to be executed
whenever I is. These instruction can be statically and/or dynamically
before or after I, in the same or different basic blocks, and in the
same or different functions. So far, we can exploit: call sites, return
instructions, loops, (post-)dominance information, certain simply CFG
patterns, and branches that are constant in the first loop iteration.

There are options to limit the search and analyses are optional.