33 #define DEBUG_NAME "compiler2/DominatorPass"
68 if (dom_a.find(b) !=
e) {
82 for (EndInst::SuccessorListTy::const_iterator
i = ve->
succ_begin(),
84 list.insert(
i->get());
95 succ_v =
succ(v, succ_v);
96 LOG(
"number of succ for " << (
long)v <<
" (" <<
n <<
") " <<
" = " << succ_v.size() <<
nl);
97 for(NodeListTy::const_iterator
i = succ_v.begin() ,
e = succ_v.end();
150 for (
int i = 1 ;
i <=
n; ++
i) {
155 for (
int i =
n;
i >= 2; --
i) {
159 for (NodeListTy::const_iterator it = pred_w.begin(), et = pred_w.end();
171 for (NodeListTy::const_iterator it = bucket_p_w.begin(), et = bucket_p_w.end();
173 NodeListTy::const_iterator ittmp = it;
176 bucket_p_w.erase(ittmp);
184 for (
int i = 2;
i <=
n ; ++
i) {
192 LOG(
"Dominators:" <<
nl);
193 #if defined(ENABLE_LOGGING)
195 for (
int i = 1 ;
i <=
n; ++
i) {
198 LOG(
"index" <<
setw(3) <<
i <<
" dom(" << (
long)v <<
") =" << (
long)w <<
nl);
std::set< Key, Compare, Allocator< Key > > type
static SetWidth setw(size_t w)
alloc::set< NodeTy * >::type NodeListTy
const_bb_iterator bb_end() const
This Instruction mark the start of a basic block.
NodeListTy & succ(NodeTy *v, NodeListTy &list)
This Instruction mark the end of a basic block.
#define DEBUG_COND_N(VERBOSE)
SuccessorListTy::const_iterator succ_end() const
NodeTy * get_idominator(NodeTy *a) const
Get the immediate dominator.
virtual PassUsage & get_PassUsage(PassUsage &PU) const
Set the requirements for the pass.
Stores the interdependencies of a pass.
EndInst * get_EndInst() const
SuccessorListTy::const_iterator succ_begin() const
NodeTy * find_nearest_common_dom(NodeTy *a, NodeTy *b) const
Find the nearest common dominator.
#define LOG(STMT)
Analogous to DEBUG.
bool dominates(NodeTy *a, NodeTy *b) const
True if a dominates b.
virtual bool run(JITData &JD)
Run the Pass.
void Link(NodeTy *v, NodeTy *w)
static PassRegistry< BasicBlockSchedulingPass > X("BasicBlockSchedulingPass")
BeginInst * get_init_bb() const
void add_requires()
PassName is required.
const_bb_iterator bb_begin() const