739{
741
743 {
744 SVFUtil::outs() <<
"[SKIP] No race pairs found in pre-analysis\n";
745 return true;
746 }
747
749
750
752
753 std::set<const ICFGNode*> mtaSlicedNodes;
754
756 {
757
758
759
760 SVFUtil::outs() <<
"[Slicing Mode] Single unified slice (V_Single) for ILA + FSPTA\n";
764 {
765 ScopedPhaseTimer timer("Unified Slicing");
766 ValueFlowSlice singleSlice =
770 }
773 SVFUtil::outs() <<
"Unified sliced to " << mtaSlicedNodes.size()
774 << " nodes\n";
775 }
776 else
777 {
778 SVFUtil::outs() <<
"[Slicing Mode] Differential slices (separate ILA + FSPTA)\n";
781
782
783
784
785
786 std::set<const ICFGNode*> threadVFSources;
788 {
789 ScopedPhaseTimer timer("Select THREAD-VF slicing sources");
791 {
793 const ValueFlowSlice& preCandidate =
800 {
801 SVFUtil::errs() <<
"[ERROR] Failed to execution-close VFG'_pre\n";
802 return false;
803 }
806 <<
"[VFG'_pre] " << preCandidate.
svfgNodes.size()
807 << " dependency nodes, "
809 << " execution-closure nodes\n";
810
811
812
814 {
818 {
820 edge.first->getId(), edge.second->getId());
821
822
823 threadVFSources.insert(edge.first->getICFGNode());
824 threadVFSources.insert(edge.second->getICFGNode());
825 threadVFSources.insert(entry.second.begin(), entry.second.end());
826 }
827 }
828 }
829 }
836 {
837 ScopedPhaseTimer timer("MTA Slicing");
838 mtaSlicedNodes =
multiStageSlicer->runILASlicing(vulnerableStatements, threadVFSources);
839 }
842 << " nodes\n";
843 }
844
845
846 {
847 ScopedPhaseTimer timer("Build MTA Sliced View");
850 mtaSlicedNodes);
851 }
854
856
857 if (dumpDot)
858 {
864 }
865
866
867 {
868 ScopedPhaseTimer timer("Sliced Thread Create Tree");
872
875 if (dumpDot)
877 }
878
879
880 {
881 ScopedPhaseTimer ilaTimer("Sliced Interleaving and Lock Analysis");
882 {
883 ScopedPhaseTimer timer("Sliced ILA: construct MHP/ForkJoin");
888 }
889 {
890 ScopedPhaseTimer timer("Sliced ILA: MHP propagation");
892 }
893 {
894 ScopedPhaseTimer timer("Sliced ILA: Lock analysis");
897 }
898 }
899
900 return true;
901}
static NodeBS buildExecutionDependencyClosure(SVFG *graph, AndersenBase *preAnalysis, NodeBS dependencyNodes)
static std::unique_ptr< MHP > create(TCT *t, ICFGGraph icfg, CGGraph cg, StateRepresentation representation=StateRepresentation::MaterializedContexts)
Construct MHP and initialize its graph-dependent ForkJoinAnalysis.
std::pair< const StmtSVFGNode *, const StmtSVFGNode * > ThreadVFEdge
static const Option< bool > DumpMTAGraphs
MTA: dump the pointer-analysis and thread call graphs (ptacg/tcg.dot), Default: false.
static const Option< bool > MTASingleStageSlicing
MTA slicing: one unified slice for ILA + FSPTA (single-pass baseline), Default: false.
void dump(const std::string &filename) const
Dump sliced ICFG to dot file.
NodeBS preCandidateSolveNodeIds
MTASVFGBuilder::ThreadVFCandidateList selectedThreadVFCandidates
std::set< const SVFStmt * > getVulnerableStmts() const
Union of both statements of every candidate race pair (the slice targets).
ThreadCallGraph * threadCallGraph
std::unique_ptr< MultiStageSlicer > multiStageSlicer
std::set< const ICFGNode * > singleSlicedNodes
std::unique_ptr< SingleSlicer > singleSlicer
NodeBS singleSlicedSVFGNodeIds
std::unique_ptr< SlicedTCT > slicedTCT
void dump(const std::string &filename) const
Dump the sliced PAG to a dot file.
const SlicedThreadCallGraphView * getThreadCallGraph() const
Get SlicedThreadCallGraphView.
const SlicedICFGView * getICFG() const
Get SlicedICFGView.
const SlicedPAGView * getPAG() const
Get SlicedPAGView.
static std::unique_ptr< SlicedTCT > create(PointerAnalysis &pointerAnalysis, const SlicedSVFIRView &slicedView, u32_t contextLimit)
void dump(const std::string &filename) const
Dump sliced ThreadCallGraph to dot file.
OrderedSet< const SVFGNode * > svfgNodes
OrderedSet< const ICFGNode * > icfgNodes