================
@@ -30,30 +30,37 @@ be passed down to downstream AOT compilation tools like 
'ocloc' and 'opencl-aot'
 
 ```console
 OVERVIEW: A utility that wraps around the SYCL device code linking process.
-This enables LLVM IR linking, post-linking and code generation for SPIR-V
-JIT and AOT targets.
+This enables LLVM IR linking, post-linking and code generation for SPIR-V JIT 
and AOT targets.
 
 USAGE: clang-sycl-linker [options] <input bitcode files>
 
 OPTIONS:
-  --arch <value>                Specify the name of the target architecture.
-  --dry-run                     Print generated commands without running.
-  -help-hidden                  Display all available options
-  -help                         Display available options (--help-hidden for 
more)
-  -L <dir>                      Add <dir> to the library search path
-  -l <libname>                  Search for library <libname>
-  --whole-archive               Include all archive members in the link
-  --no-whole-archive            Only include archive members that resolve 
undefined symbols (default)
-  -u <symbol>                   Force undefined symbol during linking
-  --module-split-mode=<mode>    Module split mode: 'translation_unit' 
(default), 'kernel', or 'link_unit'
-  --ocloc-options=<value>       Options passed to ocloc for Intel GPU AOT 
compilation
-  --opencl-aot-options=<value>  Options passed to opencl-aot for Intel CPU AOT 
compilation
-  -o <path>                     Path to file to write output
-  --save-temps                  Save intermediate results
-  --triple <value>              Specify the target triple.
-  --version                     Display the version number and exit
-  -v                            Print verbose information
-  -spirv-dump-device-code=<dir> Directory to dump SPIR-V IR code into
+  --arch=<arch>           The device architecture
+  --code=<device>         Specify a real device to compile ahead of time for. 
Can be repeated. Without it, a real --arch is compiled ahead of time and a 
virtual one is kept for just-in-time compilation.
----------------
srividya-sundaram wrote:

Right, the option is resolved before clang-sycl-linker. Besides `--arch` and 
`--code`, it only gets `--no-embed-virtual-arch` (added in 
https://github.com/llvm/llvm-project/pull/242407), and the SPIR-V is kept by 
`ocloc` inside its output unless it gets `-exclude_ir`:

```
Default:
  clang++ -fsycl --offload-arch=xe-mtl-u -c a.cpp
    -> device image: arch=igca_30r, code=xe-mtl-u
  clang++ -fsycl --offload-arch=xe-mtl-u a.o -o app
    -> clang-sycl-linker -arch=igca_30r --code=xe-mtl-u
         -> ocloc -device xe-mtl-u -file a.spv
              -> native code for xe-mtl-u + the SPIR-V (.spv section)

With --no-offload-embed-virtual-arch:
  clang++ -fsycl --offload-arch=xe-mtl-u --no-offload-embed-virtual-arch -c 
a.cpp
    -> device image: arch=igca_30r, code=xe-mtl-u, no-embed-virtual-arch=1
  clang++ -fsycl --offload-arch=xe-mtl-u a.o -o app
    -> clang-sycl-linker -arch=igca_30r --code=xe-mtl-u --no-embed-virtual-arch
         -> ocloc -device xe-mtl-u -file a.spv -exclude_ir
              -> native code for xe-mtl-u only
```

clang-linker-wrapper passes `--no-embed-virtual-arch` only if all device images 
of the device link have `no-embed-virtual-arch`.


https://github.com/llvm/llvm-project/pull/239010
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to