This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Add some basic handling for bf16 constants.
ClosedPublic

Authored by dmgreen on Jul 31 2023, 12:11 AM.

Details

Summary

This adds some basic handling for bf16 constants, attempting to treat them a lot like fp16 constants where it can. Zero immediates get lowered to FMOVH0, others either get lowered to FMOVWHr(MOVi32imm) or use FMOVHi if they can. Without fp16 they get expanded. This may not always be optimal, but fixes a gap in our lowering. See https://github.com/llvm/llvm-project/blob/main/llvm/test/CodeGen/AArch64/f16-imm.ll for the equivalent fp16 test.

Diff Detail

Event Timeline

dmgreen created this revision.Jul 31 2023, 12:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 31 2023, 12:12 AM
dmgreen requested review of this revision.Jul 31 2023, 12:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 31 2023, 12:12 AM
stuij accepted this revision.Jul 31 2023, 3:27 AM

Yea nice. Looks pretty straightforward to me.

This revision is now accepted and ready to land.Jul 31 2023, 3:27 AM
This revision was landed with ongoing or failed builds.Jul 31 2023, 1:32 PM
This revision was automatically updated to reflect the committed changes.