elliottt commented on issue #5636:
Very nice! It wasn't obvious to me, until I went and stared at the definition of
FloatCC
incranelift/codegen/src/ir/condcodes.rs
, that you can always eliminate the "UnorderedOr" conditions by inverting the condition code. I can't think of a case where this could make the generated code worse, and clearly it makes it substantially better in some cases, at least on this target.I only noticed this because of how bad the
fcmp
test on riscv64 got when I removedbrz
:sweat_smile:I wonder if we'll want to write any generic egraph optimization rules based on this observation...
I think that's worth investigating, though looking through the lowerings for
fcmp
on our other backends, none are as expensive as riscv64 when there are unordered comparisons involved.
Last updated: Nov 22 2024 at 16:03 UTC