mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-09-30 19:55:11 +00:00
An add recurrence is loop-invariant in any loop inside of its
associated loop. This avoids potentially expensive traversals of the add recurrence's operands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111034 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
31529c7b6c
commit
71c4144076
@ -303,6 +303,10 @@ bool SCEVAddRecExpr::isLoopInvariant(const Loop *QueryLoop) const {
|
||||
if (QueryLoop->contains(L))
|
||||
return false;
|
||||
|
||||
// This recurrence is invariant w.r.t. QueryLoop if L contains QueryLoop.
|
||||
if (L->contains(QueryLoop))
|
||||
return true;
|
||||
|
||||
// This recurrence is variant w.r.t. QueryLoop if any of its operands
|
||||
// are variant.
|
||||
for (unsigned i = 0, e = getNumOperands(); i != e; ++i)
|
||||
|
Loading…
Reference in New Issue
Block a user