[all-commits] [llvm/llvm-project] 640079: clang/AMDGPU: Merge toolchain subclasses (#204863)

Matt Arsenault via All-commits all-commits at lists.llvm.org
Fri Jul 10 05:30:21 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 640079288c5ea829f481b4904217a386b5c38959
      https://github.com/llvm/llvm-project/commit/640079288c5ea829f481b4904217a386b5c38959
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2026-07-10 (Fri, 10 Jul 2026)

  Changed paths:
    M clang/lib/Driver/CMakeLists.txt
    M clang/lib/Driver/Driver.cpp
    M clang/lib/Driver/ToolChains/AMDGPU.cpp
    M clang/lib/Driver/ToolChains/AMDGPU.h
    R clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp
    R clang/lib/Driver/ToolChains/AMDGPUOpenMP.h
    M clang/lib/Driver/ToolChains/HIPAMD.cpp
    M clang/lib/Driver/ToolChains/HIPAMD.h
    M clang/test/Driver/hip-device-libs-llvm-env.hip
    M clang/test/Driver/hip-toolchain-no-rdc.hip

  Log Message:
  -----------
  clang/AMDGPU: Merge toolchain subclasses (#204863)

Simplify the toolchain implementations by collapsing
them into one. Previously we had a confusing split. The
AMDGPUToolChain base class implemented much of the base
support. It was subclassed by ROCMToolChain, which would
have been more accurately described as the offloading subclass.

That was further subclassed into HIP and OpenMP specific subclasses.
Deleting those two is the important part of this change. There was
code duplication, and features arbitrarily handled in one but not
the other. The offload kind is passed in almost everywhere if you
really need to know the original language. However, I consider
this an antifeature, and it is really poor QoI to have the HIP
and OpenMP toolchains behave differently in any way. The platform
should be consistent and the driver behaviors should not depend
on the language.

There is additional mess in the handling of spirv, which this
only partially addresses. There are two different spirv toolchain
paths, which for some reason is keyed off of the amdhsa OS, which
is not the property that should change this. I think it will
ultimately be simplier to just merge all spirv handling into HIPSPV.

The copy-paste machine did most of the work here, and I manually
applied some logical fixups that became apparent after the merge.

Co-Authored-By: Claude <noreply at anthropic.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list