[llvm] [ValueTracking] Add support for `vector_reduce_{s, u}{min, max}` in `isKnownNonZero`/`computeKnownBits`. (PR #88169)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 9 22:22:09 PDT 2024


nikic wrote:

> > I think some basic support here could be reasonable, but this implementation looks too precise. In particular, I think the approach of doing a per-element evaluation of the vector is unprecedented -- we generally only look at all (demanded) elements as a unit.
> > So the implementation I'd expect would be more something along the lines of taking the known bits of the input vector and using those as the result known bits as well. (For min/max reductions that is, not quite that simple for some of the other ones.)
> 
> for `min`/`max`/`or` its pretty easy to do a reasonable job w.o per-ele, but that kind of prohibits things like `xor`/`add`/etc... Are you opposed to those being added in general?

Yeah, I don't think we should do them if they require per-element reasoning to do something worthwhile. We can at least handle and/or though (and only in KnownBits).

https://github.com/llvm/llvm-project/pull/88169


More information about the llvm-commits mailing list