Static Value-Flow Analysis
|
#include <MHP.h>
Public Types | |
typedef Set< const SVFFunction * > | FunSet |
typedef FIFOWorkList< CxtThreadStmt > | CxtThreadStmtWorkList |
typedef Set< CxtThreadStmt > | CxtThreadStmtSet |
typedef Map< CxtThreadStmt, NodeBS > | ThreadStmtToThreadInterleav |
typedef Map< const ICFGNode *, CxtThreadStmtSet > | InstToThreadStmtSetMap |
typedef SVFLoopAndDomInfo::LoopBBs | LoopBBs |
typedef Set< CxtStmt > | LockSpan |
typedef std::pair< const SVFFunction *, const SVFFunction * > | FuncPair |
typedef Map< FuncPair, bool > | FuncPairToBool |
Public Attributes | |
u32_t | numOfTotalQueries |
Total number of queries. | |
u32_t | numOfMHPQueries |
Number of queries are answered as may-happen-in-parallel. | |
double | interleavingTime |
double | interleavingQueriesTime |
Private Attributes | |
ThreadCallGraph * | tcg |
TCG. | |
TCT * | tct |
TCT. | |
ForkJoinAnalysis * | fja |
ForJoin Analysis. | |
CxtThreadStmtWorkList | cxtStmtList |
CxtThreadStmt worklist. | |
ThreadStmtToThreadInterleav | threadStmtToTheadInterLeav |
InstToThreadStmtSetMap | instToTSMap |
Map a statement to its thread interleavings. | |
FuncPairToBool | nonCandidateFuncMHPRelMap |
This class serves as a base may-happen in parallel analysis for multithreaded program Given a statement under an abstract thread, it tells which abstract threads may be alive at the same time (May-happen-in-parallel).
typedef std::pair<const SVFFunction*,const SVFFunction*> SVF::MHP::FuncPair |
MHP::MHP | ( | TCT * | t | ) |
|
virtual |
|
inlineprivate |
|
inlineprivate |
void MHP::analyze | ( | ) |
Start analysis here.
Start analysis here
Definition at line 62 of file MHP.cpp.
void MHP::analyzeInterleaving | ( | ) |
Analyze thread interleaving.
Analyze thread interleaving
handle non-candidate function
handle candidate function
update non-candidate functions' interleaving
Definition at line 75 of file MHP.cpp.
Definition at line 626 of file MHP.cpp.
|
inlineprivate |
Definition at line 126 of file MHP.h.
|
private |
Return thread id(s) which are directly or indirectly joined at this join site.
Return thread id(s) which are directly or indirectly joined at this join site
Definition at line 491 of file MHP.cpp.
|
inline |
Get interleaving thread for statement inst.
|
private |
|
inline |
|
inline |
|
inline |
|
private |
Handle call.
Handle call instruction in the current thread scope (excluding any fork site)
Definition at line 290 of file MHP.cpp.
|
private |
Handle fork.
Handle fork
Definition at line 203 of file MHP.cpp.
|
private |
Handle intra.
Handling intraprocedural statements (successive statements on the CFG )
|
private |
Handle join.
Handle join
for the join site in a loop loop which does not join the current thread we process the loop exit
Definition at line 233 of file MHP.cpp.
|
private |
Handle non-candidate function.
Handle call instruction in the current thread scope (excluding any fork site)
Definition at line 181 of file MHP.cpp.
|
private |
Handle return.
Handle return instruction in the current thread scope (excluding any join site)
Definition at line 319 of file MHP.cpp.
|
inline |
|
private |
bool MHP::isConnectedfromMain | ( | const SVFFunction * | fun | ) |
Whether the function is connected from main function in thread call graph.
Definition at line 521 of file MHP.cpp.
Whether thread t1 happens before t2 based on ForkJoin Analysis.
Whether two thread t1 happens-fore t2
Whether a join site must join a thread t.
A join site must join t if (1) t is not a multiforked thread (2) the join site of t is not in recursion
Definition at line 481 of file MHP.cpp.
Thread curTid can be fully joined by parentTid recursively.
Whether curTid can be fully joined by parentTid recursively
Definition at line 446 of file MHP.cpp.
Whether it is a fork site.
Definition at line 228 of file MHP.h.
Whether it is a join site.
Definition at line 234 of file MHP.h.
|
inlineprivate |
Match context.
Definition at line 210 of file MHP.h.
Interface to query whether two instructions may happen-in-parallel.
Definition at line 614 of file MHP.cpp.
Definition at line 592 of file MHP.cpp.
Answer MHP queries For a pair of ThreadStmts (t1,s1) = <l1> (t2,s2) = <l2> They may happen in parallel if (1) t1 == t2 and t1 inloop/incycle (2) t1!=t2 and t1 \in l2 and t2 \in l1
TODO: Any instruction in dead function is assumed no MHP with others
Definition at line 556 of file MHP.cpp.
|
inlineprivate |
void MHP::printInterleaving | ( | ) |
Print interleaving results.
Print interleaving results
|
inlineprivate |
Push calling context.
Definition at line 205 of file MHP.h.
|
inlineprivate |
WorkList helper functions.
|
inlineprivate |
Definition at line 172 of file MHP.h.
|
private |
Update Ancestor and sibling threads.
Update interleavings of ancestor threads according to TCT
Definition at line 382 of file MHP.cpp.
|
private |
Update non-candidate functions' interleaving. Copy interleaving threads of the entry inst to other insts.
Update non-candidate functions' interleaving
Definition at line 144 of file MHP.cpp.
|
private |
Update interleavings of sibling threads according to TCT
Exclude sibling thread that never happen in parallel based on ForkJoinAnalysis
The interleaving of a thread t is not unnecessary to be updated if (1) t HB Sibling and t fully joins curTid recursively or (2) Sibling HB t
Definition at line 418 of file MHP.cpp.
|
private |
CxtThreadStmt worklist.
|
private |
|
private |
|
private |
u32_t SVF::MHP::numOfMHPQueries |
|
private |
|
private |