mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-30 20:24:32 +00:00
Avoid inserting noop's in the middle of a loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60141 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -64,8 +64,14 @@ bool LoopAligner::runOnMachineFunction(MachineFunction &MF) {
|
||||
|
||||
for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I) {
|
||||
MachineBasicBlock *MBB = I;
|
||||
if (MLI->isLoopHeader(MBB))
|
||||
if (MLI->isLoopHeader(MBB)) {
|
||||
MachineBasicBlock *PredBB = prior(I);
|
||||
if (MLI->getLoopFor(MBB) == MLI->getLoopFor(PredBB))
|
||||
// If previously BB is in the same loop, don't align this BB. We want
|
||||
// to prevent adding noop's inside a loop.
|
||||
continue;
|
||||
MBB->setAlignment(Align);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user