(setcc x, y, eq/neq) are seqz, snez that set rd = 0/1.
addi is used to process immediate, which can save instructions for load immediate.
Differential D131471
[RISCV] Fold (sub constant, (setcc x, y, eq/neq)) -> (add constant - 1, (setcc x, y, neq/eq)) liaolucy on Aug 9 2022, 1:41 AM. Authored by
Details (setcc x, y, eq/neq) are seqz, snez that set rd = 0/1. addi is used to process immediate, which can save instructions for load immediate.
Diff Detail
Event TimelineComment Actions Use ISD::isIntEqualitySetCC(CCVal) and put constant on the RHS.
Comment Actions LGTM with that change.
|
Do we need to check that this is the only user of the setcc?