70 if(Inst == A || Inst == B)
77 THROW_ASSERT((Inst == A || Inst == B),
"Should find A or B");
85 unsigned int phiPos = 0
U;
86 for(
const auto& gp : BasicB->CGetPhiList())
117 return NAI->second < NBI->second;
128 THROW_ASSERT(A->
get_kind() != gimple_phi_K,
"Non dato, not given, nicht gegeben, pas donné, no dado, non detur");
139 const auto& BBmap =
DT->CGetBBGraphInfo()->bb_index_map;
141 const auto BBAi_v = BBmap.find(BBIA);
142 const auto BBBi_v = BBmap.find(BBIB);
149 if(BBAi_v->second == BBBi_v->second)
152 const auto& b_pred =
DT->CGetBBNodeInfo(BBBi_v->second)->block->list_of_pred;
153 return std::find(b_pred.begin(), b_pred.end(), BBIA) != b_pred.end();
155 THROW_ASSERT(BBAi_v != BBmap.end(),
"Unknown BB index (" +
STR(BBIA) +
")");
156 THROW_ASSERT(BBBi_v != BBmap.end(),
"Unknown BB index (" +
STR(BBIB) +
")");
172 if(
DT->IsReachable(BBAi_v->second, BBBi_v->second))
192 auto OBB =
OBBMap.find(BBIA);
195 const auto BBmap =
DT->CGetBBGraphInfo()->bb_index_map;
196 const auto BBvertex = BBmap.find(BBIA);
197 THROW_ASSERT(BBvertex != BBmap.end(),
"Unknown BB index (" +
STR(BBIA) +
")");
199 const auto BB =
DT->CGetBBNodeInfo(BBvertex->second)->block;
201 "Intermediate BB not allowed here");
203 OBB =
OBBMap.insert({BBIA, absl::make_unique<OrderedBasicBlock>(BB)}).first;
205 return OBB->second->dominates(InstA, InstB);
bool dominates(const unsigned int BBIA, const unsigned int BBIB) const
const BBGraphConstRef DT
The dominator tree of the parent function.
const blocRef BB
The source BasicBlock to map.
bool instComesBefore(const struct gimple_node *A, const struct gimple_node *B)
Given no cached results, find if A comes before B in BB.
bool dominates(const struct gimple_node *A, const struct gimple_node *B)
Find out whether A dominates B, meaning whether A comes before B in BB.
CustomMap< unsigned int, std::unique_ptr< OrderedBasicBlock > > OBBMap
Used to check dominance for instructions in same basic block.
exceptions managed by PandA
Data structure describing a basic block at tree level.
unsigned NextInstPos
The position/number to tag the next instruction to be found.
virtual enum kind get_kind() const =0
Virtual function returning the type of the actual class.
std::list< tree_nodeRef >::const_iterator LastInstFound
Keep track of last instruction inserted into NumberedInsts.
#define STR(s)
Macro which performs a lexical_cast to a string.
void invalidateBlock(unsigned int BBI)
Invalidate the OrderedBasicBlock cache when its basic block changes.
CustomMap< const struct gimple_node *, unsigned > NumberedInsts
Map a instruction to its position in a BasicBlock.
unsigned int bb_index
The basic block to which this gimple_node belongs.
const std::list< tree_nodeRef > & BBInst
The source BasicBlock instruction list.
#define GET_CONST_NODE(t)
Classes specification of the tree_node data structures.
const BBGraphConstRef & getDT() const
OrderedBasicBlock(const blocRef &BasicB)
Class specification of the tree_reindex support class.
static const unsigned int ENTRY_BLOCK_ID
constant identifying the entry basic block
OrderedInstructions(BBGraphConstRef _DT)
Constructor.
Class specification of the basic_block structure.
struct definition of the common part of a gimple with virtual operands
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...