Static Value-Flow Analysis
Loading...
Searching...
No Matches
MHP.h
Go to the documentation of this file.
1//===- MHP.h -- May-happen-in-parallel analysis-------------//
2//
3// SVF: Static Value-Flow Analysis
4//
5// Copyright (C) <2013-> <Yulei Sui>
6//
7
8// This program is free software: you can redistribute it and/or modify
9// it under the terms of the GNU Affero General Public License as published by
10// the Free Software Foundation, either version 3 of the License, or
11// (at your option) any later version.
12
13// This program is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16// GNU Affero General Public License for more details.
17
18// You should have received a copy of the GNU Affero General Public License
19// along with this program. If not, see <http://www.gnu.org/licenses/>.
20//
21//===----------------------------------------------------------------------===//
22
23/*
24 * MHP.h
25 *
26 * Created on: Jan 21, 2014
27 * Author: Yulei Sui, Peng Di
28 */
29
30#ifndef MHP_H_
31#define MHP_H_
32
33#include "MTA/TCT.h"
34#include "Util/SVFUtil.h"
35namespace SVF
36{
37
38class ForkJoinAnalysis;
39class LockAnalysis;
40
45class MHP
46{
47
48public:
55
57
58 typedef std::pair<const SVFFunction*,const SVFFunction*> FuncPair;
60
62 MHP(TCT* t);
63
65 virtual ~MHP();
66
68 void analyze();
69
72
75 {
76 return tcg;
77 }
78
80 inline TCT* getTCT() const
81 {
82 return tct;
83 }
84
86 bool isConnectedfromMain(const SVFFunction* fun);
87
88// LockSpan getSpanfromCxtLock(NodeID l);
90 virtual bool mayHappenInParallel(const ICFGNode* i1, const ICFGNode* i2);
91 virtual bool mayHappenInParallelCache(const ICFGNode* i1, const ICFGNode* i2);
92 virtual bool mayHappenInParallelInst(const ICFGNode* i1, const ICFGNode* i2);
93 virtual bool executedByTheSameThread(const ICFGNode* i1, const ICFGNode* i2);
94
96
98 {
100 }
101 inline bool hasInterleavingThreads(const CxtThreadStmt& cts) const
102 {
104 }
106
108
109 inline const CxtThreadStmtSet& getThreadStmtSet(const ICFGNode* inst) const
110 {
111 InstToThreadStmtSetMap::const_iterator it = instToTSMap.find(inst);
112 assert(it!=instToTSMap.end() && "no thread access the instruction?");
113 return it->second;
114 }
115 inline bool hasThreadStmtSet(const ICFGNode* inst) const
116 {
117 return instToTSMap.find(inst)!=instToTSMap.end();
118 }
120
122 void printInterleaving();
123
124private:
125
127 {
128 tcg->getCallees(inst, callees);
129 return callees;
130 }
134
137
140
143
146
148 void handleRet(const CxtThreadStmt& cts);
149
151 void handleIntra(const CxtThreadStmt& cts);
152
154
156 {
157 if(threadStmtToTheadInterLeav[tgr].test_and_set(tid))
158 {
159 instToTSMap[tgr.getStmt()].insert(tgr);
161 }
162 }
163 inline void addInterleavingThread(const CxtThreadStmt& tgr, const CxtThreadStmt& src)
164 {
166 if(changed)
167 {
168 instToTSMap[tgr.getStmt()].insert(tgr);
170 }
171 }
173 {
175 for(NodeBS::iterator it = tids.begin(), eit = tids.end(); it!=eit; ++it)
176 {
177 if(isMustJoin(tgr.getTid(),joinsite))
178 joinedTids.set(*it);
179 }
180 if(threadStmtToTheadInterLeav[tgr].intersectWithComplement(joinedTids))
181 {
183 }
184 }
186
188
192
195
197 bool isMustJoin(const NodeID curTid, const ICFGNode* joinsite);
198
201 {
203 }
205 inline void pushCxt(CallStrCxt& cxt, const CallICFGNode* call, const SVFFunction* callee)
206 {
207 tct->pushCxt(cxt,call,callee);
208 }
210 inline bool matchCxt(CallStrCxt& cxt, const CallICFGNode* call, const SVFFunction* callee)
211 {
212 return tct->matchCxt(cxt,call,callee);
213 }
214
216
217 inline bool pushToCTSWorkList(const CxtThreadStmt& cs)
218 {
219 return cxtStmtList.push(cs);
220 }
222 {
224 return ctp;
225 }
226
228 inline bool isTDFork(const ICFGNode* call)
229 {
230 const CallICFGNode* fork = SVFUtil::dyn_cast<CallICFGNode>(call);
231 return fork && tcg->getThreadAPI()->isTDFork(fork);
232 }
234 inline bool isTDJoin(const ICFGNode* call)
235 {
236 const CallICFGNode* join = SVFUtil::dyn_cast<CallICFGNode>(call);
237 return join && tcg->getThreadAPI()->isTDJoin(join);
238 }
239
241 NodeBS getDirAndIndJoinedTid(const CallStrCxt& cxt, const ICFGNode* call);
242
244 bool hasJoinInSymmetricLoop(const CallStrCxt& cxt, const ICFGNode* call) const;
245
247 const LoopBBs& getJoinInSymmetricLoop(const CallStrCxt& cxt, const ICFGNode* call) const;
248
251
259
260
261public:
266};
267
268
269
274{
275
276public:
279 {
280 Empty, // initial(dummy) state
281 TDAlive, // thread is alive
282 TDDead, // thread is dead
283 };
284
292
294 {
296 }
298 void collectSCEVInfo();
299
303 void analyzeForkJoinPair();
304
307 {
308 return directJoinMap[cs];
309 }
312
314 inline const LoopBBs& getJoinInSymmetricLoop(const CxtStmt& cs) const
315 {
316 CxtStmtToLoopMap::const_iterator it = cxtJoinInLoop.find(cs);
317 assert(it!=cxtJoinInLoop.end() && "does not have the loop");
318 return it->second;
319 }
320 inline bool hasJoinInSymmetricLoop(const CxtStmt& cs) const
321 {
322 CxtStmtToLoopMap::const_iterator it = cxtJoinInLoop.find(cs);
323 return it!=cxtJoinInLoop.end();
324 }
327 {
328 bool nonhp = HBPair.find(std::make_pair(tid1,tid2))!=HBPair.end();
329 bool hp = HPPair.find(std::make_pair(tid1,tid2))!=HPPair.end();
330 return nonhp && !hp;
331 }
334 {
335 bool full = fullJoin.find(std::make_pair(tid1,tid2))!=fullJoin.end();
336 bool partial = partialJoin.find(std::make_pair(tid1,tid2))!=partialJoin.end();
337 return full && !partial;
338 }
339
348
350 inline LoopBBs& getJoinLoop(const CallICFGNode* inst)
351 {
352 return tct->getJoinLoop(inst);
353 }
354 inline bool hasJoinLoop(const CallICFGNode* inst)
355 {
356 return tct->hasJoinLoop(inst);
357 }
358private:
359
361 void handleFork(const CxtStmt& cts,NodeID rootTid);
362
364 void handleJoin(const CxtStmt& cts,NodeID rootTid);
365
367 void handleCall(const CxtStmt& cts,NodeID rootTid);
368
370 void handleRet(const CxtStmt& cts);
371
373 void handleIntra(const CxtStmt& cts);
374
376 bool isSameSCEV(const ICFGNode* forkSite, const ICFGNode* joinSite);
377
380
387
388
390 {
391 CxtStmtToAliveFlagMap::const_iterator it = cxtStmtToAliveFlagMap.find(cs);
392 if(it==cxtStmtToAliveFlagMap.end())
393 {
395 return Empty;
396 }
397 else
398 return it->second;
399 }
409 void markCxtStmtFlag(const CxtStmt& tgr, const CxtStmt& src)
410 {
413 if(flag_tgr == Empty)
414 {
416 }
417 else if(flag_tgr == TDDead)
418 {
419 if(flag_src==TDAlive)
421 }
422 else
423 {
425 }
427 {
429 }
430 }
432 inline void clearFlagMap()
433 {
434 cxtStmtToAliveFlagMap.clear();
436 }
438
440
441 inline bool pushToCTSWorkList(const CxtStmt& cs)
442 {
443 return cxtStmtList.push(cs);
444 }
446 {
448 return ctp;
449 }
451
453 inline void pushCxt(CallStrCxt& cxt, const CallICFGNode* call, const SVFFunction* callee)
454 {
455 tct->pushCxt(cxt,call,callee);
456 }
458 inline bool matchCxt(CallStrCxt& cxt, const CallICFGNode* call, const SVFFunction* callee)
459 {
460 return tct->matchCxt(cxt,call,callee);
461 }
462
464 inline bool isTDFork(const ICFGNode* call)
465 {
466 const CallICFGNode* fork = SVFUtil::dyn_cast<CallICFGNode>(call);
467 return fork && getTCG()->getThreadAPI()->isTDFork(fork);
468 }
470 inline bool isTDJoin(const ICFGNode* call)
471 {
472 const CallICFGNode* join = SVFUtil::dyn_cast<CallICFGNode>(call);
473 return join && getTCG()->getThreadAPI()->isTDJoin(join);
474 }
476 inline const SVFVar* getForkedThread(const CallICFGNode* call)
477 {
478 return getTCG()->getThreadAPI()->getForkedThread(call);
479 }
481 inline const SVFVar* getJoinedThread(const CallICFGNode* call)
482 {
483 return getTCG()->getThreadAPI()->getJoinedThread(call);
484 }
486 {
487 getTCG()->getCallees(SVFUtil::cast<CallICFGNode>(inst), callees);
488 return callees;
489 }
491 inline ThreadCallGraph* getTCG() const
492 {
493 return tct->getThreadCallGraph();
494 }
496 inline void addDirectlyJoinTID(const CxtStmt& cs, NodeID tid)
497 {
498 directJoinMap[cs].set(tid);
499 }
500
503
505 {
506 HPPair.insert(std::make_pair(tid1,tid2));
507 HPPair.insert(std::make_pair(tid2,tid1));
508 }
510 {
511 HBPair.insert(std::make_pair(tid1,tid2));
512 }
514
516
518 {
519 fullJoin.insert(std::make_pair(tid1,tid2));
520 }
522 {
523 partialJoin.insert(std::make_pair(tid1,tid2));
524 }
526
528 inline void addSymmetricLoopJoin(const CxtStmt& cs, LoopBBs& lp)
529 {
530 cxtJoinInLoop[cs] = lp;
531 }
542};
543
544} // End namespace SVF
545
546#endif /* MHP_H_ */
bool push(const Data &data)
Definition WorkList.h:165
void addToFullJoin(NodeID tid1, NodeID tid2)
full join and partial join
Definition MHP.h:517
const PTACallGraph::FunctionSet & getCallee(const ICFGNode *inst, PTACallGraph::FunctionSet &callees)
Definition MHP.h:485
const SVFVar * getForkedThread(const CallICFGNode *call)
Get forked thread.
Definition MHP.h:476
void markCxtStmtFlag(const CxtStmt &tgr, const CxtStmt &src)
Transfer function for marking context-sensitive statement.
Definition MHP.h:409
Map< CxtStmt, LoopBBs > CxtStmtToLoopMap
Definition MHP.h:290
FIFOWorkList< CxtStmt > CxtStmtWorkList
Definition MHP.h:291
ValDomain getMarkedFlag(const CxtStmt &cs)
Mark thread flags for cxtStmt.
Definition MHP.h:389
void addToHPPair(NodeID tid1, NodeID tid2)
Definition MHP.h:504
SVFLoopAndDomInfo::LoopBBs LoopBBs
Definition MHP.h:285
void analyzeForkJoinPair()
Definition MHP.cpp:721
bool hasJoinLoop(const CallICFGNode *inst)
Definition MHP.h:354
void addSymmetricLoopJoin(const CxtStmt &cs, LoopBBs &lp)
Add inloop join.
Definition MHP.h:528
void handleRet(const CxtStmt &cts)
Handle return.
Definition MHP.cpp:902
NodeBS getDirAndIndJoinedTid(const CxtStmt &cs)
Get directly and indirectly joined threadIDs based on a context-sensitive join site.
Definition MHP.cpp:974
ThreadPairSet partialJoin
t1 partially joins t2 along some program path(s)
Definition MHP.h:541
bool matchCxt(CallStrCxt &cxt, const CallICFGNode *call, const SVFFunction *callee)
Match context.
Definition MHP.h:458
ThreadPairSet fullJoin
t1 fully joins t2 along all program path
Definition MHP.h:540
ForkJoinAnalysis(TCT *t)
Definition MHP.h:293
ThreadPairSet HPPair
threads happen-in-parallel
Definition MHP.h:539
CxtStmt popFromCTSWorkList()
Definition MHP.h:445
TCT::InstVec InstVec
Definition MHP.h:286
CxtStmtToLoopMap cxtJoinInLoop
a set of context-sensitive join inside loop
Definition MHP.h:537
void addToHBPair(NodeID tid1, NodeID tid2)
Definition MHP.h:509
ThreadCallGraph * getTCG() const
ThreadCallGraph.
Definition MHP.h:491
void addToPartial(NodeID tid1, NodeID tid2)
Definition MHP.h:521
void collectSCEVInfo()
functions
Definition MHP.cpp:667
void clearFlagMap()
Clear flags.
Definition MHP.h:432
void pushCxt(CallStrCxt &cxt, const CallICFGNode *call, const SVFFunction *callee)
Push calling context.
Definition MHP.h:453
bool pushToCTSWorkList(const CxtStmt &cs)
Worklist operations.
Definition MHP.h:441
Set< NodePair > ThreadPairSet
Definition MHP.h:289
bool isHBPair(NodeID tid1, NodeID tid2)
Whether thread t1 happens-before thread t2.
Definition MHP.h:326
void addDirectlyJoinTID(const CxtStmt &cs, NodeID tid)
maps a context-sensitive join site to a thread id
Definition MHP.h:496
ValDomain
semilattice Empty==>TDDead==>TDAlive
Definition MHP.h:279
const SVFVar * getJoinedThread(const CallICFGNode *call)
Get joined thread.
Definition MHP.h:481
Map< CxtStmt, NodeBS > CxtStmtToTIDMap
Definition MHP.h:288
LoopBBs & getJoinLoop(const CallICFGNode *inst)
Get loop for join site.
Definition MHP.h:350
CxtStmtToAliveFlagMap cxtStmtToAliveFlagMap
flags for context-sensitive statements
Definition MHP.h:533
const ICFGNode * getExitInstOfParentRoutineFun(NodeID tid) const
Get exit instruction of the start routine function of tid's parent thread.
Definition MHP.h:341
bool isTDFork(const ICFGNode *call)
Whether it is a fork site.
Definition MHP.h:464
ThreadPairSet HBPair
thread happens-before pair
Definition MHP.h:538
bool isFullJoin(NodeID tid1, NodeID tid2)
Whether t1 fully joins t2.
Definition MHP.h:333
CxtStmtToTIDMap dirAndIndJoinMap
maps a context-sensitive join site to directly and indirectly joined thread ids
Definition MHP.h:536
void handleCall(const CxtStmt &cts, NodeID rootTid)
Handle call.
Definition MHP.cpp:877
bool hasJoinInSymmetricLoop(const CxtStmt &cs) const
Definition MHP.h:320
CxtStmtToTIDMap directJoinMap
maps a context-sensitive join site to directly joined thread ids
Definition MHP.h:535
bool sameLoopTripCount(const ICFGNode *forkSite, const ICFGNode *joinSite)
Same loop trip count.
Definition MHP.cpp:1073
bool isTDJoin(const ICFGNode *call)
Whether it is a join site.
Definition MHP.h:470
void markCxtStmtFlag(const CxtStmt &tgr, ValDomain flag)
Initialize TDAlive and TDDead flags.
Definition MHP.h:401
CxtStmtWorkList cxtStmtList
context-sensitive statement worklist
Definition MHP.h:534
Map< CxtStmt, ValDomain > CxtStmtToAliveFlagMap
Definition MHP.h:287
const LoopBBs & getJoinInSymmetricLoop(const CxtStmt &cs) const
Whether a context-sensitive join satisfies symmetric loop pattern.
Definition MHP.h:314
bool isAliasedForkJoin(const CallICFGNode *forkSite, const CallICFGNode *joinSite)
Whether it is a matched fork join pair.
Definition MHP.h:382
void handleIntra(const CxtStmt &cts)
Handle intra.
Definition MHP.cpp:953
void handleFork(const CxtStmt &cts, NodeID rootTid)
Handle fork.
Definition MHP.cpp:785
NodeBS & getDirectlyJoinedTid(const CxtStmt &cs)
Get directly joined threadIDs based on a context-sensitive join site.
Definition MHP.h:306
void handleJoin(const CxtStmt &cts, NodeID rootTid)
Handle join.
Definition MHP.cpp:812
bool isSameSCEV(const ICFGNode *forkSite, const ICFGNode *joinSite)
Return true if the fork and join have the same SCEV.
Definition MHP.cpp:1049
Definition MHP.h:46
void analyze()
Start analysis here.
Definition MHP.cpp:62
CxtThreadStmtWorkList cxtStmtList
CxtThreadStmt worklist.
Definition MHP.h:255
bool isRecurFullJoin(NodeID parentTid, NodeID curTid)
Thread curTid can be fully joined by parentTid recursively.
Definition MHP.cpp:446
bool isMultiForkedThread(NodeID curTid)
A thread is a multiForked thread if it is in a loop or recursion.
Definition MHP.h:200
Set< CxtStmt > LockSpan
Definition MHP.h:56
void rmInterleavingThread(const CxtThreadStmt &tgr, const NodeBS &tids, const ICFGNode *joinsite)
Definition MHP.h:172
virtual bool mayHappenInParallelCache(const ICFGNode *i1, const ICFGNode *i2)
Definition MHP.cpp:592
TCT * tct
TCT.
Definition MHP.h:253
FuncPairToBool nonCandidateFuncMHPRelMap
Definition MHP.h:258
void printInterleaving()
Print interleaving results.
Definition MHP.cpp:647
void updateSiblingThreads(NodeID tid)
Definition MHP.cpp:418
u32_t numOfTotalQueries
Total number of queries.
Definition MHP.h:262
Set< CxtThreadStmt > CxtThreadStmtSet
Definition MHP.h:51
void handleNonCandidateFun(const CxtThreadStmt &cts)
Handle non-candidate function.
Definition MHP.cpp:181
SVFLoopAndDomInfo::LoopBBs LoopBBs
Definition MHP.h:54
void handleJoin(const CxtThreadStmt &cts, NodeID rootTid)
Handle join.
Definition MHP.cpp:233
bool hasInterleavingThreads(const CxtThreadStmt &cts) const
Definition MHP.h:101
void pushCxt(CallStrCxt &cxt, const CallICFGNode *call, const SVFFunction *callee)
Push calling context.
Definition MHP.h:205
ThreadCallGraph * tcg
TCG.
Definition MHP.h:252
void addInterleavingThread(const CxtThreadStmt &tgr, NodeID tid)
Add/Remove interleaving thread for statement inst.
Definition MHP.h:155
const NodeBS & getInterleavingThreads(const CxtThreadStmt &cts)
Get interleaving thread for statement inst.
Definition MHP.h:97
InstToThreadStmtSetMap instToTSMap
Map a statement to its thread interleavings.
Definition MHP.h:257
virtual ~MHP()
Destructor.
Definition MHP.cpp:54
void addInterleavingThread(const CxtThreadStmt &tgr, const CxtThreadStmt &src)
Definition MHP.h:163
bool isHBPair(NodeID tid1, NodeID tid2)
Whether thread t1 happens before t2 based on ForkJoin Analysis.
Definition MHP.cpp:516
ThreadCallGraph * getThreadCallGraph() const
Get ThreadCallGraph.
Definition MHP.h:74
bool isTDFork(const ICFGNode *call)
Whether it is a fork site.
Definition MHP.h:228
void handleRet(const CxtThreadStmt &cts)
Handle return.
Definition MHP.cpp:319
virtual bool executedByTheSameThread(const ICFGNode *i1, const ICFGNode *i2)
Definition MHP.cpp:626
bool matchCxt(CallStrCxt &cxt, const CallICFGNode *call, const SVFFunction *callee)
Match context.
Definition MHP.h:210
virtual bool mayHappenInParallel(const ICFGNode *i1, const ICFGNode *i2)
Interface to query whether two instructions may happen-in-parallel.
Definition MHP.cpp:614
const CxtThreadStmtSet & getThreadStmtSet(const ICFGNode *inst) const
Get/has ThreadStmt.
Definition MHP.h:109
void handleFork(const CxtThreadStmt &cts, NodeID rootTid)
Handle fork.
Definition MHP.cpp:203
const LoopBBs & getJoinInSymmetricLoop(const CallStrCxt &cxt, const ICFGNode *call) const
Whether a context-sensitive join satisfies symmetric loop pattern.
Definition MHP.cpp:507
Set< const SVFFunction * > FunSet
Definition MHP.h:49
bool isConnectedfromMain(const SVFFunction *fun)
Whether the function is connected from main function in thread call graph.
Definition MHP.cpp:521
Map< const ICFGNode *, CxtThreadStmtSet > InstToThreadStmtSetMap
Definition MHP.h:53
ForkJoinAnalysis * fja
ForJoin Analysis.
Definition MHP.h:254
bool hasJoinInSymmetricLoop(const CallStrCxt &cxt, const ICFGNode *call) const
Whether a context-sensitive join satisfies symmetric loop pattern.
Definition MHP.cpp:500
bool hasThreadStmtSet(const ICFGNode *inst) const
Definition MHP.h:115
double interleavingQueriesTime
Definition MHP.h:265
u32_t numOfMHPQueries
Number of queries are answered as may-happen-in-parallel.
Definition MHP.h:263
void updateNonCandidateFunInterleaving()
Definition MHP.cpp:144
Map< CxtThreadStmt, NodeBS > ThreadStmtToThreadInterleav
Definition MHP.h:52
bool isMustJoin(const NodeID curTid, const ICFGNode *joinsite)
Whether a join site must join a thread t.
Definition MHP.cpp:481
double interleavingTime
Definition MHP.h:264
std::pair< const SVFFunction *, const SVFFunction * > FuncPair
Definition MHP.h:58
CxtThreadStmt popFromCTSWorkList()
Definition MHP.h:221
const PTACallGraph::FunctionSet & getCallee(const CallICFGNode *inst, PTACallGraph::FunctionSet &callees)
Definition MHP.h:126
void analyzeInterleaving()
Analyze thread interleaving.
Definition MHP.cpp:75
Map< FuncPair, bool > FuncPairToBool
Definition MHP.h:59
NodeBS getDirAndIndJoinedTid(const CallStrCxt &cxt, const ICFGNode *call)
Return thread id(s) which are directly or indirectly joined at this join site.
Definition MHP.cpp:491
void updateAncestorThreads(NodeID tid)
Update Ancestor and sibling threads.
Definition MHP.cpp:382
virtual bool mayHappenInParallelInst(const ICFGNode *i1, const ICFGNode *i2)
Definition MHP.cpp:556
FIFOWorkList< CxtThreadStmt > CxtThreadStmtWorkList
Definition MHP.h:50
bool pushToCTSWorkList(const CxtThreadStmt &cs)
WorkList helper functions.
Definition MHP.h:217
void handleIntra(const CxtThreadStmt &cts)
Handle intra.
Definition MHP.cpp:366
void handleCall(const CxtThreadStmt &cts, NodeID rootTid)
Handle call.
Definition MHP.cpp:290
TCT * getTCT() const
Get Thread Creation Tree.
Definition MHP.h:80
ThreadStmtToThreadInterleav threadStmtToTheadInterLeav
Definition MHP.h:256
bool isTDJoin(const ICFGNode *call)
Whether it is a join site.
Definition MHP.h:234
void getCallees(const CallICFGNode *cs, FunctionSet &callees)
Get all callees for a callsite.
Set< const SVFFunction * > FunctionSet
virtual AliasResult alias(const SVFValue *V1, const SVFValue *V2)=0
Interface exposed to users of our pointer analysis, given Value infos.
const ICFGNode * back() const
Definition SVFValue.h:611
const SVFBasicBlock * getExitBB() const
Definition SVFValue.cpp:186
void set(unsigned Idx)
const CxtThread & getCxtThread() const
Get CxtThread.
Definition TCT.h:101
bool isMultiforked() const
Definition TCT.h:120
TCTNode * getTCTNode(NodeID id) const
Get TCT node.
Definition TCT.h:206
const SVFFunction * getStartRoutineOfCxtThread(const CxtThread &ct) const
get the start routine function of a thread
Definition TCT.h:377
PointerAnalysis * getPTA() const
Get PTA.
Definition TCT.h:201
void pushCxt(CallStrCxt &cxt, const CallICFGNode *call, const SVFFunction *callee)
Push calling context.
Definition TCT.cpp:445
bool hasJoinLoop(const CallICFGNode *join) const
Definition TCT.h:393
NodeID getParentThread(NodeID tid) const
Get parent thread.
Definition TCT.h:320
ThreadCallGraph * getThreadCallGraph() const
Get TCG.
Definition TCT.h:196
std::vector< const ICFGNode * > InstVec
Definition TCT.h:161
LoopBBs & getJoinLoop(const CallICFGNode *join)
Get loop for join site.
Definition TCT.h:385
bool matchCxt(CallStrCxt &cxt, const CallICFGNode *call, const SVFFunction *callee)
Match context.
Definition TCT.cpp:466
bool isTDFork(const CallICFGNode *inst) const
Return true if this call create a new thread.
const ValVar * getForkedThread(const CallICFGNode *inst) const
Return arguments/attributes of pthread_create / hare_parallel_for.
bool isTDJoin(const CallICFGNode *inst) const
Return true if this call wait for a worker thread.
const SVFVar * getJoinedThread(const CallICFGNode *inst) const
Return arguments/attributes of pthread_join.
ThreadAPI * getThreadAPI() const
Thread API.
for isBitcode
Definition BasicTypes.h:68
u32_t NodeID
Definition GeneralType.h:55
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74
std::vector< u32_t > CallStrCxt
unsigned u32_t
Definition GeneralType.h:46