[all-commits] [llvm/llvm-project] 6ace81: [VectorCombine] add test with out-of-bounds insert...

Sanjay Patel via All-commits all-commits at lists.llvm.org
Mon Oct 10 12:00:17 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6ace81db3ad95fac87fd1afea7ef44b373188e83
      https://github.com/llvm/llvm-project/commit/6ace81db3ad95fac87fd1afea7ef44b373188e83
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-10-10 (Mon, 10 Oct 2022)

  Changed paths:
    M llvm/test/Transforms/VectorCombine/X86/extract-fneg-insert.ll

  Log Message:
  -----------
  [VectorCombine] add test with out-of-bounds insert/extract index; NFC

D135278


  Commit: baab4aa1ba5f68634b4936375e19c8686b1b474a
      https://github.com/llvm/llvm-project/commit/baab4aa1ba5f68634b4936375e19c8686b1b474a
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-10-10 (Mon, 10 Oct 2022)

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

  Log Message:
  -----------
  [VectorCombine] convert scalar fneg with insert/extract to vector fneg

insertelt DestVec, (fneg (extractelt SrcVec, Index)), Index --> shuffle DestVec, (fneg SrcVec), Mask

This is a specialized form of what could be a more general fold for a binop.
It's also possible that fneg is overlooked by SLP in this kind of
insert/extract pattern since it's a unary op.

This shows up in the motivating example from #issue 58139, but it won't solve
it (that probably requires some x86-specific backend changes). There are also
some small enhancements (see TODO comments) that can be done as follow-up
patches.

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


Compare: https://github.com/llvm/llvm-project/compare/e66cfb63ceed...baab4aa1ba5f


More information about the All-commits mailing list