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

Method handleMemoryIntrinsicCall

lib/rootdefanalysis/RDAnalyzer.cpp:738–772  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

736}
737
738std::set<RDNode> RDAnalyzer::handleMemoryIntrinsicCall(RDNode &Node,
739 CallBase &CB) {
740 auto *F = CB.getCalledFunction();
741 assert((F && F->isIntrinsic()) && "Unexpected Program State");
742
743 auto IntrinsicID = F->getIntrinsicID();
744 assert((IntrinsicID == Intrinsic::memcpy ||
745 IntrinsicID == Intrinsic::memcpy_element_unordered_atomic ||
746 IntrinsicID == Intrinsic::memset ||
747 IntrinsicID != Intrinsic::memset_element_unordered_atomic) &&
748 "Unexpected Program State");
749
750 auto Dst = RDTarget::create(*CB.getOperand(0));
751 auto &NodeTarget = Node.getTarget();
752 if (Dst->includes(NodeTarget)) {
753 RDNode Next(Node);
754 Next.setTarget(*CB.getOperand(1));
755
756 if (Next.isRootDefinition())
757 Next.setIdx(-1);
758
759 return {Next};
760 }
761
762 if (NodeTarget.includes(*Dst)) {
763 RDNode Next(Node);
764 Next.setTarget(*CB.getOperand(1));
765 if (Next.isRootDefinition())
766 Next.setIdx(-1);
767
768 return {Next, Node};
769 }
770
771 return {Node};
772}
773
774bool RDAnalyzer::isOutParam(const llvm::CallBase &CB, size_t ArgIdx) const {
775 const auto *F = CB.getCalledFunction();

Callers

nothing calls this directly

Calls 5

getCalledFunctionMethod · 0.80
includesMethod · 0.80
setTargetMethod · 0.80
isRootDefinitionMethod · 0.80
setIdxMethod · 0.80

Tested by

no test coverage detected