[OpenMP] Clean up AMD handling for `-fopenmp-targets=amdgcn` arch inference
authorJoseph Huber <jhuber6@vols.utk.edu>
Thu, 19 Jan 2023 17:49:15 +0000 (11:49 -0600)
committerJoseph Huber <jhuber6@vols.utk.edu>
Fri, 20 Jan 2023 23:33:56 +0000 (17:33 -0600)
commit255922be7f008362bae16c708a2d90f60b4aba35
treef5774ed619fee745223598b71053e4e38c8324b8
parent56b038f887f37f69afac2d3abe02b46dcb9305ec
[OpenMP] Clean up AMD handling for `-fopenmp-targets=amdgcn` arch inference

Previously we had some special handling here that errored out if
multiple architectures were detected. This isn't a problem anymore as
the runtime can handle multi-archicture binaries automatically. So it's
safe to simply take the first architecture that we know works. If users
use `--offload-arch=native` instead it will build for all the
architectures at the same time rather than just picking one. This patch
makes it consisten with the NVPTX version.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D142138
clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp
clang/test/Driver/amdgpu-openmp-system-arch-fail.c