[X86][RFC] Using `__bf16` for AVX512_BF16 intrinsics
authorPhoebe Wang <phoebe.wang@intel.com>
Wed, 19 Oct 2022 08:26:54 +0000 (16:26 +0800)
committerPhoebe Wang <phoebe.wang@intel.com>
Wed, 19 Oct 2022 15:47:04 +0000 (23:47 +0800)
commitbc1819389fb4701cdeba5e093278e32dd668d6d5
treee2f7459f2b5d6b3cf6902d47a72c6cad80edaaaf
parentf0ca946bf917430bc97f80a5791312ef28c48320
[X86][RFC] Using `__bf16` for AVX512_BF16 intrinsics

This is an alternative of D120395 and 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. Now we can solve the problem by switching
intrinsics to the new type.

Reviewed By: LuoYuanke, RKSimon

Differential Revision: https://reviews.llvm.org/D132329
21 files changed:
clang/docs/ReleaseNotes.rst
clang/include/clang/Basic/BuiltinsX86.def
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/avx512bf16-error.c [new file with mode: 0644]
clang/test/CodeGen/X86/avx512vlbf16-builtins.c
llvm/include/llvm/IR/Intrinsics.td
llvm/include/llvm/IR/IntrinsicsX86.td
llvm/lib/IR/AutoUpgrade.cpp
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-upgrade.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/avx512bf16-intrinsics.ll
llvm/test/CodeGen/X86/avx512bf16-vl-intrinsics-upgrade.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/avx512bf16-vl-intrinsics.ll
llvm/test/CodeGen/X86/bfloat.ll
llvm/test/CodeGen/X86/stack-folding-avx512bf16.ll