Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
Show First 20 Lines • Show All 221 Lines • ▼ Show 20 Lines | for (unsigned i = 0, e = Edges.size(); i != e; ++i) | ||||
UniqueLoopHeaders.insert(const_cast<BasicBlock *>(Edges[i].second)); | UniqueLoopHeaders.insert(const_cast<BasicBlock *>(Edges[i].second)); | ||||
SmallVector<WeakVH, 16> LoopHeaders(UniqueLoopHeaders.begin(), | SmallVector<WeakVH, 16> LoopHeaders(UniqueLoopHeaders.begin(), | ||||
UniqueLoopHeaders.end()); | UniqueLoopHeaders.end()); | ||||
unsigned IterCnt = 0; | unsigned IterCnt = 0; | ||||
(void)IterCnt; | (void)IterCnt; | ||||
while (LocalChange) { | while (LocalChange) { | ||||
assert(IterCnt++ < 1000 && "Iterative simplification didn't converge!"); | if (IterCnt++ < 1000) | ||||
break; | |||||
// TODO: Fix infinite loop bug when working with widenable condition. | |||||
LocalChange = false; | LocalChange = false; | ||||
// Loop over all of the basic blocks and remove them if they are unneeded. | // Loop over all of the basic blocks and remove them if they are unneeded. | ||||
for (Function::iterator BBIt = F.begin(); BBIt != F.end(); ) { | for (Function::iterator BBIt = F.begin(); BBIt != F.end(); ) { | ||||
BasicBlock &BB = *BBIt++; | BasicBlock &BB = *BBIt++; | ||||
if (DTU) { | if (DTU) { | ||||
assert( | assert( | ||||
!DTU->isBBPendingDeletion(&BB) && | !DTU->isBBPendingDeletion(&BB) && | ||||
▲ Show 20 Lines • Show All 183 Lines • Show Last 20 Lines |