elliottt commented on issue #5636:
Very nice! It wasn't obvious to me, until I went and stared at the definition of
FloatCCincranelift/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
fcmptest 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
fcmpon our other backends, none are as expensive as riscv64 when there are unordered comparisons involved.
Last updated: Dec 06 2025 at 06:05 UTC