#include "llvm/Analysis/DDG.h"
#include "llvm/ADT/SCCIterator.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/LoopIterator.h"
#include "llvm/Support/CommandLine.h"
usingnamespacellvm;
static cl::opt<bool> SimplifyDDG(
"ddg-simplify", cl::init(true), cl::Hidden,
cl::desc(
"Simplify DDG by merging nodes that have less interesting edges."));
static cl::opt<bool> CreatePiBlocks("ddg-pi-blocks", cl::init(true), cl::Hidden,
cl::desc("Create pi-block nodes."));
#define DEBUG_TYPE …
template class llvm::DGEdge<DDGNode, DDGEdge>;
template class llvm::DGNode<DDGNode, DDGEdge>;
template class llvm::DirectedGraph<DDGNode, DDGEdge>;
DDGNode::~DDGNode() = default;
bool DDGNode::collectInstructions(
llvm::function_ref<bool(Instruction *)> const &Pred,
InstructionListType &IList) const { … }
raw_ostream &llvm::operator<<(raw_ostream &OS, const DDGNode::NodeKind K) { … }
raw_ostream &llvm::operator<<(raw_ostream &OS, const DDGNode &N) { … }
SimpleDDGNode::SimpleDDGNode(Instruction &I)
: … { … }
SimpleDDGNode::SimpleDDGNode(const SimpleDDGNode &N)
: … { … }
SimpleDDGNode::SimpleDDGNode(SimpleDDGNode &&N)
: … { … }
SimpleDDGNode::~SimpleDDGNode() { … }
PiBlockDDGNode::PiBlockDDGNode(const PiNodeList &List)
: … { … }
PiBlockDDGNode::PiBlockDDGNode(const PiBlockDDGNode &N)
: … { … }
PiBlockDDGNode::PiBlockDDGNode(PiBlockDDGNode &&N)
: … { … }
PiBlockDDGNode::~PiBlockDDGNode() { … }
raw_ostream &llvm::operator<<(raw_ostream &OS, const DDGEdge::EdgeKind K) { … }
raw_ostream &llvm::operator<<(raw_ostream &OS, const DDGEdge &E) { … }
BasicBlockListType;
DataDependenceGraph::DataDependenceGraph(Function &F, DependenceInfo &D)
: … { … }
DataDependenceGraph::DataDependenceGraph(Loop &L, LoopInfo &LI,
DependenceInfo &D)
: … { … }
DataDependenceGraph::~DataDependenceGraph() { … }
bool DataDependenceGraph::addNode(DDGNode &N) { … }
const PiBlockDDGNode *DataDependenceGraph::getPiBlock(const NodeType &N) const { … }
raw_ostream &llvm::operator<<(raw_ostream &OS, const DataDependenceGraph &G) { … }
bool DDGBuilder::areNodesMergeable(const DDGNode &Src,
const DDGNode &Tgt) const { … }
void DDGBuilder::mergeNodes(DDGNode &A, DDGNode &B) { … }
bool DDGBuilder::shouldSimplify() const { … }
bool DDGBuilder::shouldCreatePiBlocks() const { … }
DDGAnalysis::Result DDGAnalysis::run(Loop &L, LoopAnalysisManager &AM,
LoopStandardAnalysisResults &AR) { … }
AnalysisKey DDGAnalysis::Key;
PreservedAnalyses DDGAnalysisPrinterPass::run(Loop &L, LoopAnalysisManager &AM,
LoopStandardAnalysisResults &AR,
LPMUpdater &U) { … }