[all-commits] [llvm/llvm-project] 66d22b: [VectorCombine] fold shuffle-of-binops with common...

RotateRight via All-commits all-commits at lists.llvm.org
Thu Oct 21 09:38:10 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 66d22b4da4afe00c695d9714687aac8b9e4b7396
      https://github.com/llvm/llvm-project/commit/66d22b4da4afe00c695d9714687aac8b9e4b7396
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2021-10-21 (Thu, 21 Oct 2021)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/VectorCombine.cpp
    M llvm/test/Transforms/VectorCombine/X86/shuffle.ll

  Log Message:
  -----------
  [VectorCombine] fold shuffle-of-binops with common operand

shuf (bo X, Y), (bo X, W) --> bo (shuf X), (shuf Y, W)

This is motivated by an example in D111800
(although that patch avoids the problem for that particular example).

The pattern is shown in reduced form with:
https://llvm.org/PR52178
https://alive2.llvm.org/ce/z/d8zB4D

There is no difference on the PhaseOrdering test from D111800
because the aarch64 cost model says that the shuffle cost is 3 while
the fadd cost is 2.

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




More information about the All-commits mailing list