[MustExec] Add a generic "must-be-executed-context" explorer
authorJohannes Doerfert <jdoerfert@anl.gov>
Fri, 23 Aug 2019 15:17:27 +0000 (15:17 +0000)
committerJohannes Doerfert <jdoerfert@anl.gov>
Fri, 23 Aug 2019 15:17:27 +0000 (15:17 +0000)
commita5b10b464e5e45cbc156119ba48f24677576d022
treef410e66e420fe3d972fe27c294cde7a1381e7fa1
parent344eee9227daa69b3ad919790da5a0edcf02c9cb
[MustExec] Add a generic "must-be-executed-context" explorer

Given an instruction I, the MustBeExecutedContextExplorer allows to
easily traverse instructions that are guaranteed to be executed whenever
I is. For now, these instruction have to be statically "after" I, in
the same or different basic blocks.

This patch also adds a pass which prints the must-be-executed-context
for each instruction in a module. It is used to test the
MustBeExecutedContextExplorer, for now on the examples given in the
class comment of the MustBeExecutedIterator.

Differential Revision: https://reviews.llvm.org/D65186

llvm-svn: 369765
llvm/include/llvm/Analysis/MustExecute.h
llvm/include/llvm/Analysis/Passes.h
llvm/include/llvm/InitializePasses.h
llvm/include/llvm/LinkAllPasses.h
llvm/lib/Analysis/Analysis.cpp
llvm/lib/Analysis/MustExecute.cpp
llvm/test/Analysis/MustExecute/must_be_executed_context.ll [new file with mode: 0644]