[llvm-branch-commits] [clang] [llvm] [OffloadBundler] Rework the ctor of `OffloadTargetInfo` to support AMDGPU's generic target (PR #122629)

Yaxun Liu via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Jan 14 10:43:35 PST 2025


yxsamliu wrote:

> > > Still, I think it is possible to make it generic with minor assumption. Let's say you are now about to parsing the final part of the target ID string which may be either "env-cpu" or "cpu" without env.
> > 
> > 
> > This is not actually the issue. The issue is when the cpu is a generic target, such as `gfx10-3-generic`. By the current logic, the target id after split is `generic`, which is totally a valid one, and leave the rest with things like `hip-amd-amdhsa-amd-gfx10-3`.
> 
> That is probably due to this line https://github.com/llvm/llvm-project/blob/main/clang/lib/Driver/OffloadBundler.cpp#L88
> 
> It assumes there is no '-' in GPU name.
> 
> we could add a loop. If that line fails, we will split at the second '-' from right.

Ok I get your point. since generic is a valid GPU name. it will stop there.

https://github.com/llvm/llvm-project/pull/122629


More information about the llvm-branch-commits mailing list