This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][GISel] Extend lowering for fp round intrinsics.
ClosedPublic

Authored by dmgreen on Aug 10 2023, 11:50 PM.

Details

Summary

This extends the lowering of ceil, floor, nearbyint, rint, round, roundeven and trunc. They are all very similar, so can reuse the same legalization info. selectIntrinsicTrunc and selectIntrinsicRound can be removed as they can be selected via tablegen patterns, and G_INTRINSIC_ROUNDEVEN is marked as a gisel equivalent of froundeven. Otherwise this reuses the existing code, filling it out to handle more types.

Diff Detail

Event Timeline

dmgreen created this revision.Aug 10 2023, 11:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 10 2023, 11:50 PM
dmgreen requested review of this revision.Aug 10 2023, 11:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 10 2023, 11:50 PM
Herald added a subscriber: wdng. · View Herald Transcript
arsenm added inline comments.Aug 11 2023, 4:42 AM
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
4919–4926

I'm surprised these are missing

llvm/test/CodeGen/AArch64/fcvt.ll
158–161

This is worse

dmgreen added inline comments.Aug 14 2023, 1:18 AM
llvm/test/CodeGen/AArch64/fcvt.ll
158–161

Yeah it's the same as https://reviews.llvm.org/D155601?id=541535#inline-1505354. There are legalization artefacts from widening the vector with undef. They should be able to be optimized away, we just haven't got that code yet.

arsenm accepted this revision.Aug 15 2023, 10:43 AM
This revision is now accepted and ready to land.Aug 15 2023, 10:43 AM
This revision was landed with ongoing or failed builds.Aug 17 2023, 8:25 AM
This revision was automatically updated to reflect the committed changes.