mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-22 10:24:26 +00:00
[LoopUnrollRuntime] Avoid high-cost trip count computation.
Summary: Runtime unrolling of loops needs to emit an expression to compute the loop's runtime trip-count. Avoid runtime unrolling if this computation will be expensive. Depends on D8993. Reviewers: atrick Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D8994 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234846 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -165,6 +165,7 @@ namespace {
|
||||
UP.MaxCount = UINT_MAX;
|
||||
UP.Partial = CurrentAllowPartial;
|
||||
UP.Runtime = CurrentRuntime;
|
||||
UP.AllowExpensiveTripCount = false;
|
||||
TTI.getUnrollingPreferences(L, UP);
|
||||
}
|
||||
|
||||
@ -886,8 +887,8 @@ bool LoopUnroll::runOnLoop(Loop *L, LPPassManager &LPM) {
|
||||
}
|
||||
|
||||
// Unroll the loop.
|
||||
if (!UnrollLoop(L, Count, TripCount, AllowRuntime, TripMultiple, LI, this,
|
||||
&LPM, &AC))
|
||||
if (!UnrollLoop(L, Count, TripCount, AllowRuntime, UP.AllowExpensiveTripCount,
|
||||
TripMultiple, LI, this, &LPM, &AC))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user