This is an archive of the discontinued LLVM Phabricator instance.

CodeGen: Optimize lowering of is.fpclass fcZero|fcSubnormal
ClosedPublic

Authored by arsenm on Feb 2 2023, 6:57 AM.

Details

Summary

Combine the two checks into a check if the exponent bits are 0. The
inverted case isn't reachable until a future change, and GlobalISel
currently doesn't attempt the inversion optimization.

Diff Detail

Event Timeline

arsenm created this revision.Feb 2 2023, 6:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 2 2023, 6:57 AM
arsenm requested review of this revision.Feb 2 2023, 6:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 2 2023, 6:57 AM
Herald added a subscriber: wdng. · View Herald Transcript
sepavloff added inline comments.Mar 14 2023, 11:11 PM
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
7200–7201

Using FPClassTest may simplify the implementation a bit.

7214

This TODO does not look clear enough.

7280

If Mask is FPClassTest, & fcAllFlags is superfluous.

arsenm updated this revision to Diff 506072.Mar 17 2023, 6:37 AM
arsenm marked 3 inline comments as done.

Rebase

llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
7200–7201

Fixing in pre-commit

sepavloff accepted this revision.Jun 4 2023, 8:47 PM

LGTM.

This revision is now accepted and ready to land.Jun 4 2023, 8:47 PM