This is an archive of the discontinued LLVM Phabricator instance.

[ARM] BFloat MatMul Intrinsics&CodeGen
ClosedPublic

Authored by miyuki on Jun 12 2020, 7:19 AM.

Details

Summary

This patch adds support for BFloat Matrix Multiplication Intrinsics
and Code Generation from __bf16 to AArch32. This includes IR intrinsics. Tests are
provided as needed.

This patch is part of a series implementing the Bfloat16 extension of
the
Armv8.6-a architecture, as detailed here:

https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/arm-architecture-developments-armv8-6-a

The bfloat type and its properties are specified in the Arm
Architecture
Reference Manual:

https://developer.arm.com/docs/ddi0487/latest/arm-architecture-reference-manual-armv8-for-armv8-a-architecture-profile

The following people contributed to this patch:

  • Luke Geeson
  • Momchil Velikov
  • Mikhail Maltsev
  • Luke Cheeseman
  • Simon Tatham

Diff Detail

Event Timeline

LukeGeeson created this revision.Jun 12 2020, 7:19 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJun 12 2020, 7:19 AM

removed redundancy in patch

miyuki added inline comments.Jun 15 2020, 5:36 AM
clang/test/CodeGen/arm-bf16-dotprod-intrinsics.c
3

Would it be sufficient to run through opt -mem2reg -instcombine instead of the whole -O2 pipeline?

13

The check prefixes are misleading. How about CHECK-FPABI-HARD and CHECK-FPABI-SOFT?

llvm/lib/Target/ARM/ARMInstrNEON.td
9196

Will this work if the selected element is in the top half of the Q register ($lane >= 4)?

llvm/test/CodeGen/ARM/arm-bf16-dotprod-intrinsics.ll
2

--check-prefix=CHECK is redundant

6

Could you please get rid of local_unnamed_addr #0? #0 is referring to an attribute that is not defined anywhere.

10

Same for #3

miyuki commandeered this revision.Jun 22 2020, 7:21 AM
miyuki added a reviewer: LukeGeeson.
miyuki updated this revision to Diff 272668.Jun 23 2020, 3:54 AM
miyuki retitled this revision from [AArch32]: BFloat MatMul Intrinsics&CodeGen to [ARM] BFloat MatMul Intrinsics&CodeGen.
miyuki edited the summary of this revision. (Show Details)

Addressed the review comments

miyuki set the repository for this revision to rG LLVM Github Monorepo.Jun 23 2020, 3:54 AM
miyuki marked 6 inline comments as done.
MarkMurrayARM accepted this revision.Jun 23 2020, 4:13 AM
MarkMurrayARM added a subscriber: MarkMurrayARM.

LGTM.

This revision is now accepted and ready to land.Jun 23 2020, 4:13 AM
This revision was automatically updated to reflect the committed changes.