[PATCH] D14476: [LVI] Introduce an intersect operation on lattice values

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 6 19:32:29 PST 2015


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

LVI has several separate sources of facts - edge local conditions, recursive queries, assumes, and control independent value facts - which all apply to the same value at the same location.  The existing implementation was very conservative about exploiting all of these facts at once. 

This change introduces an "intersect" function specifically to abstract the action of picking a good set of facts from all of the separate facts given.  At the moment, this function is relatively simple (i.e. mostly just reuses the bits which were already there), but even the minor additions reveal the inherent power.  For example, JumpThreading is now capable of doing an inductive proof that a particular value is always positive and removing a half range check.  

I'm currently only using the new intersect function in one place.  If folks are happy with the direction of the work, I plan on making a series of small changes without review to replace mergeIn with intersect at all the appropriate places.  

http://reviews.llvm.org/D14476

Files:
  lib/Analysis/LazyValueInfo.cpp
  test/Transforms/CorrelatedValuePropagation/conflict.ll
  test/Transforms/JumpThreading/induction.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14476.39625.patch
Type: text/x-patch
Size: 8965 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151107/fe660ccf/attachment.bin>


More information about the llvm-commits mailing list