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

Method getPrevsMemoryBase

lib/rootdefanalysis/RDAnalyzer.cpp:201–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201std::set<RDNode> RDAnalyzer::getPrevsMemoryBase(RDNode &Node) {
202 auto &Target = Node.getTarget().getIR();
203 std::set<RDNode> Result;
204 for (auto *I : Space.next(Node.getLocation())) {
205 if (isa<AllocaInst>(&Target)) {
206 // Memory SSA does not care alloca instruction.
207 // Thus get prevs should stopped if found memory related instruction
208 // does not dominates alloca instruction.
209 auto &AI = *dyn_cast<AllocaInst>(&Target);
210 if (!Space.dominates(AI, *I))
211 continue;
212 }
213
214 RDNode NewNode(Node);
215 NewNode.setLocation(*I);
216 Result.insert(NewNode);
217 }
218 return Result;
219}
220
221std::set<RDNode> RDAnalyzer::getPrevsRegBase(RDNode &Node) {
222 auto &Target = Node.getTarget().getIR();

Callers

nothing calls this directly

Calls 3

dominatesMethod · 0.80
nextMethod · 0.45
setLocationMethod · 0.45

Tested by

no test coverage detected