[PATCH] D87005: [ScalarizeMaskedMemIntrin] Scalarize constant mask load as shuffle(build_vector,pass_through)

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 2 03:47:35 PDT 2020


RKSimon created this revision.
RKSimon added reviewers: spatel, craig.topper, efriedma.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.
RKSimon requested review of this revision.

As noticed on D66004 <https://reviews.llvm.org/D66004>, scalarization of a load with a constant mask as a chain of irregular loads+inserts makes it difficult to optimize before lowering, resulting in difficulties in merging loads etc.

This patch instead scalarizes the expansion to a build_vector(load0, load1, undef, load2,....) style pattern and then performs a blend shuffle with the pass through vector. This allows us to more easily make use of all the build_vector combines, merging of consecutive loads etc.

There's a couple of regressions that I'm still looking at where we can better combine an element insertion with the final blend, and also a few places where shuffle combining forgets which elements are already zero.

Followup to D85416 <https://reviews.llvm.org/D85416>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D87005

Files:
  llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp
  llvm/test/CodeGen/X86/masked_load.ll
  llvm/test/Transforms/ScalarizeMaskedMemIntrin/AArch64/expand-masked-load.ll
  llvm/test/Transforms/ScalarizeMaskedMemIntrin/X86/expand-masked-load.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87005.289388.patch
Type: text/x-patch
Size: 11680 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200902/b385a7df/attachment-0001.bin>


More information about the llvm-commits mailing list