[all-commits] [llvm/llvm-project] 803d84: clang/AMDGPU: Stop passing redundant -target-cpu t...

Matt Arsenault via All-commits all-commits at lists.llvm.org
Mon Jul 6 12:51:33 PDT 2026


  Branch: refs/heads/users/arsenm/clang/driver-amdgpu-avoid-redundant-target-cpu
  Home:   https://github.com/llvm/llvm-project
  Commit: 803d84a9d733e12f0dc15457ed9af5e540c6b9d9
      https://github.com/llvm/llvm-project/commit/803d84a9d733e12f0dc15457ed9af5e540c6b9d9
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2026-07-06 (Mon, 06 Jul 2026)

  Changed paths:
    M clang/lib/Basic/Targets/AMDGPU.cpp
    M clang/lib/Driver/ToolChains/CommonArgs.cpp
    M clang/test/CodeGenHIP/hip-cumode.hip
    M clang/test/Driver/amdgpu-hip-system-arch.c
    M clang/test/Driver/amdgpu-macros.cl
    M clang/test/Driver/amdgpu-mcpu.cl
    M clang/test/Driver/amdgpu-openmp-sanitize-options.c
    M clang/test/Driver/amdgpu-openmp-toolchain.c
    M clang/test/Driver/amdgpu-xnack-sramecc-flags.c
    M clang/test/Driver/cuda-flush-denormals-to-zero.cu
    M clang/test/Driver/hip-cuid-hash.hip
    M clang/test/Driver/hip-cuid.hip
    M clang/test/Driver/hip-default-gpu-arch.hip
    M clang/test/Driver/hip-device-compile.hip
    M clang/test/Driver/hip-gsplit-dwarf-options.hip
    M clang/test/Driver/hip-macros.hip
    M clang/test/Driver/hip-offload-arch.hip
    M clang/test/Driver/hip-rdc-device-only.hip
    M clang/test/Driver/hip-sanitize-options.hip
    M clang/test/Driver/hip-save-temps.hip
    M clang/test/Driver/hip-target-id.hip
    M clang/test/Driver/hip-toolchain-device-only.hip
    M clang/test/Driver/hip-toolchain-mllvm.hip
    M clang/test/Driver/hip-toolchain-no-rdc.hip
    M clang/test/Driver/hip-toolchain-rdc-separate.hip
    M clang/test/Driver/hip-toolchain-rdc-static-lib.hip
    M clang/test/Driver/hip-toolchain-rdc.hip
    M clang/test/Driver/hip-unbundle-preproc.hipi
    M clang/test/Driver/hip-wavefront-size.hip
    M clang/test/Driver/openmp-offload-infer.c
    M clang/test/Driver/openmp-system-arch.c
    M clang/test/Driver/target-id.cl
    A clang/test/Preprocessor/amdgpu-subarch-cc1-target-cpu.cl

  Log Message:
  -----------
  clang/AMDGPU: Stop passing redundant -target-cpu to cc1

Now that the exact target is encoded in the triple's subarch field,
-target-cpu is redundant. This avoids polluting the resultant IR with
unwanted "target-cpu" attributes. The net result is the desired codegen
when compiling libraries for a major subarch and linking it into a
program compiled for a specific arch. e.g., compiling for "gfx9-generic"
would pollute the IR with "target-cpu"="gfx9-generic", so codegen
would ultimately be performed for the generic target even after
linking into the concrete gfx9 cpu. The specialization will now be
achieved by merging the triples without the linker or optimization
passes needing to fixup function attributes.



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