diff options
| author | Yury Plyakhin <yury.plyakhin@intel.com> | 2026-02-11 10:21:22 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-11 10:21:22 -0800 |
| commit | 81f445b7df94de485240b21034682f22432729c4 (patch) | |
| tree | 8888877defebbabcc936e0977deeae5bc747bdae /llvm | |
| parent | 8c93fb0c05fc12b7f6bfa2b55b969d567aeb0537 (diff) | |
| download | llvm-81f445b7df94de485240b21034682f22432729c4.tar.gz llvm-81f445b7df94de485240b21034682f22432729c4.tar.bz2 llvm-81f445b7df94de485240b21034682f22432729c4.zip | |
[clang-sycl-linker][offload] Set TheImageKind based on IsAOTCompileNeeded flag (#180269)
Previously, TheImageKind was set to IMG_None and relied on a runtime
heuristic to determine the correct image type. This commit sets it
explicitly to IMG_Object for AOT-compiled images and IMG_SPIRV for
SPIR-V images based on the IsAOTCompileNeeded flag.
Also it adds test for this change, which required minor changes in
OffloadBinary and OffloadDump.
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Object/OffloadBinary.cpp | 3 | ||||
| -rw-r--r-- | llvm/tools/llvm-objdump/OffloadDump.cpp | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Object/OffloadBinary.cpp b/llvm/lib/Object/OffloadBinary.cpp index 79c1e4239292..f535f4477357 100644 --- a/llvm/lib/Object/OffloadBinary.cpp +++ b/llvm/lib/Object/OffloadBinary.cpp @@ -423,6 +423,7 @@ ImageKind object::getImageKind(StringRef Name) { .Case("cubin", IMG_Cubin) .Case("fatbin", IMG_Fatbinary) .Case("s", IMG_PTX) + .Case("spv", IMG_SPIRV) .Default(IMG_None); } @@ -438,6 +439,8 @@ StringRef object::getImageKindName(ImageKind Kind) { return "fatbin"; case IMG_PTX: return "s"; + case IMG_SPIRV: + return "spv"; default: return ""; } diff --git a/llvm/tools/llvm-objdump/OffloadDump.cpp b/llvm/tools/llvm-objdump/OffloadDump.cpp index a77537dd90ee..cd2727069c2e 100644 --- a/llvm/tools/llvm-objdump/OffloadDump.cpp +++ b/llvm/tools/llvm-objdump/OffloadDump.cpp @@ -36,6 +36,8 @@ static StringRef getImageName(const OffloadBinary &OB) { return "fatbinary"; case IMG_PTX: return "ptx"; + case IMG_SPIRV: + return "spir-v"; default: return "<none>"; } |
