OSDN Git Service

[MSSA] Fix a caching bug.
authorGeorge Burgess IV <george.burgess.iv@gmail.com>
Wed, 3 Aug 2016 01:22:19 +0000 (01:22 +0000)
committerGeorge Burgess IV <george.burgess.iv@gmail.com>
Wed, 3 Aug 2016 01:22:19 +0000 (01:22 +0000)
commit265028f005a547acc8c5e66b5a2126b36bdfbb06
tree41a82cb4965228a859a794ff6d27c7818e0e01e6
parent4e5f8f5f4687f83c62567530ac2dc6cb2c214273
[MSSA] Fix a caching bug.

This fixes a bug where we'd sometimes cache overly-conservative results
with our walker. This bug was made more obvious by r277480, which makes
our cache far more spotty than it was. Test case is llvm-unit, because
we're likely going to use CachingWalker only for def optimization in the
future.

The bug stems from that there was a place where the walker assumed that
`DefNode.Last` was a valid target to cache to when failing to optimize
phis. This is sometimes incorrect if we have a cache hit. The fix is to
use the thing we *can* assume is a valid target to cache to. :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277559 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/MemorySSA.cpp
unittests/Transforms/Utils/MemorySSA.cpp