diff options
| author | Sanjoy Das <sanjoy@playingwithpointers.com> | 2017-10-13 17:13:44 +0000 |
|---|---|---|
| committer | Sanjoy Das <sanjoy@playingwithpointers.com> | 2017-10-13 17:13:44 +0000 |
| commit | c70a7a02ea091d8430b36e1258597483f68897a8 (patch) | |
| tree | 296e482dc4be87536ca9eb788eee2453c6d7d0a6 /llvm/lib/CodeGen | |
| parent | 7ccaff7db01464a88f4bf550c7928e7754fed00c (diff) | |
| download | bcm5719-llvm-c70a7a02ea091d8430b36e1258597483f68897a8.tar.gz bcm5719-llvm-c70a7a02ea091d8430b36e1258597483f68897a8.zip | |
[SCEV] Maintain and use a loop->loop invalidation dependency
Summary:
This change uses the loop use list added in the previous change to remember the
loops that appear in the trip count expressions of other loops; and uses it in
forgetLoop. This lets us not scan every loop in the function on a forgetLoop
call.
With this change we no longer invalidate clear out backedge taken counts on
forgetValue. I think this is fine -- the contract is that SCEV users must call
forgetLoop(L) if their change to the IR could have changed the trip count of L;
solely calling forgetValue on a value feeding into the backedge condition of L
is not enough. Moreover, I don't think we can strengthen forgetValue to be
sufficient for invalidating trip counts without significantly re-architecting
SCEV. For instance, if we have the loop:
I = *Ptr;
E = I + 10;
do {
// ...
} while (++I != E);
then the backedge taken count of the loop is 9, and it has no reference to
either I or E, i.e. there is no way in SCEV today to re-discover the dependency
of the loop's trip count on E or I. So a SCEV client cannot change E to (say)
"I + 20", call forgetValue(E) and expect the loop's trip count to be updated.
Reviewers: atrick, sunfish, mkazantsev
Subscribers: mcrosier, llvm-commits
Differential Revision: https://reviews.llvm.org/D38435
llvm-svn: 315713
Diffstat (limited to 'llvm/lib/CodeGen')
0 files changed, 0 insertions, 0 deletions

