[all-commits] [llvm/llvm-project] 03380c: [DAGCombine] Basic combines for AVG nodes.

David Green via All-commits all-commits at lists.llvm.org
Mon Feb 14 03:18:48 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 03380c70ed548224e2fd8280bc92f69d356d258c
      https://github.com/llvm/llvm-project/commit/03380c70ed548224e2fd8280bc92f69d356d258c
  Author: David Green <david.green at arm.com>
  Date:   2022-02-14 (Mon, 14 Feb 2022)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
    M llvm/test/CodeGen/AArch64/hadd-combine.ll
    M llvm/test/CodeGen/X86/pic-load-remat.ll

  Log Message:
  -----------
  [DAGCombine] Basic combines for AVG nodes.

This adds very basic combines for AVG nodes, mostly for constant folding
and handling degenerate (zero) cases. The code performs mostly the same
transforms as visitMULHS, adjusted for AVG nodes.

Constant folding extends to a higher bitwidth and drops the lowest bit.
For undef nodes, `avg undef, x` is transformed to x.  There is also a
transform for `avgfloor x, 0` transforming to `shr x, 1`.

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




More information about the All-commits mailing list