[llvm-dev] LazyValueInfo

Finkel, Hal J. via llvm-dev llvm-dev at lists.llvm.org
Mon Dec 17 06:32:06 PST 2018

On 12/17/18 4:19 AM, Markus Lavin via llvm-dev wrote:

I have been looking at using LazyValueInfo to improve BasicAA for some cases but have noted some issues with LVI

1. The interface (e.g. getConstantRange) seem to expect pointer-to-non-const objects which is a bit troublesome if you want to use the analysis from a place where you have pointer-to-const. Resorting to const_cast is obviously undesirable.

There are a number of interfaces that, for historical reasons, don't take const-qualified pointers (although they probably should). For some of these we've created wrappers to hide the const_casts (e.g., in ValueTracking).

2. Assumption patterns of the form ‘icmp <pred> (add Val, Offset)’ (https://github.com/llvm-mirror/llvm/blob/master/lib/Analysis/LazyValueInfo.cpp#L1097) will not make it through the assumption cache after commit https://github.com/llvm-mirror/llvm/commit/a6e44bd6350ff4aaa40b104abff1e28a9918ef87

Seems like an oversight (and a lack of sufficient regressions tests). Please feel free to submit a patch to fix this.

Is this something worth fixing or does this mean that LVI is not very much used and there might even be plans to remove/replace it in the future?

LVI is still very much in use (at least in JumpThreading and CorrelatedValuePropagation). I know that some people have discussed possible rewrites over the years, but I don't know of any immediate plans.



LLVM Developers mailing list
llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>

Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181217/d731611a/attachment.html>

More information about the llvm-dev mailing list