https://github.com/arsenm created 
https://github.com/llvm/llvm-project/pull/203060

This was assuming that the offload languages use a subclass, and
only OpenCL hits the AMDGPUToolChain base class. Flang violates this,
and passes in the wrong values. Delete the assert for now.

>From 92af269af193126bcc0a54bf59a2a6b9bb258b7c Mon Sep 17 00:00:00 2001
From: Matt Arsenault <[email protected]>
Date: Wed, 10 Jun 2026 19:47:58 +0200
Subject: [PATCH] clang: Remove BoundArch assert in
 AMDGPUToolChain::addClangTargetOptions

This was assuming that the offload languages use a subclass, and
only OpenCL hits the AMDGPUToolChain base class. Flang violates this,
and passes in the wrong values. Delete the assert for now.
---
 clang/lib/Driver/ToolChains/AMDGPU.cpp | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/clang/lib/Driver/ToolChains/AMDGPU.cpp 
b/clang/lib/Driver/ToolChains/AMDGPU.cpp
index 47df326fca9be..4320d1480be61 100644
--- a/clang/lib/Driver/ToolChains/AMDGPU.cpp
+++ b/clang/lib/Driver/ToolChains/AMDGPU.cpp
@@ -841,9 +841,6 @@ ROCMToolChain::ROCMToolChain(const Driver &D, const 
llvm::Triple &Triple,
 void AMDGPUToolChain::addClangTargetOptions(
     const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args,
     llvm::StringRef BoundArch, Action::OffloadKind DeviceOffloadingKind) const 
{
-  assert(DeviceOffloadingKind == Action::OFK_None && BoundArch.empty() &&
-         "this toolchain is for non-offloading cases");
-
   // Default to "hidden" visibility, as object level linking will not be
   // supported for the foreseeable future.
   // TODO: remove the SPIR-V bypass once it can encode (hidden) visibility.

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to