OSDN Git Service

[X86] Add a DAG combine to combine (sext (setcc)) with VLX
authorCraig Topper <craig.topper@intel.com>
Tue, 9 Jan 2018 18:14:22 +0000 (18:14 +0000)
committerCraig Topper <craig.topper@intel.com>
Tue, 9 Jan 2018 18:14:22 +0000 (18:14 +0000)
commit7481a4cf21d75d9f00382717a3d056b6ec3d9fc0
tree35b7a641710ec8f59f7513ec18bba6650badaf57
parent3db29f781f04acf10e2f6781cebb87c16c92f4b8
[X86] Add a DAG combine to combine (sext (setcc)) with VLX

Normally target independent DAG combine would do this combine based on getSetCCResultType, but with VLX getSetCCResultType returns a vXi1 type preventing the DAG combining from kicking in.

But doing this combine can allow us to remove the explicit sign extend that would otherwise be emitted.

This patch adds a target specific DAG combine to combine the sext+setcc when the result type is the same size as the input to the setcc. I've restricted this to FP compares and things that can be represented with PCMPEQ and PCMPGT since we don't have full integer compare support on the older ISAs.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322101 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/avx-schedule.ll
test/CodeGen/X86/avx2-schedule.ll
test/CodeGen/X86/avx512-vec-cmp.ll
test/CodeGen/X86/avx512-vec3-crash.ll
test/CodeGen/X86/commute-fcmp.ll
test/CodeGen/X86/sse41-schedule.ll
test/CodeGen/X86/sse42-schedule.ll
test/CodeGen/X86/vector-compare-all_of.ll
test/CodeGen/X86/vector-compare-any_of.ll
test/CodeGen/X86/vselect-packss.ll