diff options
author | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2018-03-30 16:55:44 +0000 |
---|---|---|
committer | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2018-03-30 16:55:44 +0000 |
commit | fce30c2ba3aaf646c8adb79db86e3a32748912e7 (patch) | |
tree | dbbfb512ef8444a45ec9f430c0f442efc5a2e943 /llvm/lib | |
parent | 74e2974ac6af988922c7bd2edf3c70531c03c798 (diff) | |
download | bcm5719-llvm-fce30c2ba3aaf646c8adb79db86e3a32748912e7.tar.gz bcm5719-llvm-fce30c2ba3aaf646c8adb79db86e3a32748912e7.zip |
Revert "peel loops with runtime small trip counts"
This reverts commit r328854, it breaks some Hexagon tests.
llvm-svn: 328875
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp | 8 | ||||
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopUnrollPeel.cpp | 7 |
2 files changed, 1 insertions, 14 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp b/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp index 51aab0b635a..3290b5931ad 100644 --- a/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp +++ b/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp @@ -44,14 +44,6 @@ HexagonTTIImpl::getPopcntSupport(unsigned IntTyWidthInBit) const { void HexagonTTIImpl::getUnrollingPreferences(Loop *L, ScalarEvolution &SE, TTI::UnrollingPreferences &UP) { UP.Runtime = UP.Partial = true; - // Only try to peel innermost loops with small runtime trip counts. - if (L && L->empty() && - SE.getSmallConstantTripCount(L) == 0 && - SE.getSmallConstantMaxTripCount(L) > 0 && - SE.getSmallConstantMaxTripCount(L) <= 5) { - UP.PeelCount = 2; - UP.AllowPeeling = true; - } } bool HexagonTTIImpl::shouldFavorPostInc() const { diff --git a/llvm/lib/Transforms/Utils/LoopUnrollPeel.cpp b/llvm/lib/Transforms/Utils/LoopUnrollPeel.cpp index cfbecd59af3..5f465f328b0 100644 --- a/llvm/lib/Transforms/Utils/LoopUnrollPeel.cpp +++ b/llvm/lib/Transforms/Utils/LoopUnrollPeel.cpp @@ -221,9 +221,6 @@ void llvm::computePeelCount(Loop *L, unsigned LoopSize, TargetTransformInfo::UnrollingPreferences &UP, unsigned &TripCount, ScalarEvolution &SE) { assert(LoopSize > 0 && "Zero loop size is not allowed!"); - // Save the UP.PeelCount value set by the target in - // TTI.getUnrollingPreferences or by the flag -unroll-peel-count. - unsigned TargetPeelCount = UP.PeelCount; UP.PeelCount = 0; if (!canPeel(L)) return; @@ -243,9 +240,7 @@ void llvm::computePeelCount(Loop *L, unsigned LoopSize, SmallDenseMap<PHINode *, unsigned> IterationsToInvariance; // Now go through all Phis to calculate their the number of iterations they // need to become invariants. - // Start the max computation with the UP.PeelCount value set by the target - // in TTI.getUnrollingPreferences or by the flag -unroll-peel-count. - unsigned DesiredPeelCount = TargetPeelCount; + unsigned DesiredPeelCount = 0; BasicBlock *BackEdge = L->getLoopLatch(); assert(BackEdge && "Loop is not in simplified form?"); for (auto BI = L->getHeader()->begin(); isa<PHINode>(&*BI); ++BI) { |