MCPcopy Create free account
hub / github.com/Samsung/UTopia / dominates

Method dominates

lib/rootdefanalysis/RDSpace.cpp:144–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142}
143
144bool RDSpace::dominates(Instruction &Dominator, Instruction &Dominatee) {
145 if (Dominator.getFunction() != Dominatee.getFunction())
146 return false;
147
148 auto *F = Dominator.getFunction();
149 auto *TorBB = Dominator.getParent();
150 auto *TeeBB = Dominatee.getParent();
151 assert((F && TorBB && TeeBB) && "Unexpected Program State");
152
153 auto &DomTree = FAM.getResult<DominatorTreeAnalysis>(*F);
154
155 if (TorBB == TeeBB)
156 return DomTree.dominates(&Dominator, &Dominatee);
157
158 auto *TorNode = DomTree.getNode(TorBB);
159 auto *TeeNode = DomTree.getNode(TeeBB);
160 assert((TorNode && TeeNode) && "Unexpected Program State");
161
162 return DomTree.properlyDominates(TorNode, TeeNode);
163}
164
165std::set<Function *> RDSpace::buildCallerMap(Function &F) {
166 std::set<Function *> Result;

Callers 2

getPrevsMemoryBaseMethod · 0.80
findMethod · 0.80

Calls 1

getFunctionMethod · 0.80

Tested by

no test coverage detected