Page MenuHomePhabricator

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

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



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


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


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.