From 6e752948b601ae8e1e0f7fc1399e5a81c3178ed7 Mon Sep 17 00:00:00 2001
From: Wenju He <wenju.he@intel.com>
Date: Fri, 21 Nov 2025 05:24:12 +0100
Subject: [PATCH] [Clang] Enable BFloat16 for SPIR/SPIR-V

---
 clang/lib/Basic/Targets/SPIR.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/clang/lib/Basic/Targets/SPIR.h b/clang/lib/Basic/Targets/SPIR.h
index a7ea03e7a5dd..9f9bc301f728 100644
--- a/clang/lib/Basic/Targets/SPIR.h
+++ b/clang/lib/Basic/Targets/SPIR.h
@@ -104,6 +104,9 @@ protected:
     UseAddrSpaceMapMangling = true;
     HasLegalHalfType = true;
     HasFloat16 = true;
+    HasBFloat16 = true;
+    BFloat16Width = BFloat16Align = 16;
+    BFloat16Format = &llvm::APFloat::BFloat();
     // Define available target features
     // These must be defined in sorted order!
     NoAsmVariants = true;
-- 
2.39.1

