When the RHS of a conditional move node is zero, we can utilize the $zero
register by inverting the conditional move instruction and by swapping the
order of its True/False operands.
Details
Diff Detail
Event Timeline
LGTM with a couple nits.
lib/Target/Mips/MipsISelLowering.cpp | ||
---|---|---|
626 | Nit: Can we call these ValueIfTrue and ValueIfFalse? I just want to avoid having case-sensitive names (e.g. true vs True). | |
test/CodeGen/Mips/fcmp.ll | ||
1–14 | Just a comment, no change required: We haven't been as picky about the 80 char limit in tests as we are elsewhere. | |
28–30 | The $[[T0:2]] and $[[T2]] looks redundant but it's not. It constrains the ordering of the *-DAG checks, effectively ensuring that the movf occurs after the addiu. Given that we don't constrain the c.eq.s properly at the moment, I think we should also drop the -DAG on the last line to get: ; 32-C-DAG: addiu $2, $zero, 1 ; 32-C-DAG: c.eq.s $f12, $f14 ; 32-C: movf $2, $zero, $fcc0 This gets us the constraints we need. Likewise for the 64-C case below |
Nit: Can we call these ValueIfTrue and ValueIfFalse? I just want to avoid having case-sensitive names (e.g. true vs True).