[clang] [Clang][SYCL] Add AOT compilation support for Intel GPUs in clang-sycl-linker (PR #133194)

Justin Cai via cfe-commits cfe-commits at lists.llvm.org
Tue May 6 15:25:32 PDT 2025


================
@@ -440,9 +570,15 @@ int main(int argc, char **argv) {
   DryRun = Args.hasArg(OPT_dry_run);
   SaveTemps = Args.hasArg(OPT_save_temps);
 
-  OutputFile = "a.out";
-  if (Args.hasArg(OPT_o))
-    OutputFile = Args.getLastArgValue(OPT_o);
+  IsAOTCompileNeeded = IsIntelOffloadArch(
+      StringToOffloadArch(Args.getLastArgValue(OPT_arch_EQ)));
+
+  if (!Args.hasArg(OPT_o))
----------------
jzc wrote:

I think for the AOT compilation functionality these changes are not strictly required, so I could remove them if we want to. For the `OPT_o` check, I believe there was an earlier review comment noting that the default `a.out` name conflicts with clang's default `a.out` name, so I made `OPT_o` mandatory. For `OPT_triple_eq`, we use it throughout `clang-sycl-linker` assuming it is nonempty.

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


More information about the cfe-commits mailing list