From 88fa0e25d08b80f1573e147ed3b8a30c9791fb5f Mon Sep 17 00:00:00 2001
From: Wenju He <wenju.he@intel.com>
Date: Fri, 21 Nov 2025 05:19:00 +0100
Subject: [PATCH 2/2] [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 69596c6eb6fe..652776409716 100644
--- a/clang/lib/Basic/Targets/SPIR.h
+++ b/clang/lib/Basic/Targets/SPIR.h
@@ -95,6 +95,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

