[Lldb-commits] [lldb] [lldb] Use TargetParser for AMDGPU architectures (PR #223192)
satyanarayana reddy janga via lldb-commits
lldb-commits at lists.llvm.org
Wed Sep 30 13:48:37 PDT 2026
================
@@ -1031,6 +847,19 @@ void ArchSpec::MergeFrom(const ArchSpec &other) {
if (other.GetCore() != eCore_uknownMach64)
UpdateCore();
}
+ // AMDGPU models share one LLDB core, so merge their triple subarchitectures
+ // explicitly. Keep this ArchSpec's platform fields in the comparison triple
+ // because they are handled separately in this function.
+ if (GetTriple().getArch() == llvm::Triple::amdgpu &&
+ other.GetTriple().getArch() == llvm::Triple::amdgpu) {
+ llvm::Triple other_arch = GetTriple();
+ other_arch.setArch(other.GetTriple().getArch(),
+ other.GetTriple().getSubArch());
+ if (GetTriple().isCompatibleWith(other_arch)) {
+ llvm::Triple merged(GetTriple().merge(other_arch));
+ GetTriple().setArch(merged.getArch(), merged.getSubArch());
+ }
+ }
----------------
satyajanga wrote:
I still had to keep the AMDGPU guard because `Triple::merge` also rewrites unrelated architectures; without it, LLDB regresses cases such as `arm64` → `aarch64` and `armv7em` → `arm` and the relevant tests are failing.
https://github.com/llvm/llvm-project/pull/223192
More information about the lldb-commits
mailing list