[clang] [llvm] [SYCL] Shorten triple form in device binary. (PR #231446)

Alexey Bader via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 13 08:01:23 PDT 2026


================
@@ -1043,8 +1043,12 @@ static Error runSYCLLink(ArrayRef<std::unique_ptr<MemoryBuffer>> Inputs,
     OffloadingImage TheImage{};
     TheImage.TheImageKind = IsAOTCompileNeeded ? IMG_Object : IMG_SPIRV;
     TheImage.TheOffloadKind = OFK_SYCL;
+    // Pack the short form of the triple. The runtime only needs to know which
+    // binary format the image holds, and the architecture is the single
+    // canonical spelling of it: inputs may spell the same target as 'spirv64'
+    // or 'spirv64-unknown-unknown'.
     TheImage.StringData["triple"] =
-        Args.MakeArgString(Result.TargetTriple.str());
+        Args.MakeArgString(Result.TargetTriple.getArchName());
----------------
bader wrote:

Instead of using `Arch`, use normalized triple.

https://github.com/llvm/llvm-project/pull/231446


More information about the cfe-commits mailing list