[PATCH] D125050: [OpenMP] Try to Infer target triples using the offloading architecture
Saiyedul Islam via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri May 6 03:30:12 PDT 2022
saiislam added a comment.
Looks good to me.
Will it work with `-fno-openmp`? Sometimes `-fno-openmp` is used by the end-user to override system provided `-fopenmp` flag for some translation units.
Please have a look at following examples:
// RUN: %clang -### -target x86_64-linux-gnu \
// RUN: --offload-arch=gfx906 \
// RUN: %s 2>&1 | FileCheck -check-prefix=OFFLOAD %s
// OFFLOAD: warning: argument unused during compilation: '--offload-arch=gfx906'
// RUN: %clang -### -target x86_64-linux-gnu -fopenmp\
// RUN: --offload-arch=gfx906 \
// RUN: -fno-openmp \
// RUN: %s 2>&1 | FileCheck -check-prefix=OFFLOAD1 %s
// OFFLOAD1: warning: argument unused during compilation: '--offload-arch=gfx906'
// RUN: %clang -### -target x86_64-linux-gnu -fopenmp\
// RUN: -fopenmp-targets=amdgcn-amd-amdhsa,amdgcn-amd-amdhsa \
// RUN: -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx906 \
// RUN: -fno-openmp \
// RUN: %s 2>&1 | FileCheck -check-prefix=LEGACY %s
// LEGACY: warning: '-fopenmp-targets' must be used in conjunction with a '-fopenmp' option compatible with offloading; e.g., '-fopenmp=libomp' or '-fopenmp=libiomp5'
// LEGACY-NEXT: warning: argument unused during compilation: '-Xopenmp-target=amdgcn-amd-amdhsa -march=gfx906'
// RUN: %clang -### -target x86_64-linux-gnu -fopenmp\
// RUN: --offload-arch=gfx906 \
// RUN: --offload-arch=gfx908 \
// RUN: -fno-openmp \
// RUN: %s 2>&1 | FileCheck -check-prefix=MOFFLOAD %s
// MOFFLOAD: warning: argument unused during compilation: '--offload-arch=gfx906'
// MOFFLOAD-NEXT: warning: argument unused during compilation: '--offload-arch=gfx908'
// RUN: %clang -### -target x86_64-linux-gnu -fopenmp\
// RUN: -fopenmp-targets=amdgcn-amd-amdhsa,amdgcn-amd-amdhsa \
// RUN: -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx906 \
// RUN: -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx908 \
// RUN: -fno-openmp \
// RUN: %s 2>&1 | FileCheck -check-prefix=MLEGACY %s
// MLEGACY: warning: '-fopenmp-targets' must be used in conjunction with a '-fopenmp' option compatible with offloading; e.g., '-fopenmp=libomp' or '-fopenmp=libiomp5'
// MLEGACY: warning: argument unused during compilation: '-Xopenmp-target=amdgcn-amd-amdhsa -march=gfx906'
// MLEGACY: warning: argument unused during compilation: '-Xopenmp-target=amdgcn-amd-amdhsa -march=gfx908'
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D125050/new/
https://reviews.llvm.org/D125050
More information about the cfe-commits
mailing list