[PATCH] D14263: [LVI] Clarify invariants, common code, and fix latent bugs

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 2 15:50:45 PST 2015


reames created this revision.
reames added reviewers: hfinkel, sanjoy.
reames added a subscriber: llvm-commits.

This patch includes a couple of small changes needed for a follow on patch.  One them fixes a latent bug (which I believe is unreachable today).

Changes are:
1) Ensure that calling getValueInBlock with a constant works.  It's trivial, but there's nothing preventing this getting called in the outer layers.  Additionally, we've been apparently re-querying the outermost block on each access.  This is a waste of compile time and (hopefully) will produce the same result as using the previously cached result.
2) Use the full power of the getValueInBlock interface for getValueAt when the query instruction is at the end of a block.  I don't know of a test case which clearly illustrates this difference, but in principal, we may be able to remove a few extra comparisons after this change.  The main reason for this is to better test existing code paths.
3) Fix a bug exposed by (2) where we weren't actually using the range metadata results within the getValueInBlock solving.  

http://reviews.llvm.org/D14263

Files:
  lib/Analysis/LazyValueInfo.cpp
  test/Transforms/CorrelatedValuePropagation/basic.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14263.38996.patch
Type: text/x-patch
Size: 5696 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151102/0a5a0819/attachment.bin>


More information about the llvm-commits mailing list