[PPC] Early exit loop. NFC.

llvm-svn: 255497
This commit is contained in:
Chad Rosier 2015-12-14 14:44:06 +00:00
parent ac764fabb8
commit bc9d4f9947
1 changed files with 4 additions and 1 deletions

View File

@ -10801,8 +10801,11 @@ unsigned PPCTargetLowering::getPrefLoopAlignment(MachineLoop *ML) const {
// boundary so that the entire loop fits in one instruction-cache line.
uint64_t LoopSize = 0;
for (auto I = ML->block_begin(), IE = ML->block_end(); I != IE; ++I)
for (auto J = (*I)->begin(), JE = (*I)->end(); J != JE; ++J)
for (auto J = (*I)->begin(), JE = (*I)->end(); J != JE; ++J) {
LoopSize += TII->GetInstSizeInBytes(J);
if (LoopSize > 32)
break;
}
if (LoopSize > 16 && LoopSize <= 32)
return 5;