This is an archive of the discontinued LLVM Phabricator instance.

DAG: Lower single infinity is.fpclass tests to fcmp
Needs ReviewPublic

Authored by arsenm on Feb 2 2023, 9:51 AM.

Details

Summary

InstCombine also should have taken care of this, but this
should be helpful when the fcmp based lowering strategy tries
to combine multiple tests.

Diff Detail

Event Timeline

arsenm created this revision.Feb 2 2023, 9:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 2 2023, 9:51 AM
arsenm requested review of this revision.Feb 2 2023, 9:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 2 2023, 9:51 AM
Herald added a subscriber: wdng. · View Herald Transcript

What is the advantage of such lowering?

Implementation of is_fpclass as fcmp requires materialization of infinity constant. In contrast to zero constant, which often can be easily materialized, infinity usually requires loading constant from memory. So additional memory access is required as compared to the default lowering.

arsenm added a comment.Mar 8 2023, 5:17 PM

What is the advantage of such lowering?

Implementation of is_fpclass as fcmp requires materialization of infinity constant. In contrast to zero constant, which often can be easily materialized, infinity usually requires loading constant from memory. So additional memory access is required as compared to the default lowering.

This also avoids a register bank copy if the target has separate integer and FP banks