llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
27.92k stars 11.52k forks source link

[SPIR-V][clang] `--save-temps` cancels `-fintegrated-objemitter` #72866

Open linehill opened 9 months ago

linehill commented 9 months ago

For example:

$ clang -target spirv64v1.2 -fintegrated-objemitter empty.cl -c --save-temps -###
clang version 18.0.0 (git@github.com:CHIP-SPV/llvm-project.git 8e7d42c1562f9961e5c8cdeef6490e0670b27409)
Target: spirv64v1.2
Thread model: posix
InstalledDir: /mnt/md0/linehill/ws-chipstar-4/spirv-be-issues/../install/bin
 "/mnt/md0/linehill/ws-chipstar-4/install/bin/clang-18" "-cc1" "-triple" "spirv64v1.2" "-Wspir-compat" "-E" "-save-temps=cwd" "-disable-free" "-clear-ast-before-backend" "-main-file-name" "empty.cl" "-mrelocation-model" "static" "-mframe-pointer=all" "-ffp-contract=on" "-fno-rounding-math" "-mconstructor-aliases" "-debugger-tuning=gdb" "-fdebug-compilation-dir=/mnt/md0/linehill/ws-chipstar-4/spirv-be-issues" "-fcoverage-compilation-dir=/mnt/md0/linehill/ws-chipstar-4/spirv-be-issues" "-resource-dir" "/mnt/md0/linehill/ws-chipstar-4/install/lib/clang/18" "-ferror-limit" "19" "-finclude-default-header" "-fdeclare-opencl-builtins" "-fgnuc-version=4.2.1" "-fno-threadsafe-statics" "-fcolor-diagnostics" "-o" "empty.i" "-x" "cl" "empty.cl"
 "/mnt/md0/linehill/ws-chipstar-4/install/bin/clang-18" "-cc1" "-triple" "spirv64v1.2" "-Wspir-compat" "-emit-llvm-bc" "-emit-llvm-uselists" "-save-temps=cwd" "-disable-free" "-clear-ast-before-backend" "-main-file-name" "empty.cl" "-mrelocation-model" "static" "-mframe-pointer=all" "-ffp-contract=on" "-fno-rounding-math" "-mconstructor-aliases" "-debugger-tuning=gdb" "-fdebug-compilation-dir=/mnt/md0/linehill/ws-chipstar-4/spirv-be-issues" "-fcoverage-compilation-dir=/mnt/md0/linehill/ws-chipstar-4/spirv-be-issues" "-resource-dir" "/mnt/md0/linehill/ws-chipstar-4/install/lib/clang/18" "-ferror-limit" "19" "-fgnuc-version=4.2.1" "-fcolor-diagnostics" "-disable-llvm-passes" "-o" "empty.bc" "-x" "cpp-output" "empty.i"
 "llvm-spirv" "empty.bc" "--spirv-tools-dis" "-o" "empty.s"
 "llvm-spirv" "empty.s" "-to-binary" "-o" "empty.o"

LLVM-SPIRV-Translator is used unexpectedly instead of the SPIR-V backend.

linehill commented 9 months ago

(git@github.com:CHIP-SPV/llvm-project.git 8e7d42c1562f9961e5c8cdeef6490e0670b27409)

A clarification that the fork here is based on e582fe64449b56005b945a32cc06e70bd8ef6ab1 and the local changes are limited to HIPSPV toolchain which shouldn't affect the SPIR-V toolchain.