mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
Revert "[C++11] Add predecessors(BasicBlock *) / successors(BasicBlock *) iterator ranges."
This reverts commit r213474 (and r213475), which causes a miscompile on a stage2 LTO build. I'll reply on the list in a moment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213562 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -328,10 +328,11 @@ bool llvm::UnrollLoop(Loop *L, unsigned Count, unsigned TripCount,
|
||||
L->addBasicBlockToLoop(New, LI->getBase());
|
||||
|
||||
// Add phi entries for newly created values to all exit blocks.
|
||||
for (BasicBlock *Succ : successors(*BB)) {
|
||||
if (L->contains(Succ))
|
||||
for (succ_iterator SI = succ_begin(*BB), SE = succ_end(*BB);
|
||||
SI != SE; ++SI) {
|
||||
if (L->contains(*SI))
|
||||
continue;
|
||||
for (BasicBlock::iterator BBI = Succ->begin();
|
||||
for (BasicBlock::iterator BBI = (*SI)->begin();
|
||||
PHINode *phi = dyn_cast<PHINode>(BBI); ++BBI) {
|
||||
Value *Incoming = phi->getIncomingValueForBlock(*BB);
|
||||
ValueToValueMapTy::iterator It = LastValueMap.find(Incoming);
|
||||
@ -413,10 +414,11 @@ bool llvm::UnrollLoop(Loop *L, unsigned Count, unsigned TripCount,
|
||||
// Remove phi operands at this loop exit
|
||||
if (Dest != LoopExit) {
|
||||
BasicBlock *BB = Latches[i];
|
||||
for (BasicBlock *Succ : successors(BB)) {
|
||||
if (Succ == Headers[i])
|
||||
for (succ_iterator SI = succ_begin(BB), SE = succ_end(BB);
|
||||
SI != SE; ++SI) {
|
||||
if (*SI == Headers[i])
|
||||
continue;
|
||||
for (BasicBlock::iterator BBI = Succ->begin();
|
||||
for (BasicBlock::iterator BBI = (*SI)->begin();
|
||||
PHINode *Phi = dyn_cast<PHINode>(BBI); ++BBI) {
|
||||
Phi->removeIncomingValue(BB, false);
|
||||
}
|
||||
|
Reference in New Issue
Block a user