[clang] [SYCL][SPIR-V][Windows] Extend BaseSPIRTargetInfo host-adaptation for Windows support (PR #208196)

Tom Honermann via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 21 08:51:21 PDT 2026


================
@@ -272,8 +284,10 @@ class LLVM_LIBRARY_VISIBILITY SPIR32TargetInfo : public SPIRTargetInfo {
     assert(Triple.getArch() == llvm::Triple::spir &&
            "Invalid architecture for 32-bit SPIR.");
     PointerWidth = PointerAlign = 32;
-    SizeType = TargetInfo::UnsignedInt;
-    PtrDiffType = IntPtrType = TargetInfo::SignedInt;
+    if (!HostTarget || HostTarget->getPointerWidth(LangAS::Default) != 32) {
+      SizeType = TargetInfo::UnsignedInt;
+      PtrDiffType = IntPtrType = TargetInfo::SignedInt;
+    }
----------------
tahonermann wrote:

I would prefer that the offending RUN lines be removed. A follow up PR will be needed to reject inappropriate host/device combinations with an appropriate diagnostic regardless, but I would prefer to get these changes correct now. See https://github.com/intel/llvm/issues/18304 for a related issue filed against the intel/llvm repo. 

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


More information about the cfe-commits mailing list