This is an archive of the discontinued LLVM Phabricator instance.

[X86] Add a DAG combine to combine (sext (setcc)) with VLX
ClosedPublic

Authored by craig.topper on Jan 8 2018, 10:31 PM.

Details

Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Jan 8 2018, 10:31 PM

Also block SETNE since that requires an XOR with all 1s to implement.

zvi accepted this revision.Jan 9 2018, 8:47 AM

LGTM

This revision is now accepted and ready to land.Jan 9 2018, 8:47 AM
This revision was automatically updated to reflect the committed changes.