[PATCH] D135876: [VectorCombine] Scalarize binops with insertelt nested inside splats

Matt Devereau via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 13 07:27:51 PDT 2022


MattDevereau created this revision.
MattDevereau added reviewers: peterwaller-arm, c-rhodes, dtemirbulatov, paulwalker-arm, david-arm, benmxwl-arm.
Herald added a subscriber: hiraditya.
Herald added a project: All.
MattDevereau requested review of this revision.
Herald added subscribers: llvm-commits, pcwang-thead.
Herald added a project: LLVM.

where a, b are scalar values, VectorCombine:

  shufflevector(vector binop (shufflevector(insertelt(undef, a, 0),
                                                                         undef,
                                                                         zeroinitializer),
                                                 insertelt(undef, b, 0)),
                          undef,
                          zeroinitializer)

to

  shufflevector(insertelt(undef, binop (a, b), 0), undef, zeroinitializer)
   

This elimates series of unnecessary vectorized shufflevectors and insertelements
which can result in pointless vectorized bin ops later on, and replaces them
with scalar binops.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D135876

Files:
  llvm/lib/Transforms/Vectorize/VectorCombine.cpp
  llvm/test/Transforms/VectorCombine/AArch64/insert-shuffle-binop.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135876.467463.patch
Type: text/x-patch
Size: 13731 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221013/3099e368/attachment.bin>


More information about the llvm-commits mailing list