OSDN Git Service

[InstCombine][X86] Expand MOVMSK to generic IR (PR39927)
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 8 Apr 2019 13:17:51 +0000 (13:17 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 8 Apr 2019 13:17:51 +0000 (13:17 +0000)
commitf9c39ac584f3fed94d4ac52fadda8b230edf36be
tree693e4eb8fdb8ad5757cd1a5b99392306ae19dce5
parente51a6f17069666735358a284b9c9f86ed2d0496e
[InstCombine][X86] Expand MOVMSK to generic IR (PR39927)

First step towards removing the MOVMSK intrinsics completely - this patch expands MOVMSK to the pattern:

e.g. PMOVMSKB(v16i8 x):
%cmp = icmp slt <16 x i8> %x, zeroinitializer
%int = bitcast <16 x i8> %cmp to i16
%res = zext i16 %int to i32

Which is correctly handled by ISel and FastIsel (give or take an annoying movzx move....): https://godbolt.org/z/rkrSFW

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357909 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineCalls.cpp
test/Transforms/InstCombine/X86/x86-movmsk.ll