[PATCH] Use invariants in LazyValueInfo
Philip Reames
listmail at philipreames.com
Wed Jul 16 16:54:10 PDT 2014
Worth noting is that your "small addition to JumpThreading" is going to
be a general maintenance burden imposed by your approach. We'll have to
make other such "small additions" throughout the optimizer when
recognizing control flow patterns.
We should probably think about some form of placement canonicalization
for them to reduce this burden.
Philip
On 07/14/2014 11:46 PM, hfinkel at anl.gov wrote:
> Hi chandlerc,
>
> This patch teaches LazyValueInfo to use the invariant intrinsic. Like with the known-bits patch, this requires feeding a "context" instruction pointer through many functions. Aside from a little refactoring to reuse the logic that turns predicates into constant ranges in LVI, the only new code is that which can 'merge' the range from an invariant into that otherwise computed. There is also a small addition to JumpThreading so that it can have LVI use invariants in the same block as the comparison feeding a conditional branch.
>
> With this patch, we can now simplify this as expected:
> int foo(int a) {
> __builtin_assume(a > 5);
> if (a > 3) {
> bar();
> return 1;
> }
> return 0;
> }
>
> http://reviews.llvm.org/D4511
>
> Files:
> include/llvm/Analysis/LazyValueInfo.h
> lib/Analysis/LazyValueInfo.cpp
> lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
> lib/Transforms/Scalar/JumpThreading.cpp
> test/Transforms/JumpThreading/invariants.ll
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140716/27530d43/attachment.html>
More information about the llvm-commits
mailing list