BreakCriticalEdges.cpp (198892) | BreakCriticalEdges.cpp (201360) |
---|---|
1//===- BreakCriticalEdges.cpp - Critical Edge Elimination Pass ------------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 295 unchanged lines hidden (view full) --- 304 if (LoopInfo *LI = P->getAnalysisIfAvailable<LoopInfo>()) { 305 if (Loop *TIL = LI->getLoopFor(TIBB)) { 306 // If one or the other blocks were not in a loop, the new block is not 307 // either, and thus LI doesn't need to be updated. 308 if (Loop *DestLoop = LI->getLoopFor(DestBB)) { 309 if (TIL == DestLoop) { 310 // Both in the same loop, the NewBB joins loop. 311 DestLoop->addBasicBlockToLoop(NewBB, LI->getBase()); | 1//===- BreakCriticalEdges.cpp - Critical Edge Elimination Pass ------------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 295 unchanged lines hidden (view full) --- 304 if (LoopInfo *LI = P->getAnalysisIfAvailable<LoopInfo>()) { 305 if (Loop *TIL = LI->getLoopFor(TIBB)) { 306 // If one or the other blocks were not in a loop, the new block is not 307 // either, and thus LI doesn't need to be updated. 308 if (Loop *DestLoop = LI->getLoopFor(DestBB)) { 309 if (TIL == DestLoop) { 310 // Both in the same loop, the NewBB joins loop. 311 DestLoop->addBasicBlockToLoop(NewBB, LI->getBase()); |
312 } else if (TIL->contains(DestLoop->getHeader())) { | 312 } else if (TIL->contains(DestLoop)) { |
313 // Edge from an outer loop to an inner loop. Add to the outer loop. 314 TIL->addBasicBlockToLoop(NewBB, LI->getBase()); | 313 // Edge from an outer loop to an inner loop. Add to the outer loop. 314 TIL->addBasicBlockToLoop(NewBB, LI->getBase()); |
315 } else if (DestLoop->contains(TIL->getHeader())) { | 315 } else if (DestLoop->contains(TIL)) { |
316 // Edge from an inner loop to an outer loop. Add to the outer loop. 317 DestLoop->addBasicBlockToLoop(NewBB, LI->getBase()); 318 } else { 319 // Edge from two loops with no containment relation. Because these 320 // are natural loops, we know that the destination block must be the 321 // header of its loop (adding a branch into a loop elsewhere would 322 // create an irreducible loop). 323 assert(DestLoop->getHeader() == DestBB && --- 67 unchanged lines hidden --- | 316 // Edge from an inner loop to an outer loop. Add to the outer loop. 317 DestLoop->addBasicBlockToLoop(NewBB, LI->getBase()); 318 } else { 319 // Edge from two loops with no containment relation. Because these 320 // are natural loops, we know that the destination block must be the 321 // header of its loop (adding a branch into a loop elsewhere would 322 // create an irreducible loop). 323 assert(DestLoop->getHeader() == DestBB && --- 67 unchanged lines hidden --- |