[InstCombine] try to convert x86 movmsk intrinsic to generic IR (PR39927)
authorSanjay Patel <spatel@rotateright.com>
Tue, 11 Dec 2018 16:38:03 +0000 (16:38 +0000)
committerSanjay Patel <spatel@rotateright.com>
Tue, 11 Dec 2018 16:38:03 +0000 (16:38 +0000)
commit2aa2dc76c26354aea25ccc2e2529f967d5c58cb6
tree91e3bf5d30d54c6d30bda75dd0b98624a24c33d1
parenta5b82d9447a120f48552afe041ce20febd93c05d
[InstCombine] try to convert x86 movmsk intrinsic to generic IR (PR39927)

call iM movmsk(sext <N x i1> X) --> zext (bitcast <N x i1> X to iN) to iM

This has the potential to create less-than-8-bit scalar types as shown in
some of the test diffs, but it looks like the backend knows how to deal
with that in these patterns. This is the simple part of the fix suggested in:
https://bugs.llvm.org/show_bug.cgi?id=39927

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

llvm-svn: 348862
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
llvm/test/Transforms/InstCombine/X86/x86-movmsk.ll