HomePhabricator

[PPC][DAGCombine] Convert SETCC to subtract when the result is zero extended

Description

[PPC][DAGCombine] Convert SETCC to subtract when the result is zero extended

When we see a SETCC whose only users are zero extend operations, we can replace
it with a subtraction. This results in doing all calculations in GPRs and
avoids CR use.

Currently we do this only for ULT, ULE, UGT and UGE condition codes. There are
ways that this can be extended. For example for signed condition codes. In that
case we will be introducing additional sign extend instructions, so more careful
profitability analysis may be required.

Another direction to extend this is for equal, not equal conditions. Also when
users of SETCC are any_ext or sign_ext, we might be able to do something
similar.

Details

Committed
amehsanNov 18 2016, 2:41 AM
Parents
rL287328: Fix go binding to adapt the new attribute API
Branches
Unknown
Tags
Unknown