[PATCH] D39361: [SCEV] A different fix for PR33494

Sanjoy Das via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 26 23:02:09 PDT 2017


sanjoy created this revision.
Herald added a subscriber: mcrosier.

I don't think https://reviews.llvm.org/rL309080 is the right fix for PR33494 -- caching ExitLimit only
hides the problem[0].  The real issue is that because of how we forget SCEV
expressions ScalarEvolution::getBackedgeTakenInfo, in the test case for PR33494
computing the backedge for any loop invalidates the trip count for every other
loop.  This effectively makes the SCEV cache useless.

I've instead made the SCEV expression invalidation in
ScalarEvolution::getBackedgeTakenInfo less aggressive to fix this issue.

[0]: One way to think about this is that https://reviews.llvm.org/rL309080 essentially augmented the
backedge-taken-count cache with another equivalent exit-limit cache.  The bug
went away because we were explicitly not clearing the exit-limit cache in
getBackedgeTakenInfo.  But instead of doing all of that, we can just avoid
clearing the backedge-taken-count cache.


https://reviews.llvm.org/D39361

Files:
  include/llvm/Analysis/ScalarEvolution.h
  lib/Analysis/ScalarEvolution.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39361.120540.patch
Type: text/x-patch
Size: 5780 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171027/0be8635a/attachment.bin>


More information about the llvm-commits mailing list