Skip to content

Commit 9371114

Browse files
sarnexgithub-actions[bot]
authored andcommitted
Automerge: [Offload] Change ELF machine type for SPIR-V OpenMP image (#159623)
This needs to match the runtime plugin (currently in PR [here](llvm/llvm-project#158900)), and use the recently-added `INTELGT` machine type which is correct for Intel GPU images. --------- Signed-off-by: Sarnie, Nick <[email protected]>
2 parents 4908d81 + 2bbc740 commit 9371114

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

clang/test/Tooling/clang-linker-wrapper-spirv-elf.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@
77
// RUN: %clangxx -fopenmp -fopenmp-targets=spirv64-intel -nogpulib -c -o %t_clang-linker-wrapper-spirv-elf.o %s
88
// RUN: not clang-linker-wrapper -o a.out %t_clang-linker-wrapper-spirv-elf.o --save-temps --linker-path=ld
99
// RUN: clang-offload-packager --image=triple=spirv64-intel,kind=openmp,file=%t.elf %t_tmp/a.out.openmp.image.wrapper.o
10+
// RUN: llvm-readelf -h %t.elf | FileCheck -check-prefix=CHECK-MACHINE %s
1011
// RUN: llvm-readelf -t %t.elf | FileCheck -check-prefix=CHECK-SECTION %s
1112
// RUN: llvm-readelf -n %t.elf | FileCheck -check-prefix=CHECK-NOTES %s
1213

14+
// CHECK-MACHINE: Machine: Intel Graphics Technology
15+
1316
// CHECK-SECTION: .note.inteloneompoffload
1417
// CHECK-SECTION: __openmp_offload_spirv_0
1518

llvm/lib/Frontend/Offloading/Utility.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,7 @@ Error offloading::intel::containerizeOpenMPSPIRVImage(
423423
Header.Class = ELF::ELFCLASS64;
424424
Header.Data = ELF::ELFDATA2LSB;
425425
Header.Type = ELF::ET_DYN;
426-
// Use an existing Intel machine type as there is not one specifically for
427-
// Intel GPUs.
428-
Header.Machine = ELF::EM_IA_64;
426+
Header.Machine = ELF::EM_INTELGT;
429427

430428
// Create a section with notes.
431429
ELFYAML::NoteSection Section{};

0 commit comments

Comments
 (0)