29 : NextInstPos(0), BB(BasicB) {
30 LastInstFound = BB->
end();
35 bool OrderedBasicBlock::comesBefore(
const Instruction *
A,
38 assert(!(LastInstFound == BB->
end() && NextInstPos != 0) &&
39 "Instruction supposed to be in NumberedInsts");
42 auto II = BB->
begin();
44 if (LastInstFound !=
IE)
45 II = std::next(LastInstFound);
48 for (; II !=
IE; ++II) {
49 Inst = cast<Instruction>(II);
50 NumberedInsts[Inst] = NextInstPos++;
51 if (Inst == A || Inst == B)
55 assert(II !=
IE &&
"Instruction not found?");
56 assert((Inst == A || Inst == B) &&
"Should find A or B");
67 "Instructions must be in the same basic block!");
75 auto NAI = NumberedInsts.find(A);
76 auto NBI = NumberedInsts.find(B);
77 if (NAI != NumberedInsts.end() && NBI != NumberedInsts.end())
78 return NAI->second < NBI->second;
79 if (NAI != NumberedInsts.end())
81 if (NBI != NumberedInsts.end())
84 return comesBefore(A, B);
OrderedBasicBlock(const BasicBlock *BasicB)
bool dominates(const Instruction *A, const Instruction *B)
Find out whether A dominates B, meaning whether A comes before B in BB.
iterator begin()
Instruction iterator methods.
static GCRegistry::Add< OcamlGC > B("ocaml","ocaml 3.10-compatible GC")
* if(!EatIfPresent(lltok::kw_thread_local)) return false
ParseOptionalThreadLocal := /*empty.
LLVM Basic Block Representation.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static GCRegistry::Add< ErlangGC > A("erlang","erlang-compatible garbage collector")
const BasicBlock * getParent() const