summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@codeaurora.org>2015-12-14 14:44:06 +0000
committerChad Rosier <mcrosier@codeaurora.org>2015-12-14 14:44:06 +0000
commitbc9d4f9947ee5cd2dc686547477f77797a895b3e (patch)
tree9d32c74f25bbc212046dbba7eaf86592ca0d377f
parentac764fabb8fd3e0af3e2e2b6faddacdc6a698ae3 (diff)
downloadbcm5719-llvm-bc9d4f9947ee5cd2dc686547477f77797a895b3e.tar.gz
bcm5719-llvm-bc9d4f9947ee5cd2dc686547477f77797a895b3e.zip
[PPC] Early exit loop. NFC.
llvm-svn: 255497
-rw-r--r--llvm/lib/Target/PowerPC/PPCISelLowering.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
index 176a8b3ea59..242c1ea3309 100644
--- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
+++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -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;
OpenPOWER on IntegriCloud