[PATCH] D25075: [JumpThreading] Allow threading over loop headers when creating single block loops

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 3 12:03:15 PDT 2016


reames requested changes to this revision.
reames added a comment.
This revision now requires changes to proceed.

Commenting mostly on the LVI parts to start with.  I request that you split those out into a separate change with tests.



> LazyValueInfo.cpp:927
> +
> +    if (PhiVal == PN)
> +      // Identity: we cannot contribute to our own range.

Nope.  This will break key parts about LVI.  The problem here is that there can be facts learned about the Phi along a particular path.  The classic example is the backedge test of a loop can tell you that the value along the backedge is restricted to say < 400.

> LazyValueInfo.cpp:931
> +    
> +    if (Result.isConstant() || Result.isConstantRange()) {
> +      // Can we determine this is a monotonically increasing increment?

I see where you're going here, but this is the wrong way to structure this.  You've got two reasonable approaches:

1. Compute the existing result and then intersect it with the result computed this way
2. Integrate this into the path sensitive logic.  Doing this as the base case (i.e. instead of overdefined) might be reasonable.

Repository:
  rL LLVM

https://reviews.llvm.org/D25075





More information about the llvm-commits mailing list