[PATCH] D69127: [DAGCombiner] widen zext of popcount based on target support

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 18 14:05:10 PDT 2019


spatel added a comment.

In D69127#1715078 <https://reviews.llvm.org/D69127#1715078>, @jsji wrote:

> LGTM. Thanks. 
>  Do we want to consider `any_extend` as well?


I guess that's possible (convert the anyext to zext?) although I'm not sure how to create a test case.

For example, if we had:
i16 = anyext (i8 = ctpop 0xF0)

The result must be "i16 0x??04" because we only know the value of the lower bits exactly.

i16 = ctpop (i16 = zext 0xF0)

The result must be "i16 0x0004", so it's more defined than the original, but it's probably still a perf win to use a supported ctpop operation?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69127/new/

https://reviews.llvm.org/D69127





More information about the llvm-commits mailing list