[all-commits] [llvm/llvm-project] 7cddd1: [SelectionDAG] Optimize build_vector of truncates ...

Seebi via All-commits all-commits at lists.llvm.org
Mon Feb 10 06:04:38 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 7cddd15e5616a1872106a6664e1d622a3adad7cc
      https://github.com/llvm/llvm-project/commit/7cddd15e5616a1872106a6664e1d622a3adad7cc
  Author: Sebastian Neubauer <sebastian.neubauer at amd.com>
  Date:   2020-02-10 (Mon, 10 Feb 2020)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/test/CodeGen/AMDGPU/scalar_to_vector.ll
    M llvm/test/CodeGen/AMDGPU/vector_shuffle.packed.ll

  Log Message:
  -----------
  [SelectionDAG] Optimize build_vector of truncates and shifts

Add a simplification to fuse a manual vector extract with shifts and
truncate into a bitcast.

Unpacking and packing values into vectors is only optimized with
extractelement instructions, not when manually unpacked using shifts
and truncates.
This patch simplifies shifts and truncates into a bitcast if possible.

Simplify (build_vec (trunc $1)
                    (trunc (srl $1 width))
                    (trunc (srl $1 (2 * width))) ...)
to (bitcast $1)

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




More information about the All-commits mailing list