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 |
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. | |
const ICFGNode * | getExitInstOfParentRoutineFun (NodeID tid) const |
Get exit instruction of the start routine function of tid's parent thread. | |
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) | |
|
inline |
maps a context-sensitive join site to a thread id
Definition at line 496 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
Definition at line 721 of file MHP.cpp.
|
inlineprivate |
Clear flags.
Definition at line 432 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 667 of file MHP.cpp.
|
inlineprivate |
Definition at line 485 of file MHP.h.
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 974 of file MHP.cpp.
Get directly joined threadIDs based on a context-sensitive join site.
|
inlineprivate |
Get forked thread.
Definition at line 476 of file MHP.h.
|
inlineprivate |
Get joined thread.
Definition at line 481 of file MHP.h.
|
inline |
|
inlineprivate |
Handle call.
Definition at line 877 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 812 of file MHP.cpp.
Handle return.
Definition at line 902 of file MHP.cpp.
|
inline |
|
inlineprivate |
Whether it is a matched fork join pair.
Definition at line 382 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 1049 of file MHP.cpp.
Whether it is a fork site.
Definition at line 464 of file MHP.h.
Whether it is a join site.
Definition at line 470 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 409 of file MHP.h.
|
inlineprivate |
Match context.
Definition at line 458 of file MHP.h.
|
inlineprivate |
|
inlineprivate |
Push calling context.
Definition at line 453 of file MHP.h.
Worklist operations.
|
private |
Same loop trip count.
The fork and join have same loop trip count
Definition at line 1073 of file MHP.cpp.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |