[all-commits] [llvm/llvm-project] a69158: [VectorCombine] fold extract-extract-op with diffe...

RotateRight via All-commits all-commits at lists.llvm.org
Sun Mar 8 07:00:33 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: a69158c12acd635ee4bcb22b1060d92b29483042
      https://github.com/llvm/llvm-project/commit/a69158c12acd635ee4bcb22b1060d92b29483042
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2020-03-08 (Sun, 08 Mar 2020)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/VectorCombine.cpp
    M llvm/test/Transforms/VectorCombine/X86/extract-binop.ll
    M llvm/test/Transforms/VectorCombine/X86/extract-cmp.ll

  Log Message:
  -----------
  [VectorCombine] fold extract-extract-op with different extraction indexes

opcode (extelt V0, Ext0), (ext V1, Ext1) --> extelt (opcode (splat V0, Ext0), V1), Ext1

The first part of this patch generalizes the cost calculation to accept
different extraction indexes. The second part creates a shuffle+extract
before feeding into the existing code to create a vector op+extract.

The patch conservatively uses "TargetTransformInfo::SK_PermuteSingleSrc"
rather than "TargetTransformInfo::SK_Broadcast" (splat specifically
from element 0) because we do not have a more general "SK_Splat"
currently. That does not affect any of the current regression tests,
but we might be able to find some cost model target specialization where
that comes into play.

I suspect that we can expose some missing x86 horizontal op codegen with
this transform, so I'm speculatively adding a debug flag to disable the
binop variant of this transform to allow easier testing.

The test changes show that we're sensitive to cost model diffs (as we
should be), so that means that patches like D74976
should have better coverage.

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




More information about the All-commits mailing list