https://github.com/arsenm created https://github.com/llvm/llvm-project/pull/201789
Accept amdgpu as an alias for amdgcn as part of the general trend of preferring the amdgpu name. This is so the name is consistent in the future when the triple arch name changes. >From 38b402fa292f4de436f484abd1c2b6d37d2741e3 Mon Sep 17 00:00:00 2001 From: Matt Arsenault <[email protected]> Date: Wed, 27 May 2026 15:38:49 +0200 Subject: [PATCH] OpenMP: Accept amdgpu name in arch directive Accept amdgpu as an alias for amdgcn as part of the general trend of preferring the amdgpu name. This is so the name is consistent in the future when the triple arch name changes. --- clang/test/OpenMP/amdgpu-arch-compat.c | 12 ++++++++++++ llvm/include/llvm/Frontend/OpenMP/OMPKinds.def | 1 + 2 files changed, 13 insertions(+) create mode 100644 clang/test/OpenMP/amdgpu-arch-compat.c diff --git a/clang/test/OpenMP/amdgpu-arch-compat.c b/clang/test/OpenMP/amdgpu-arch-compat.c new file mode 100644 index 0000000000000..72690c4195f6f --- /dev/null +++ b/clang/test/OpenMP/amdgpu-arch-compat.c @@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -fopenmp -nogpulib -fopenmp-is-target-device -verify %s +// expected-no-diagnostics + +#pragma omp begin declare variant match(device = {arch(amdgcn)}) +void is_amdgcn(); +#pragma omp end declare variant + +#pragma omp begin declare variant match(device = {arch(amdgpu)}) +void is_amdgpu(); +#pragma omp end declare variant + + diff --git a/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def b/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def index 15fbfdaf549d6..ae19490de0f46 100644 --- a/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def +++ b/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def @@ -1283,6 +1283,7 @@ __OMP_TRAIT_PROPERTY(device, arch, ppc64le) __OMP_TRAIT_PROPERTY(device, arch, x86) __OMP_TRAIT_PROPERTY(device, arch, x86_64) __OMP_TRAIT_PROPERTY(device, arch, amdgcn) +__OMP_TRAIT_PROPERTY(device, arch, amdgpu) __OMP_TRAIT_PROPERTY(device, arch, nvptx) __OMP_TRAIT_PROPERTY(device, arch, nvptx64) __OMP_TRAIT_PROPERTY(device, arch, spirv64) _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
