diff options
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/MachineBlockPlacement.cpp | 5 | 
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineBlockPlacement.cpp b/llvm/lib/CodeGen/MachineBlockPlacement.cpp index 4cbc94e0b7d..0d15e8a726f 100644 --- a/llvm/lib/CodeGen/MachineBlockPlacement.cpp +++ b/llvm/lib/CodeGen/MachineBlockPlacement.cpp @@ -488,7 +488,10 @@ MachineBasicBlock *MachineBlockPlacement::getFirstUnplacedBlock(        continue;      if (BlockToChain[I] != &PlacedChain) {        PrevUnplacedBlockIt = I; -      return I; +      // Now select the head of the chain to which the unplaced block belongs +      // as the block to place. This will force the entire chain to be placed, +      // and satisfies the requirements of merging chains. +      return *BlockToChain[I]->begin();      }    }    return 0;  | 

