MCPcopy Create free account
hub / github.com/Samsung/UTopia / getLoopExitCond

Function getLoopExitCond

lib/propanalysis/PropAnalysisCommon.cpp:7–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5namespace ftg {
6
7ICmpInst *getLoopExitCond(Loop &L) {
8 BranchInst *BI = nullptr;
9 if (L.isRotatedForm()) {
10 auto LL = L.getLoopLatch();
11 assert(LL && "Unexpected Program State");
12
13 BI = dyn_cast<BranchInst>(LL->getTerminator());
14 } else {
15 auto Header = L.getHeader();
16 assert(Header && "Unexpected Program State");
17
18 BI = dyn_cast<BranchInst>(Header->getTerminator());
19 }
20
21 if (BI && BI->isConditional()) {
22 assert((BI->getSuccessor(0) != BI->getSuccessor(1)) &&
23 "Both outgoing branches should not target same header!");
24 return dyn_cast<ICmpInst>(BI->getCondition());
25 }
26
27 return nullptr;
28}
29
30} // namespace ftg

Callers 3

getTrackingVariableMethod · 0.85
getRelatedIndVMethod · 0.85
handleUserMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected