[all-commits] [llvm/llvm-project] 6141f1: [AMDGPU] Add AMDGPU support for llvm-objcopy

David Salinas via All-commits all-commits at lists.llvm.org
Tue Aug 4 12:38:49 PDT 2026


  Branch: refs/heads/users/dsalinas/amdgpu-llvm-objcopy
  Home:   https://github.com/llvm/llvm-project
  Commit: 6141f1bcc15d0c4cce621d01fffb4cfe26485104
      https://github.com/llvm/llvm-project/commit/6141f1bcc15d0c4cce621d01fffb4cfe26485104
  Author: david-salinas <dsalinas at amd.com>
  Date:   2026-08-04 (Tue, 04 Aug 2026)

  Changed paths:
    M llvm/test/tools/llvm-objcopy/ELF/cross-arch-headers.test
    M llvm/tools/llvm-objcopy/ObjcopyOptions.cpp

  Log Message:
  -----------
  [AMDGPU] Add AMDGPU support for llvm-objcopy

Co-authored-by: Aakanksha Patil <paakan at amd.com>


  Commit: 569d63cbc089f664c16522989b228ef2ecc427f4
      https://github.com/llvm/llvm-project/commit/569d63cbc089f664c16522989b228ef2ecc427f4
  Author: dsalinas <dsalinas at amd.com>
  Date:   2026-08-04 (Tue, 04 Aug 2026)

  Changed paths:
    M llvm/test/tools/llvm-objcopy/ELF/cross-arch-headers.test

  Log Message:
  -----------
  [llvm-objcopy] Fix AMDGPU arch string in test: amdgpu not amdgcn

llvm-readobj reports 'Arch: amdgpu' for EM_AMDGPU ELF files
(the generic AMDGPU ELF format used by elf64-amdgpu). The test
was incorrectly expecting 'amdgcn', which is the AMDGCN-specific
arch string used by ROCm HSA code objects.


  Commit: 1752f08b633593790342dc7a6b4dac016258294c
      https://github.com/llvm/llvm-project/commit/1752f08b633593790342dc7a6b4dac016258294c
  Author: dsalinas <dsalinas at amd.com>
  Date:   2026-08-04 (Tue, 04 Aug 2026)

  Changed paths:
    M llvm/test/tools/llvm-objcopy/ELF/binary-output-target.test

  Log Message:
  -----------
  [llvm-objcopy] Add AMDGPU case to binary-output-target.test

Add test coverage for converting binary input to elf64-amdgpu format,
verifying the output has the correct format string, arch (amdgpu),
and machine type (EM_AMDGPU 0xE0). Follows the same pattern as all
other architectures in this test file.


  Commit: b380f0a04cfb564f0d57a366147f0680a601fab0
      https://github.com/llvm/llvm-project/commit/b380f0a04cfb564f0d57a366147f0680a601fab0
  Author: dsalinas <dsalinas at amd.com>
  Date:   2026-08-04 (Tue, 04 Aug 2026)

  Changed paths:
    M llvm/test/tools/llvm-objcopy/ELF/binary-output-target.test

  Log Message:
  -----------
  [llvm-objcopy] Fix AMDGPU arch checks in tests

ELFObjectFile.h getArch() for EM_AMDGPU returns Triple::UnknownArch
when e_flags & EF_AMDGPU_MACH is 0 (no GPU target specified). Only
when a MACH flag in the AMDGCN range is present does it return
Triple::amdgpu.

- cross-arch-headers.test: restore EF_AMDGPU_MACH_AMDGCN_GFX900 flag
  on the input ELF so that after format conversion the output correctly
  reports Arch: amdgpu.

- binary-output-target.test: expect Arch: unknown since converting
  from raw binary input (-I binary) produces an ELF with e_flags=0
  (no MACH flags), giving UnknownArch. This is correct behavior.


  Commit: c149a5de8e069b5c1de959a862a38f77a6c5eb4e
      https://github.com/llvm/llvm-project/commit/c149a5de8e069b5c1de959a862a38f77a6c5eb4e
  Author: dsalinas <dsalinas at amd.com>
  Date:   2026-08-04 (Tue, 04 Aug 2026)

  Changed paths:
    M llvm/test/tools/llvm-objcopy/ELF/cross-arch-headers.test

  Log Message:
  -----------
  [llvm-objcopy] Address review feedback for AMDGPU test in cross-arch-headers

Per reviewer feedback, use the existing non-AMDGPU input (%t.o, EM_NONE)
to test conversion to elf64-amdgpu. This properly demonstrates that
--output-format changes the machine type, consistent with all other cases
in this test file.

The output reports Arch: unknown because converting from a non-AMDGPU ELF
produces e_flags=0 (no EF_AMDGPU_MACH set); added a comment explaining
this. Flag control is a separate concern for a follow-on PR.


  Commit: 5060c2d74732300384f8cff87f2b5f1f257a04dc
      https://github.com/llvm/llvm-project/commit/5060c2d74732300384f8cff87f2b5f1f257a04dc
  Author: dsalinas <dsalinas at amd.com>
  Date:   2026-08-04 (Tue, 04 Aug 2026)

  Changed paths:
    M llvm/test/tools/llvm-objcopy/ELF/binary-output-target.test
    M llvm/test/tools/llvm-objcopy/ELF/cross-arch-headers.test

  Log Message:
  -----------
  [llvm-objcopy] Address reviewer feedback on AMDGPU test cleanups

- Remove unused -DMACHINE yaml2obj template variable in cross-arch-headers.test,
  hardcode Machine: EM_NONE directly in the YAML instead
- Remove unused Flags: [[FLAGS=<none>]] template variable in cross-arch-headers.test
- Add comment in binary-output-target.test explaining that Arch: unknown is
  intentional when converting from binary (e_flags=0, no EF_AMDGPU_MACH set)


Compare: https://github.com/llvm/llvm-project/compare/7552542b1ca0...5060c2d74732

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