OSDN Git Service

Lower icmp operations between vector values.
authorMatt Wala <wala@chromium.org>
Wed, 23 Jul 2014 21:56:10 +0000 (14:56 -0700)
committerMatt Wala <wala@chromium.org>
Wed, 23 Jul 2014 21:56:10 +0000 (14:56 -0700)
commit9a0168a9ccfa574e67baebe68650a85a18292d30
tree63dac0cf4f1aba2a9576ea32a1bebe67cf7e090c
parent87543355ff42e591d3f26505ef26a0df3ce1d1b3
Lower icmp operations between vector values.

SSE2 only has signed integer comparison. Unsigned compares are
implemented by inverting the sign bits of the operands and doing a
signed compare.

A common pattern in clang generated IR is a vector compare which
generates an i1 vector followed by a sign extension of the result of the
compare. The x86 comparison instructions already generate sign extended
values, so we can eliminate unnecessary sext operations that follow
compares in the IR.

BUG=none
R=jvoung@chromium.org, stichnot@chromium.org

Review URL: https://codereview.chromium.org/412593002
crosstest/runtests.sh
crosstest/test_icmp.cpp
crosstest/test_icmp.h
crosstest/test_icmp_i1vec.ll [new file with mode: 0644]
crosstest/test_icmp_main.cpp
src/IceTargetLoweringX8632.cpp
src/IceTargetLoweringX8632.h
tests_lit/llvm2ice_tests/vector-icmp.ll [new file with mode: 0644]