[all-commits] [llvm/llvm-project] 5e3633: AMDGPU: Respect target assembler directives over c...

Matt Arsenault via All-commits all-commits at lists.llvm.org
Tue Jul 14 00:29:39 PDT 2026


  Branch: refs/heads/users/arsenm/amdgpu/repect-not-validate-amdgcn-targetid-directive
  Home:   https://github.com/llvm/llvm-project
  Commit: 5e363317813de716f6c31ea9824e4a9dc9b38c7f
      https://github.com/llvm/llvm-project/commit/5e363317813de716f6c31ea9824e4a9dc9b38c7f
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2026-07-14 (Tue, 14 Jul 2026)

  Changed paths:
    M llvm/include/llvm/MC/MCSubtargetInfo.h
    M llvm/include/llvm/TargetParser/AMDGPUTargetParser.h
    M llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
    M llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
    A llvm/test/MC/AMDGPU/amdgcn-target-directive-conflict.s
    M llvm/test/MC/AMDGPU/amdgcn-target-directive-triple-env.s
    M llvm/test/MC/AMDGPU/hsa-diag-v4.s
    M llvm/test/MC/AMDGPU/hsa-exp.s
    M llvm/test/MC/AMDGPU/hsa-gfx12-v4.s
    M llvm/test/MC/AMDGPU/hsa-gfx13-v4.s
    M llvm/test/MC/AMDGPU/hsa-tg-split.s
    M llvm/test/MC/AMDGPU/hsa-v4.s
    M llvm/test/MC/AMDGPU/hsa-v5-uses-dynamic-stack.s
    M llvm/test/MC/AMDGPU/isa-version-hsa.s
    M llvm/test/MC/AMDGPU/isa-version-pal.s
    M llvm/test/MC/AMDGPU/isa-version-unk.s

  Log Message:
  -----------
  AMDGPU: Respect target assembler directives over command line

Mutate the global subtarget, using essentially the same code that ARM uses.
The main difference is we need to mutate the actual CPU name in addition
to just flipping the feature bits, so this needs a new setter in
MCSubtargetInfo. Liberalize the triple check so that after #206480,
old assembly files to not break on new assembler invocations.

For some reason we have 2 different assembler directives that indicate the
target, .amdgcn_target for amdhsa and .amd_amdgpu_isa for amdpal. Previously,
we would take the target from the command line and then error if the directive
did not exactly match. In order to move away from depending on the xnack and
sramecc subtarget features, start treating the directives as a change of target,
similar to ARM's .cpu and .arch directives.

Both .amdgcn_target and .amd_amdgpu_isa encode full triples, but unlike
.amdgcn_target, the PAL directive does not include xnack or sramecc. Ideally
we would introduce new independent directives for these.

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


  Commit: 9f92bf208204b1b81771f266020de9cd3e27228d
      https://github.com/llvm/llvm-project/commit/9f92bf208204b1b81771f266020de9cd3e27228d
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2026-07-14 (Tue, 14 Jul 2026)

  Changed paths:
    M llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
    M llvm/test/MC/AMDGPU/amdgcn-target-directive-triple-env.s
    M llvm/test/MC/AMDGPU/hsa-diag-v4.s
    M llvm/test/MC/AMDGPU/isa-version-hsa.s
    M llvm/test/MC/AMDGPU/isa-version-pal.s
    M llvm/test/MC/AMDGPU/isa-version-unk.s

  Log Message:
  -----------
  Clarify .amdgcn_target processor mismatch diagnostic


  Commit: 4b3d92c28ab6260d997ffb30b6540053d93c2b7b
      https://github.com/llvm/llvm-project/commit/4b3d92c28ab6260d997ffb30b6540053d93c2b7b
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2026-07-14 (Tue, 14 Jul 2026)

  Changed paths:
    M llvm/include/llvm/MC/MCSubtargetInfo.h

  Log Message:
  -----------
  Drop setCPU change


  Commit: 473067980f9b9f2324dd25cb7bd327412f7c02cd
      https://github.com/llvm/llvm-project/commit/473067980f9b9f2324dd25cb7bd327412f7c02cd
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2026-07-14 (Tue, 14 Jul 2026)

  Changed paths:
    M llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp

  Log Message:
  -----------
  remove r600 check


  Commit: 5707f05917319933e2614a8fdddd75cb398e47b3
      https://github.com/llvm/llvm-project/commit/5707f05917319933e2614a8fdddd75cb398e47b3
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2026-07-14 (Tue, 14 Jul 2026)

  Changed paths:
    M llvm/test/MC/AMDGPU/amdgcn-target-directive-subarch-cpu-field.s

  Log Message:
  -----------
  Fix test after rebases


  Commit: f610b898d36ddf8ba83b4870311f127e43923a95
      https://github.com/llvm/llvm-project/commit/f610b898d36ddf8ba83b4870311f127e43923a95
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2026-07-14 (Tue, 14 Jul 2026)

  Changed paths:
    M llvm/test/MC/ELF/AMDGPU/cfi.s

  Log Message:
  -----------
  Update cfi test


Compare: https://github.com/llvm/llvm-project/compare/5b825abd7af2...f610b898d36d

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