HomePhabricator

[DAGCombiner] Teach SimplifySetCC SETUGE X, SINTMIN -> SETLT X, 0 and SETULE X…

Authored by craig.topper on Aug 8 2020, 10:09 PM.

Description

[DAGCombiner] Teach SimplifySetCC SETUGE X, SINTMIN -> SETLT X, 0 and SETULE X, SINTMAX -> SETGT X, -1.

These aren't the canonical forms we'd get from InstCombine, but
we do have X86 tests for them. Recognizing them is pretty cheap.

While there make use of APInt:isSignedMinValue/isSignedMaxValue
instead of creating a new APInt to compare with. Also use
SelectionDAG::getAllOnesConstant helper to hide the all ones
APInt creation.

Details

Committed
craig.topperAug 8 2020, 10:27 PM
Parents
rG95e61ed85c1a: [X86] Autogenerate complete checks. NFC
Branches
Unknown
Tags
Unknown