[PATCH] D41850: [X86] Add a DAG combine to combine (sext (setcc)) with VLX

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 8 22:31:33 PST 2018


craig.topper created this revision.
craig.topper added reviewers: zvi, RKSimon, spatel.

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.


https://reviews.llvm.org/D41850

Files:
  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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41850.129032.patch
Type: text/x-patch
Size: 37891 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180109/b2f75ea6/attachment.bin>


More information about the llvm-commits mailing list