[clang] [clang][TCE] Fix ordering of OpenCL address space mappings (PR #210244)

Ken Matsui via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 16 22:54:08 PDT 2026


https://github.com/ken-matsui created https://github.com/llvm/llvm-project/pull/210244

opencl_global_device and opencl_global_host are defined after opencl_generic in LangAS, but commit
8d27be8dbaffce0519ac41173d51923fc2524b1b inserted them before opencl_generic in the TCE address space map.

Fix the order to restore the intended mappings.

>From 7d6048f3d14cae4cd212838bbf441295486c2af2 Mon Sep 17 00:00:00 2001
From: Ken Matsui <github at kmts.me>
Date: Fri, 17 Jul 2026 01:26:49 -0400
Subject: [PATCH] [clang][TCE] Fix ordering of OpenCL address space mappings

opencl_global_device and opencl_global_host are defined after
opencl_generic in LangAS, but commit
8d27be8dbaffce0519ac41173d51923fc2524b1b inserted them before
opencl_generic in the TCE address space map.

Fix the order to restore the intended mappings.
---
 clang/lib/Basic/Targets/TCE.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/clang/lib/Basic/Targets/TCE.h b/clang/lib/Basic/Targets/TCE.h
index 1360298de9794..1ecaddf0ed534 100644
--- a/clang/lib/Basic/Targets/TCE.h
+++ b/clang/lib/Basic/Targets/TCE.h
@@ -35,10 +35,10 @@ static const unsigned TCEOpenCLAddrSpaceMap[] = {
     3, // opencl_local
     2, // opencl_constant
     0, // opencl_private
-    1, // opencl_global_device
-    1, // opencl_global_host
     // FIXME: generic has to be added to the target
     0, // opencl_generic
+    1, // opencl_global_device
+    1, // opencl_global_host
     0, // cuda_device
     0, // cuda_constant
     0, // cuda_shared



More information about the cfe-commits mailing list