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

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 19 08:26:45 PDT 2019


spatel added a comment.

In D69127#1715640 <https://reviews.llvm.org/D69127#1715640>, @spatel wrote:

> This patch would already have hoisted the zext ahead of the i32 ctpop in that basic example, but if we had started with this i32 code, then we'd widen to i64 ctpop because we assume it's no more expensive than i32 ctpop+zext. For the PPC examples, the zext becomes a mask op, so we eliminate that instruction.


Oops - that last part was wrong. (And there's already a test for i32 -> i64.) Since PPC has legal ops for both types, we won't do anything for that pattern.


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

https://reviews.llvm.org/D69127





More information about the llvm-commits mailing list