[PATCH] D43593: [X86] Add a custom legalization for (i16 (bitcast v16i1)) and (i32 (bitcast v32i1)) without AVX512 to prevent scalarization
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 21 13:56:56 PST 2018
craig.topper created this revision.
craig.topper added reviewers: spatel, RKSimon, zvi.
We have an early DAG combine to turn these patterns into MOVMSK, but that combine doesn't work if the vXi1 type has more elements than the widest legal vXi8 type. Type legalization will eventually split it down to v16i1 or v32i1 and then the bitcast gets legalized to a truncstore and a scalar load. The truncstore will get lowered to a series of extracts and bit math.
This patch adds a custom legalization to use a sign extend and MOVMSK instead. This prevents the eventual scalarization.
https://reviews.llvm.org/D43593
Files:
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/bitcast-and-setcc-512.ll
test/CodeGen/X86/bitcast-setcc-512.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43593.135325.patch
Type: text/x-patch
Size: 60790 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180221/0bbfa25e/attachment.bin>
More information about the llvm-commits
mailing list