[PATCH] D106809: [clang-offload-bundler] Make Bundle Entry ID backward compatible

Saiyedul Islam via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 26 10:09:07 PDT 2021


saiislam created this revision.
saiislam added reviewers: jdoerfert, yaxunl, grokos.
saiislam requested review of this revision.
Herald added subscribers: cfe-commits, sstefan1.
Herald added a project: clang.

Earlier BundleEntryID used to be <OffloadKind>-<Triple>-<GPUArch>.
This used to work because the clang-offload-bundler didn't need
GPUArch explicitly for any bundling/unbundling action. With
unbundleArchive it needs GPUArch to ensure compatibility between
device specific code objects. D93525 <https://reviews.llvm.org/D93525> enforced triples to have
separators for all 4 components irrespective of number of
components, like "amdgcn-amd-amdhsa--". It was required to
to correctly parse a possible 4th environment component or a GPU.
But, this condition is breaking backward compatibility with
archive libraries compiled with compilers older than D93525 <https://reviews.llvm.org/D93525>.

This patch allows triples to have any number of components with
and without extra separator for empty environment field. Thus,
both the following bundle entry IDs are same:
openmp-amdgcn-amd-amdhsa--gfx906
openmp-amdgcn-amd-amdhsa-gfx906


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D106809

Files:
  clang/docs/ClangOffloadBundler.rst
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Driver/clang-offload-bundler.c
  clang/test/Driver/hip-rdc-device-only.hip
  clang/test/Driver/hip-toolchain-rdc-separate.hip
  clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106809.361711.patch
Type: text/x-patch
Size: 11537 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210726/1b333ada/attachment-0001.bin>


More information about the cfe-commits mailing list