[all-commits] [llvm/llvm-project] a3f50f: [X86] isVectorShiftByScalarCheap - vXi8 select(shi...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Thu Dec 23 06:30:21 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a3f50fb06dd467e54a62b371117eeecf88c78480
      https://github.com/llvm/llvm-project/commit/a3f50fb06dd467e54a62b371117eeecf88c78480
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2021-12-23 (Thu, 23 Dec 2021)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/test/Transforms/CodeGenPrepare/X86/vec-shift-inseltpoison.ll
    M llvm/test/Transforms/CodeGenPrepare/X86/vec-shift.ll
    M llvm/test/Transforms/CodeGenPrepare/X86/x86-shuffle-sink-inseltpoison.ll
    M llvm/test/Transforms/CodeGenPrepare/X86/x86-shuffle-sink.ll

  Log Message:
  -----------
  [X86] isVectorShiftByScalarCheap - vXi8 select(shift(x,splat0),shift(x,splat1)) is better than shift(x,select(splat0,splat1))

Even though we don't have vXi8 vector shifts (apart from XOP), it is still better to prefer shift (or funnel-shift/rotate) by scalar where possible.

https://llvm.godbolt.org/z/6ss6ffTxv

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




More information about the All-commits mailing list