Skip to content

Commit 74e6ce2

Browse files
committed
[Frontend] Allow OpenMP offloading to aarch64
Summary: D30644 added OpenMP offloading to AArch64 targets, then D32035 changed the frontend to throw an error when offloading is requested for an unsupported target architecture. However the latter did not include AArch64 in the list of supported architectures, causing the following unit tests to fail: libomptarget :: api/omp_get_num_devices.c libomptarget :: mapping/pr38704.c libomptarget :: offloading/offloading_success.c libomptarget :: offloading/offloading_success.cpp Reviewers: pawosm01, gtbercea, jdoerfert, ABataev Subscribers: kristof.beyls, guansong, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70804
1 parent 1c4dd3a commit 74e6ce2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3070,7 +3070,8 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
30703070
llvm::Triple TT(A->getValue(i));
30713071

30723072
if (TT.getArch() == llvm::Triple::UnknownArch ||
3073-
!(TT.getArch() == llvm::Triple::ppc ||
3073+
!(TT.getArch() == llvm::Triple::aarch64 ||
3074+
TT.getArch() == llvm::Triple::ppc ||
30743075
TT.getArch() == llvm::Triple::ppc64 ||
30753076
TT.getArch() == llvm::Triple::ppc64le ||
30763077
TT.getArch() == llvm::Triple::nvptx ||

clang/test/OpenMP/openmp_offload_registration.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
// Test for offload registration code for two targets
1+
// Test offload registration for two targets, and test offload target validation.
22
// RUN: %clang_cc1 -verify -fopenmp -x c -triple x86_64-unknown-linux-gnu -fopenmp-targets=x86_64-pc-linux-gnu,powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s
3+
// RUN: %clang_cc1 -verify -fopenmp -x c -triple x86_64-unknown-linux-gnu -fopenmp-targets=aarch64-unknown-linux-gnu -emit-llvm %s -o - | FileCheck %s
34
// expected-no-diagnostics
45

56
void foo() {

0 commit comments

Comments
 (0)