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

Method getRootDefinitions

lib/rootdefanalysis/RDAnalyzer.cpp:20–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18}
19
20std::set<RDNode> RDAnalyzer::getRootDefinitions(const llvm::Use &U) {
21 auto *User = llvm::dyn_cast_or_null<llvm::Instruction>(U.getUser());
22 if (!User)
23 return {};
24
25 Start = time(NULL);
26
27 auto FoundDefs = findRootDefinitions(*const_cast<Use *>(&U));
28 std::vector<RDNode> RootDefs(FoundDefs.begin(), FoundDefs.end());
29 RootDefs.erase(std::remove_if(RootDefs.begin(), RootDefs.end(),
30 [](const auto &Node) {
31 if (Node.isTimeout())
32 return true;
33
34 if (!Node.isRootDefinition()) {
35 if (isa<RDMemory>(&Node.getTarget()))
36 return false;
37
38 return true;
39 }
40
41 return false;
42 }),
43 RootDefs.end());
44 return std::set<RDNode>(RootDefs.begin(), RootDefs.end());
45}
46
47std::set<RDNode> RDAnalyzer::findRootDefinitions(Use &U) {
48 unsigned OpIdx = U.getOperandNo();

Callers 5

analyzeTargetCallArgMethod · 0.80
analyzeMethod · 0.80
findMethod · 0.80
verifyFirstUseFunction · 0.80
TEST_FFunction · 0.80

Calls 4

beginMethod · 0.80
endMethod · 0.80
isTimeoutMethod · 0.80
isRootDefinitionMethod · 0.80

Tested by 4

analyzeMethod · 0.64
findMethod · 0.64
verifyFirstUseFunction · 0.64
TEST_FFunction · 0.64