|
Static Value-Flow Analysis
|
#include <MHP.h>
Public Types | |
| enum | ValDomain { Empty , TDAlive , TDDead } |
| semilattice Empty==>TDDead==>TDAlive More... | |
| typedef SVFLoopAndDomInfo::LoopBBs | LoopBBs |
| typedef TCT::InstVec | InstVec |
| typedef Map< CxtStmt, ValDomain > | CxtStmtToAliveFlagMap |
| typedef Map< CxtStmt, NodeBS > | CxtStmtToTIDMap |
| typedef Set< NodePair > | ThreadPairSet |
| typedef Map< CxtStmt, LoopBBs > | CxtStmtToLoopMap |
| typedef FIFOWorkList< CxtStmt > | CxtStmtWorkList |
| typedef Set< CxtStmt > | CxtStmtSet |
| typedef Map< const ICFGNode *, CxtStmtSet > | InstToCxtStmt |
Public Member Functions | |
| ForkJoinAnalysis (TCT *t) | |
| void | collectSCEVInfo () |
| functions | |
| void | analyzeForkJoinPair () |
| NodeBS & | getDirectlyJoinedTid (const CxtStmt &cs) |
| Get directly joined threadIDs based on a context-sensitive join site. | |
| NodeBS | getDirAndIndJoinedTid (const CxtStmt &cs) |
| Get directly and indirectly joined threadIDs based on a context-sensitive join site. | |
| const LoopBBs & | getJoinInSymmetricLoop (const CxtStmt &cs) const |
| Whether a context-sensitive join satisfies symmetric loop pattern. | |
| bool | hasJoinInSymmetricLoop (const CxtStmt &cs) const |
| bool | isHBPair (NodeID tid1, NodeID tid2) |
| Whether thread t1 happens-before thread t2. | |
| bool | isFullJoin (NodeID tid1, NodeID tid2) |
| Whether t1 fully joins t2. | |
| LoopBBs & | getJoinLoop (const CallICFGNode *inst) |
| Get loop for join site. | |
| bool | hasJoinLoop (const CallICFGNode *inst) |
Private Attributes | |
| TCT * | tct |
| CxtStmtToAliveFlagMap | cxtStmtToAliveFlagMap |
| flags for context-sensitive statements | |
| CxtStmtWorkList | cxtStmtList |
| context-sensitive statement worklist | |
| CxtStmtToTIDMap | directJoinMap |
| maps a context-sensitive join site to directly joined thread ids | |
| CxtStmtToTIDMap | dirAndIndJoinMap |
| maps a context-sensitive join site to directly and indirectly joined thread ids | |
| CxtStmtToLoopMap | cxtJoinInLoop |
| a set of context-sensitive join inside loop | |
| ThreadPairSet | HBPair |
| thread happens-before pair | |
| ThreadPairSet | HPPair |
| threads happen-in-parallel | |
| ThreadPairSet | fullJoin |
| t1 fully joins t2 along all program path | |
| ThreadPairSet | partialJoin |
| t1 partially joins t2 along some program path(s) | |
| InstToCxtStmt | instToCxtStmt |
| Map a statement to all its context-sensitive statements. | |
|
inline |
maps a context-sensitive join site to a thread id
Definition at line 519 of file MHP.h.
| void ForkJoinAnalysis::analyzeForkJoinPair | ( | ) |
context-sensitive forward traversal from each fork site. Generate following results (1) fork join pair, maps a context-sensitive join site to its corresponding thread ids (2) never happen-in-parallel thread pairs
Context-sensitive forward traversal from each fork site
Start from the instruction next to the fork site
Propagate to the return site of the call instruction, only if the callee is a non-candidate function, while for candidate function, return site should be handled after the callee is handled.
If the current instruction is an exit instruction of the start routine of a parent context thread, we need to update the join information the parent context thread.
Definition at line 760 of file MHP.cpp.
|
inlineprivate |
Clear flags.
Definition at line 444 of file MHP.h.
| void ForkJoinAnalysis::collectSCEVInfo | ( | ) |
functions
Collect SCEV pass information for pointers at fork/join sites Because ScalarEvolution is a function pass, previous knowledge of a function may be overwritten when analyzing a new function. We use a internal wrapper class PTASCEV to record all the necessary information for determining symmetric fork/join inside loops
Definition at line 706 of file MHP.cpp.
|
inlineprivate |
Definition at line 508 of file MHP.h.
|
inlineprivate |
Get directly and indirectly joined threadIDs based on a context-sensitive join site.
Return thread id(s) which are joined at this join site (1) thread t1 directly joins thread t2 (2) thread t1 indirectly joins thread t3 via directly joining t2 (t2 fully joins its child thread t3)
Definition at line 1061 of file MHP.cpp.
Get directly joined threadIDs based on a context-sensitive join site.
|
inlineprivate |
Get forked thread.
Definition at line 499 of file MHP.h.
|
inlineprivate |
Get joined thread.
Definition at line 504 of file MHP.h.
|
inline |
|
inlineprivate |
Handle call.
Definition at line 942 of file MHP.cpp.
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 873 of file MHP.cpp.
Handle return.
Definition at line 967 of file MHP.cpp.
|
inline |
|
inlineprivate |
Whether it is a matched fork join pair.
Definition at line 389 of file MHP.h.
|
inlineprivate |
If lhs is a suffix of rhs, including equal.
Definition at line 480 of file MHP.h.
Return true if the fork and join have the same SCEV.
We assume a pair of fork and join sites are must-alias if they have same PTASCEV (1) SCEV not inside loop (2) SCEV inside two symmetric loops, then pointers of fork thread and join thread should have same scev start and step. and should have same loop trip count
Definition at line 1136 of file MHP.cpp.
Whether it is a fork site.
Definition at line 487 of file MHP.h.
Whether it is a join site.
Definition at line 493 of file MHP.h.
|
inlineprivate |
Transfer function for marking context-sensitive statement.
alive is at the bottom of the semilattice, nothing needs to be done here
Definition at line 420 of file MHP.h.
|
inlineprivate |
Match context.
Definition at line 475 of file MHP.h.
|
inlineprivate |
|
inlineprivate |
Context helper functions.
Push calling context
handle calling context for candidate functions only
Definition at line 467 of file MHP.h.
Worklist operations.
|
private |
Same loop trip count.
The fork and join have same loop trip count
Definition at line 1160 of file MHP.cpp.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |