[AMDGPU] Add bf16 storage support
authorPierre van Houtryve <pierre.vanhoutryve@amd.com>
Tue, 13 Dec 2022 14:59:20 +0000 (09:59 -0500)
committerPierre van Houtryve <pierre.vanhoutryve@amd.com>
Tue, 13 Dec 2022 15:34:26 +0000 (10:34 -0500)
commit678d8946ba2ba790c4c52e96e2134ee136e30057
treec93503de8b7c9a2c18cb78bae4379a8c709019f3
parent1f9fe3427b5a9e54b6e0c49c54e63815c581047b
[AMDGPU] Add bf16 storage support

- [Clang] Declare AMDGPU target as supporting BF16 for storage-only purposes on amdgcn
  - Add Sema & CodeGen tests cases.
  - Also add cases that D138651 would have covered as this patch replaces it.
- [AMDGPU] Add BF16 storage-only support
  - Support legalization/dealing with bf16 operations in DAGIsel.
  - bf16 as a type remains illegal and is represented as i16 for storage purposes.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D139398
clang/lib/Basic/Targets/AMDGPU.cpp
clang/lib/Basic/Targets/AMDGPU.h
clang/test/CodeGenCUDA/amdgpu-bf16.cu [new file with mode: 0644]
clang/test/SemaCUDA/amdgpu-bf16.cu [new file with mode: 0644]
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h
llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
llvm/lib/Target/AMDGPU/SIISelLowering.cpp
llvm/test/CodeGen/AMDGPU/bf16-ops.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/bf16.ll [new file with mode: 0644]