]> granicus.if.org Git - llvm/commit
[ScalarizeMaskedMemIntrin] Bitcast the mask to the scalar domain and use scalar bit...
authorCraig Topper <craig.topper@intel.com>
Wed, 31 Jul 2019 22:58:15 +0000 (22:58 +0000)
committerCraig Topper <craig.topper@intel.com>
Wed, 31 Jul 2019 22:58:15 +0000 (22:58 +0000)
commit87f53c9856f5c5ad08e71e4c88f0fe09edc8ab23
tree7d10174efcd4df308346bfc15b3f44b51a673d8e
parentd35aba9874725fd51560ca477656b06ceb3d43ea
[ScalarizeMaskedMemIntrin] Bitcast the mask to the scalar domain and use scalar bit tests for the branches.

X86 at least is able to use movmsk or kmov to move the mask to the scalar
domain. Then we can just use test instructions to test individual bits.

This is more efficient than extracting each mask element
individually.

I special cased v1i1 to use the previous behavior. This avoids
poor type legalization of bitcast of v1i1 to i1.

I've skipped expandload/compressstore as I think we need to
handle constant masks for those better first.

Many tests end up with duplicate test instructions due to tail
duplication in the branch folding pass. But the same thing
happens when constructing similar code in C. So its not unique
to the scalarization.

Not sure if this lowering code will also be good for other targets,
but we're only testing X86 today.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367489 91177308-0d34-0410-b5e6-96231b3b80d8
14 files changed:
lib/CodeGen/ScalarizeMaskedMemIntrin.cpp
test/CodeGen/X86/avx2-masked-gather.ll
test/CodeGen/X86/avx512-masked_memop-16-8.ll
test/CodeGen/X86/masked_gather.ll
test/CodeGen/X86/masked_gather_scatter.ll
test/CodeGen/X86/masked_gather_scatter_widen.ll
test/CodeGen/X86/masked_load.ll
test/CodeGen/X86/masked_store.ll
test/CodeGen/X86/masked_store_trunc.ll
test/CodeGen/X86/masked_store_trunc_ssat.ll
test/CodeGen/X86/masked_store_trunc_usat.ll
test/Transforms/ScalarizeMaskedMemIntrin/X86/expand-masked-gather.ll
test/Transforms/ScalarizeMaskedMemIntrin/X86/expand-masked-load.ll
test/Transforms/ScalarizeMaskedMemIntrin/X86/expand-masked-store.ll