[clang] [llvm] [RFC][WIP][AMDGPU] Use `bf16` instead of `i16` for bfloat (PR #80908)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 8 01:23:20 PST 2024


================
@@ -2819,11 +2819,11 @@ def int_amdgcn_fdot2_f16_f16 :
 def int_amdgcn_fdot2_bf16_bf16 :
   ClangBuiltin<"__builtin_amdgcn_fdot2_bf16_bf16">,
   DefaultAttrsIntrinsic<
-    [llvm_i16_ty],   // %r
+    [llvm_bfloat_ty],   // %r
----------------
arsenm wrote:

Changing the clang builtin breaks user code. Anyone using it will now have an implicit itofp cast to bfloat. For the first step, I would leave the clang builtin alone (and only make the codegen change to emit the new IR). We would either need to introduce a new builtin with the corrected signature, or add a language flag to change the behavior

https://github.com/llvm/llvm-project/pull/80908


More information about the cfe-commits mailing list