[all-commits] [llvm/llvm-project] 6e5628: [DAGCombine] reduceBuildVecToShuffle(): sort input...

Roman Lebedev via All-commits all-commits at lists.llvm.org
Mon Jun 14 06:19:27 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6e5628354e22f3ca40b04295bac540843b8e6482
      https://github.com/llvm/llvm-project/commit/6e5628354e22f3ca40b04295bac540843b8e6482
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2021-06-14 (Mon, 14 Jun 2021)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/test/CodeGen/X86/oddshuffles.ll

  Log Message:
  -----------
  [DAGCombine] reduceBuildVecToShuffle(): sort input vectors by decreasing size

The sorting, obviously, must be stable, else we will have random assembly fluctuations.

Apparently there was no test coverage that would benefit from that,
so i've added one test.

The sorting consists of two parts - just sort the input vectors,
and recompute the shuffle mask -> input vector mapping.
I don't believe we need to do anything else.

Reviewed By: RKSimon

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




More information about the All-commits mailing list