diff options
| author | Haicheng Wu <haicheng@codeaurora.org> | 2016-10-27 18:40:02 +0000 |
|---|---|---|
| committer | Haicheng Wu <haicheng@codeaurora.org> | 2016-10-27 18:40:02 +0000 |
| commit | 430b3e48931d242fe22f4d8a1f76c0b953319a4a (patch) | |
| tree | 5ed969d7e094461373f3fd1569d1f566b5226c8c /llvm/lib/Transforms | |
| parent | d23219b9eef48776e61a1423a1549489c72dbf7a (diff) | |
| download | bcm5719-llvm-430b3e48931d242fe22f4d8a1f76c0b953319a4a.tar.gz bcm5719-llvm-430b3e48931d242fe22f4d8a1f76c0b953319a4a.zip | |
[LoopUnroll] Check partial unrolling is enabled before initialization. NFC.
Differential Revision: https://reviews.llvm.org/D23891
llvm-svn: 285330
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp index 9c55ee373ef..b351e09a43d 100644 --- a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp +++ b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp @@ -803,8 +803,6 @@ static bool computeUnrollCount( // 4rd priority is partial unrolling. // Try partial unroll only when TripCount could be staticaly calculated. if (TripCount) { - if (UP.Count == 0) - UP.Count = TripCount; UP.Partial |= ExplicitUnroll; if (!UP.Partial) { DEBUG(dbgs() << " will not try to unroll partially because " @@ -812,6 +810,8 @@ static bool computeUnrollCount( UP.Count = 0; return false; } + if (UP.Count == 0) + UP.Count = TripCount; if (UP.PartialThreshold != NoThreshold) { // Reduce unroll count to be modulo of TripCount for partial unrolling. UnrolledSize = (uint64_t)(LoopSize - BEInsns) * UP.Count + BEInsns; |

