yxsamliu wrote:

> First of all, I don't think it can fix the issue in a robust way. Second, 
> `generic` is already a valid target/cpu/offload target.
> 
> Unless we do something like, if the last part is `generic`, we keep looking 
> forward until we can construct a valid target. That has no difference than 
> doing pattern matching, which is back to my previous point about AMD special 
> sauce.
> 
> If we assert that the offload bundler is an AMD only thing (which TBH really 
> looks like so), I'm fine with adding a bunch of more special sauce here.

offload-bundler is not an AMD only thing. At least HIPSPRV toolchain uses it, 
which is Intel GPU.

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. clang has a function 
getCanonicalProcessorName() which can check whether a string is a valid cpu 
name. Just pass the remaining string to it. If true, that means the remaining 
is a cpu, without env string. Otherwise, assuming there is an env string that 
contains no "-" and split it.

https://github.com/llvm/llvm-project/pull/122629
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to