Page MenuHomePhabricator

[TargetLowering] Rename isCondCodeLegal to isCondCodeLegalOrCustom. Add real isCondCodeLegal. Update callers to use one or the other.
ClosedPublic

Authored by craig.topper on Feb 21 2018, 9:22 PM.

Details

Summary

[TargetLowering] Rename isCondCodeLegal to isCondCodeLegalOrCustom. Add real isCondCodeLegal. Update callers to use one or the other.

isCondCodeLegal internally checked Legal or Custom which is misleading. Though no targets set any cond code action to Custom today.

So I've renamed isCondCodeLegal to isCondCodeLegalOrCustom and added a real isCondCodeLegal that only checks Legal.

I've changed legalization code to use isCondCodeLegalOrCustom and left things reachable via DAG combine as isCondCodeLegal. I've also changed some places that called getCondCodeAction and compared to Legal to just use isCondCodeLegal.

I'm looking at trying to keep SETCC all the way to isel for the AVX512 integer comparisons and I suspect I'll need to make some condition codes Custom to stop DAG combine from changing things post LegalizeOps. Prior to this only Expand stopped DAG combine, but that causes LegalizeOps to try to swap operands or invert rather than calling our Custom handler.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Feb 21 2018, 9:22 PM
craig.topper edited the summary of this revision. (Show Details)
spatel accepted this revision.Feb 22 2018, 10:05 AM

LGTM.

This revision is now accepted and ready to land.Feb 22 2018, 10:05 AM
This revision was automatically updated to reflect the committed changes.