[all-commits] [llvm/llvm-project] 95349a: AMDGPU: Defer validation of target assembler direc...

Matt Arsenault via All-commits all-commits at lists.llvm.org
Tue Jul 14 01:10:32 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 95349af763cfc48858fdd40058bd46a11779deb2
      https://github.com/llvm/llvm-project/commit/95349af763cfc48858fdd40058bd46a11779deb2
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2026-07-14 (Tue, 14 Jul 2026)

  Changed paths:
    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-subarch-cpu-field.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
    M llvm/test/MC/ELF/AMDGPU/cfi.s

  Log Message:
  -----------
  AMDGPU: Defer validation of target assembler directives (#207812)

Stop immediately emitting the .amdgcn_target directive from the command
line's target, and wait until any target directives in the file are
encountered. This requires lazily emitting the target directive to before the 
point anything is to be emitted. Weaken the validation that the xnack and 
sramecc settings match the command line's state, and take the mode from the 
target directive
(mutating the tracked target ID state). Liberalize the triple check so that after
#206480, old assembly files will 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>



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