[llvm] r303387 - [InstCombine] add more tests for xor-of-icmps; NFC

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Fri May 19 11:00:23 PDT 2017


On Fri, May 19, 2017 at 10:00 AM, Sanjay Patel <spatel at rotateright.com> wrote:
> Is "VRP" (value range propagation) in LLVM-speak "CVP" (correlated value
> propagation)?
>
> If so, we have this comment regarding compares:
>   // As a policy choice, we choose not to waste compile time on anything
> where
>   // the comparison is testing local values.
>
> Or this for div/rem:
>   // As a policy choice, we choose not
>   // to waste compile time on anything where the operands are local defs.
>
> "Local" means in the same basic block from what I can tell by the code here.
>
> I think this means that this pass explicitly defers handling simple cases
> like:
> https://reviews.llvm.org/D33342
> ...to another pass, and currently that pass is InstCombine (because the
> patterns really can't be any simpler than the tests in that patch, right?).
>
> I think that improving compile-time should not preclude improving
> InstCombine. We should do both.
>

Just thoughts, feel free to ignore them.
I didn't measure the impact in LLVM, but I'm sure you can do VRP
relatively fast (GCC does that both interprocedurally and
intraprocedurally and their pass is much faster in some cases than
LLVM's), i.e. O(N) in practice, so, maybe we could re-evaluate this
policy?
I think replacing a pass in LLVM is not trivial (I'm learning it the
hard way with NewGVN). OTOH, I'm still not entirely convinced
`InstCombine` should handle these cases given it's already a
compile-time sink?

--
Davide


More information about the llvm-commits mailing list