[clang] clang/AMDGPU: Merge toolchain subclasses (PR #204863)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 29 10:50:36 PDT 2026


arsenm wrote:

> I think `BoundArch("")` should behave the same as no bound arch. Right now it has an empty `ArchName` but `Arch == Unknown`, so `BA.empty()` is true while `if (BA)` is also true. Several call sites use these checks as if they both mean “has an arch”, e.g. HIP bundling uses both forms in the same block. Could we make the StringRef constructor keep empty names as `OffloadArch::Unused`, or make `operator bool()` check `!ArchName.empty()`?

I think using an explicit empty string should be illegal. I originally had operator bool() check the name, but decided semantically the string shouldn't matter. Really the string is just there for the CPU case where the target names all don't have a corresponding OffloadArch 

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


More information about the cfe-commits mailing list