23 #define DEBUG_TYPE "flattencfg" 57 bool LocalChange =
true;
61 std::vector<WeakVH> Blocks;
62 Blocks.reserve(F.
size());
64 Blocks.push_back(&BB);
70 for (
WeakVH &BlockHandle : Blocks) {
72 if (
auto *BB = cast_or_null<BasicBlock>(BlockHandle))
76 Changed |= LocalChange;
82 AA = &getAnalysis<AAResultsWrapperPass>().getAAResults();
83 bool EverChanged =
false;
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
This class represents lattice values for constants.
INITIALIZE_PASS_BEGIN(FlattenCFGPass, "flattencfg", "Flatten the CFG", false, false) INITIALIZE_PASS_END(FlattenCFGPass
AnalysisUsage & addRequired()
#define INITIALIZE_PASS_DEPENDENCY(depName)
A nullable Value handle that is nullable.
bool FlattenCFG(BasicBlock *BB, AliasAnalysis *AA=nullptr)
This function is used to flatten a CFG.
static bool runOnFunction(Function &F, bool PostInlining)
FunctionPass * createFlattenCFGPass()
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
static bool iterativelyFlattenCFG(Function &F, AliasAnalysis *AA)
iterativelyFlattenCFG - Call FlattenCFG on all the blocks in the function, iterating until no more ch...
INITIALIZE_PASS_END(RegBankSelect, DEBUG_TYPE, "Assign register bank of generic virtual registers", false, false) RegBankSelect
This file provides various utilities for inspecting and working with the control flow graph in LLVM I...
bool removeUnreachableBlocks(Function &F, DomTreeUpdater *DTU=nullptr, MemorySSAUpdater *MSSAU=nullptr)
Remove all blocks that can not be reached from the function's entry.
A wrapper pass to provide the legacy pass manager access to a suitably prepared AAResults object...
void initializeFlattenCFGPassPass(PassRegistry &)