OSDN Git Service

[X86] Use vptestm/vptestnm for comparisons with zero to avoid creating a zero vector.
authorCraig Topper <craig.topper@intel.com>
Sat, 27 Jan 2018 20:19:09 +0000 (20:19 +0000)
committerCraig Topper <craig.topper@intel.com>
Sat, 27 Jan 2018 20:19:09 +0000 (20:19 +0000)
commit6faa377a41042c1f2f2525feb883e0187205683c
tree8f7b3b46544768dfb480fa5b2675cd12d8304398
parentc4a39a107920b88ce88f28f47fc85b96ab18f103
[X86] Use vptestm/vptestnm for comparisons with zero to avoid creating a zero vector.

We can use the same input for both operands to get a free compare with zero.

We already use this trick in a couple places where we explicitly create PTESTM with the same input twice. This generalizes it.

I'm hoping to remove the ISD opcodes and move this to isel patterns like we do for scalar cmp/test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323605 91177308-0d34-0410-b5e6-96231b3b80d8
30 files changed:
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/avx512-arith.ll
test/CodeGen/X86/avx512-mask-op.ll
test/CodeGen/X86/avx512-masked-memop-64-32.ll
test/CodeGen/X86/avx512-mov.ll
test/CodeGen/X86/avx512-schedule.ll
test/CodeGen/X86/avx512-shuffle-schedule.ll
test/CodeGen/X86/avx512-shuffles/broadcast-scalar-int.ll
test/CodeGen/X86/avx512-shuffles/broadcast-vector-int.ll
test/CodeGen/X86/avx512-shuffles/partial_permute.ll
test/CodeGen/X86/avx512-shuffles/permute.ll
test/CodeGen/X86/avx512-shuffles/shuffle-vec.ll
test/CodeGen/X86/avx512-shuffles/shuffle.ll
test/CodeGen/X86/avx512-vbroadcast.ll
test/CodeGen/X86/avx512-vec-cmp.ll
test/CodeGen/X86/avx512bw-mov.ll
test/CodeGen/X86/avx512bwvl-mov.ll
test/CodeGen/X86/avx512vl-arith.ll
test/CodeGen/X86/avx512vl-mov.ll
test/CodeGen/X86/avx512vl-vbroadcast.ll
test/CodeGen/X86/compress_expand.ll
test/CodeGen/X86/masked_gather_scatter.ll
test/CodeGen/X86/masked_memop.ll
test/CodeGen/X86/nontemporal-loads.ll
test/CodeGen/X86/pr35272.ll
test/CodeGen/X86/prefer-avx256-mask-extend.ll
test/CodeGen/X86/prefer-avx256-mask-shuffle.ll
test/CodeGen/X86/vector-lzcnt-512.ll
test/CodeGen/X86/vector-shuffle-256-v16.ll
test/CodeGen/X86/vector-shuffle-v1.ll