[PATCH] D132329: [X86][RFC] Using `__bf16` for AVX512_BF16 intrinsics

Phoebe Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 21 08:47:38 PDT 2022


pengfei created this revision.
pengfei added reviewers: LuoYuanke, craig.topper, andrew.w.kaylor, RKSimon, FreddyYe, skan.
Herald added subscribers: StephenFan, hiraditya.
Herald added a project: All.
pengfei requested review of this revision.
Herald added subscribers: llvm-commits, cfe-commits, jdoerfert.
Herald added projects: clang, LLVM.

This is an alternative of D120395 <https://reviews.llvm.org/D120395> and D120411 <https://reviews.llvm.org/D120411>.

Previously we use `__bfloat16` as a typedef of `unsigned short`. The
name may give user an impression it is a brand new type to represent
BF16. So that they may use it in arithmetic operations and we don't have
a good way to block it.

To solve the problem, we introduced `__bf16` to X86 psABI and landed the
support in Clang by D130964 <https://reviews.llvm.org/D130964>. Now we can solve the problem by switching
intrinsics to the new type.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D132329

Files:
  clang/include/clang/Basic/BuiltinsX86.def
  clang/lib/AST/MicrosoftMangle.cpp
  clang/lib/CodeGen/CGBuiltin.cpp
  clang/lib/Headers/avx512bf16intrin.h
  clang/lib/Headers/avx512vlbf16intrin.h
  clang/test/CodeGen/X86/avx512bf16-builtins.c
  clang/test/CodeGen/X86/avx512vlbf16-builtins.c
  llvm/include/llvm/IR/Intrinsics.td
  llvm/include/llvm/IR/IntrinsicsX86.td
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/lib/Target/X86/X86InstrAVX512.td
  llvm/lib/Target/X86/X86InstrFragmentsSIMD.td
  llvm/lib/Target/X86/X86RegisterInfo.td
  llvm/test/CodeGen/X86/avx512bf16-intrinsics.ll
  llvm/test/CodeGen/X86/avx512bf16-vl-intrinsics.ll
  llvm/test/CodeGen/X86/stack-folding-avx512bf16.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132329.454316.patch
Type: text/x-patch
Size: 97258 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220821/b5ba378b/attachment.bin>


More information about the llvm-commits mailing list