| 736 | } |
| 737 | |
| 738 | std::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 | |
| 774 | bool RDAnalyzer::isOutParam(const llvm::CallBase &CB, size_t ArgIdx) const { |
| 775 | const auto *F = CB.getCalledFunction(); |
nothing calls this directly
no test coverage detected