[CUDA, NVPTX] Added basic __bf16 support for NVPTX.
authorArtem Belevich <tra@google.com>
Thu, 20 Oct 2022 01:49:32 +0000 (18:49 -0700)
committerArtem Belevich <tra@google.com>
Tue, 25 Oct 2022 18:08:06 +0000 (11:08 -0700)
commit0e8a414ab3d330ebb2996ec95d8141618ee0278b
tree0b8b9b2455b7a2e8f52e0cb212ed0535abb85002
parentfd5a2bfaadb5336c2f115a875c12c26e9daa96df
[CUDA, NVPTX] Added basic __bf16 support for NVPTX.

Recent Clang changes expose _bf16 types for SSE2-enabled host compilations and
that makes those types visible furing GPU-side compilation, where it currently
fails with Sema complaining that __bf16 is not supported.

Considering that __bf16 is a storage-only type, enabling it for NVPTX if it's
enabled on the host should pose no issues, correctness-wise.

Recent NVIDIA GPUs have introduced bf16 support, so we'll likely grow better
support for __bf16 on NVPTX going forward.

Differential Revision: https://reviews.llvm.org/D136311
clang/lib/Basic/Targets/NVPTX.cpp
clang/lib/Basic/Targets/NVPTX.h
clang/test/CodeGenCUDA/bf16.cu [new file with mode: 0644]
clang/test/SemaCUDA/bf16.cu [new file with mode: 0644]
llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp
llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
llvm/lib/Target/NVPTX/NVPTXInstrInfo.td
llvm/lib/Target/NVPTX/NVPTXProxyRegErasure.cpp
llvm/lib/Target/NVPTX/NVPTXRegisterInfo.td
llvm/test/CodeGen/NVPTX/bf16.ll [new file with mode: 0644]