Author: Nick Sarnie Date: 2025-09-22T15:53:19Z New Revision: 2bbc7405733020084d4c4a90de690e3fc3cff8f5
URL: https://github.com/llvm/llvm-project/commit/2bbc7405733020084d4c4a90de690e3fc3cff8f5 DIFF: https://github.com/llvm/llvm-project/commit/2bbc7405733020084d4c4a90de690e3fc3cff8f5.diff LOG: [Offload] Change ELF machine type for SPIR-V OpenMP image (#159623) This needs to match the runtime plugin (currently in PR [here](https://github.com/llvm/llvm-project/pull/158900)), and use the recently-added `INTELGT` machine type which is correct for Intel GPU images. --------- Signed-off-by: Sarnie, Nick <[email protected]> Added: Modified: clang/test/Tooling/clang-linker-wrapper-spirv-elf.cpp llvm/lib/Frontend/Offloading/Utility.cpp Removed: ################################################################################ diff --git a/clang/test/Tooling/clang-linker-wrapper-spirv-elf.cpp b/clang/test/Tooling/clang-linker-wrapper-spirv-elf.cpp index af98904677283..85208fc8e925c 100644 --- a/clang/test/Tooling/clang-linker-wrapper-spirv-elf.cpp +++ b/clang/test/Tooling/clang-linker-wrapper-spirv-elf.cpp @@ -7,9 +7,12 @@ // RUN: %clangxx -fopenmp -fopenmp-targets=spirv64-intel -nogpulib -c -o %t_clang-linker-wrapper-spirv-elf.o %s // RUN: not clang-linker-wrapper -o a.out %t_clang-linker-wrapper-spirv-elf.o --save-temps --linker-path=ld // RUN: clang-offload-packager --image=triple=spirv64-intel,kind=openmp,file=%t.elf %t_tmp/a.out.openmp.image.wrapper.o +// RUN: llvm-readelf -h %t.elf | FileCheck -check-prefix=CHECK-MACHINE %s // RUN: llvm-readelf -t %t.elf | FileCheck -check-prefix=CHECK-SECTION %s // RUN: llvm-readelf -n %t.elf | FileCheck -check-prefix=CHECK-NOTES %s +// CHECK-MACHINE: Machine: Intel Graphics Technology + // CHECK-SECTION: .note.inteloneompoffload // CHECK-SECTION: __openmp_offload_spirv_0 diff --git a/llvm/lib/Frontend/Offloading/Utility.cpp b/llvm/lib/Frontend/Offloading/Utility.cpp index 5dcc16d23004c..4b75307ca0b6c 100644 --- a/llvm/lib/Frontend/Offloading/Utility.cpp +++ b/llvm/lib/Frontend/Offloading/Utility.cpp @@ -423,9 +423,7 @@ Error offloading::intel::containerizeOpenMPSPIRVImage( Header.Class = ELF::ELFCLASS64; Header.Data = ELF::ELFDATA2LSB; Header.Type = ELF::ET_DYN; - // Use an existing Intel machine type as there is not one specifically for - // Intel GPUs. - Header.Machine = ELF::EM_IA_64; + Header.Machine = ELF::EM_INTELGT; // Create a section with notes. ELFYAML::NoteSection Section{}; _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
