[all-commits] [llvm/llvm-project] e6c145: [DAGCombiner] widen zext of popcount based on targ...

RotateRight via All-commits all-commits at lists.llvm.org
Fri Oct 25 11:11:06 PDT 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: e6c145e0548e3b3de6eab27e44e1504387cf6b53
      https://github.com/llvm/llvm-project/commit/e6c145e0548e3b3de6eab27e44e1504387cf6b53
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2019-10-25 (Fri, 25 Oct 2019)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/test/CodeGen/PowerPC/popcnt-zext.ll

  Log Message:
  -----------
  [DAGCombiner] widen zext of popcount based on target support

zext (ctpop X) --> ctpop (zext X)

This is a prerequisite step for canonicalizing in the other direction (narrow the popcount) in IR - PR43688:
https://bugs.llvm.org/show_bug.cgi?id=43688

I'm not sure if any other targets are affected, but I found a missing fold for PPC, so added tests based on that.
The reason we widen all the way to 64-bit in these tests is because the initial DAG looks something like this:

  t5: i8 = ctpop t4
  t6: i32 = zero_extend t5  <-- created based on IR, but unused node?
    t7: i64 = zero_extend t5

Differential Revision: https://reviews.llvm.org/D69127




More information about the All-commits mailing list