CHIP-SPV / chipStar

chipStar is a tool for compiling and running HIP/CUDA on SPIR-V via OpenCL or Level Zero APIs.
Other
166 stars 27 forks source link

Printf tests failing to compile #798

Closed pvelesko closed 3 months ago

pvelesko commented 4 months ago

from #796

[2/145] Building CXX object catch/catch_tests/unit/printf/CMakeFiles/printfSpecifiersNonHost_exe.dir/printfSpecifiersNonHost_exe.cc.o
FAILED: catch/catch_tests/unit/printf/CMakeFiles/printfSpecifiersNonHost_exe.dir/printfSpecifiersNonHost_exe.cc.o 
/space/pvelesko/chipStar/hip-tests-update/build/bin/hipcc -DKERNELS_PATH=\"/space/pvelesko/chipStar/hip-tests-update/hip-tests/catch/kernels/\" -I/space/pvelesko/chipStar/hip-tests-update/CHIP -I/space/pvelesko/chipStar/hip-tests-update/PUBLIC -I/usr/include/level_zero -I/space/pvelesko/chipStar/hip-tests-update/hip-tests/catch/external/Catch2 -I/space/pvelesko/chipStar/hip-tests-update/hip-tests/catch/./include -I/space/pvelesko/chipStar/hip-tests-update/hip-tests/catch/./kernels -I/space/pvelesko/chipStar/hip-tests-update/build/include -I/space/pvelesko/chipStar/hip-tests-update/hip-tests/catch/external/picojson -Wno-duplicate-decl-specifier -Wno-tautological-constant-compare  -Wno-c++20-extensions -Wno-unused-result -Wno-delete-abstract-non-virtual-dtor -Wno-deprecated-declarations -Wunused-command-line-argument --std=c++17 -g -fPIE -Wno-format-extra-args -mf16c -Wall -O1 -std=c++17 -MD -MT catch/catch_tests/unit/printf/CMakeFiles/printfSpecifiersNonHost_exe.dir/printfSpecifiersNonHost_exe.cc.o -MF catch/catch_tests/unit/printf/CMakeFiles/printfSpecifiersNonHost_exe.dir/printfSpecifiersNonHost_exe.cc.o.d -o catch/catch_tests/unit/printf/CMakeFiles/printfSpecifiersNonHost_exe.dir/printfSpecifiersNonHost_exe.cc.o -c /space/pvelesko/chipStar/hip-tests-update/hip-tests/catch/unit/printf/printfSpecifiersNonHost_exe.cc
Unhandled constant expr: ptr addrspace(4) inttoptr (i64 -1144570581550241922 to ptr addrspace(4))

UNREACHABLE executed at /space/pvelesko/chipStar/hip-tests-update/llvm_passes/HipLowerZeroLengthArrays.cpp:92!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: /space/pvelesko/install/llvm/17.0/bin/opt /tmp/printfSpecifiersNonHost_exe-generic-faf6f4-link-ca363c.bc -load-pass-plugin /space/pvelesko/chipStar/hip-tests-update/build/lib/libLLVMHipSpvPasses.so -passes=hip-post-link-passes -o /tmp/printfSpecifiersNonHost_exe-generic-faf6f4-lower-9b64e3.bc
 #0 0x00007f12168747e2 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/space/pvelesko/install/llvm/17.0/lib/libLLVM-17rc.so+0x8747e2)
 #1 0x00007f1216871f1f llvm::sys::RunSignalHandlers() (/space/pvelesko/install/llvm/17.0/lib/libLLVM-17rc.so+0x871f1f)
 #2 0x00007f1216872065 SignalHandler(int) Signals.cpp:0:0
 #3 0x00007f1215842520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00007f12158969fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #5 0x00007f12158969fc __pthread_kill_internal ./nptl/pthread_kill.c:78:10
 #6 0x00007f12158969fc pthread_kill ./nptl/pthread_kill.c:89:10
 #7 0x00007f1215842476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
 #8 0x00007f12158287f3 abort ./stdlib/abort.c:81:7
 #9 0x00007f121678d53e (/space/pvelesko/install/llvm/17.0/lib/libLLVM-17rc.so+0x78d53e)
#10 0x00007f1215bea5b6 llvm::ConstantExpr::getOperand(unsigned int) const /space/pvelesko/install/llvm/17.0/include/llvm/IR/Constants.h:1358:1
#11 0x00007f1215bea5b6 (anonymous namespace)::getLoweredConstantOrNull(llvm::Constant*) /space/pvelesko/chipStar/hip-tests-update/llvm_passes/HipLowerZeroLengthArrays.cpp:82:56
#12 0x00007f1215be9aa1 (anonymous namespace)::lowerZeroLengthArrayTypes(llvm::Function&) /space/pvelesko/chipStar/hip-tests-update/llvm_passes/HipLowerZeroLengthArrays.cpp:123:14
#13 0x00007f1215be9aa1 (anonymous namespace)::lowerZeroLengthArrays(llvm::Module&) /space/pvelesko/chipStar/hip-tests-update/llvm_passes/HipLowerZeroLengthArrays.cpp:170:17
#14 0x00007f1215be9aa1 HipLowerZeroLengthArraysPass::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /space/pvelesko/chipStar/hip-tests-update/llvm_passes/HipLowerZeroLengthArrays.cpp:179:10
#15 0x00007f1215bce22d llvm::detail::PassModel<llvm::Module, HipLowerZeroLengthArraysPass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /space/pvelesko/install/llvm/17.0/include/llvm/IR/PassManagerInternal.h:89:5
#16 0x00007f1216aa18b1 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/space/pvelesko/install/llvm/17.0/lib/libLLVM-17rc.so+0xaa18b1)
#17 0x00005647d4c4eab5 llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::PassPlugin>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool, bool, bool) (/space/pvelesko/install/llvm/17.0/bin/opt+0x25ab5)
#18 0x00005647d4c41536 main (/space/pvelesko/install/llvm/17.0/bin/opt+0x18536)
#19 0x00007f1215829d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#20 0x00007f1215829e40 call_init ./csu/../csu/libc-start.c:128:20
#21 0x00007f1215829e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#22 0x00005647d4c42195 _start (/space/pvelesko/install/llvm/17.0/bin/opt+0x19195)
clang++: error: unable to execute command: Aborted (core dumped)
clang++: error: hipspv-link command failed due to signal (use -v to see invocation)
clang version 17.0.0 (https://github.com/CHIP-SPV/llvm-project.git f11f439e3555a82754daa98dc1679ee07dc00403)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /space/pvelesko/install/llvm/17.0/bin
clang++: note: diagnostic msg: Error generating preprocessed source(s).

failed to execute:/space/pvelesko/install/llvm/17.0/bin/clang++ -include /space/pvelesko/chipStar/hip-tests-update/include/hip/spirv_fixups.h -I//space/pvelesko/chipStar/hip-tests-update/build/include -DKERNELS_PATH="/space/pvelesko/chipStar/hip-tests-update/hip-tests/catch/kernels/" -I/space/pvelesko/chipStar/hip-tests-update/CHIP -I/space/pvelesko/chipStar/hip-tests-update/PUBLIC -I/usr/include/level_zero -I/space/pvelesko/chipStar/hip-tests-update/hip-tests/catch/external/Catch2 -I/space/pvelesko/chipStar/hip-tests-update/hip-tests/catch/./include -I/space/pvelesko/chipStar/hip-tests-update/hip-tests/catch/./kernels -I/space/pvelesko/chipStar/hip-tests-update/build/include -I/space/pvelesko/chipStar/hip-tests-update/hip-tests/catch/external/picojson -Wno-duplicate-decl-specifier -Wno-tautological-constant-compare -Wno-c++20-extensions -Wno-unused-result -Wno-delete-abstract-non-virtual-dtor -Wno-deprecated-declarations -Wunused-command-line-argument --std=c++17 -g -fPIE -Wno-format-extra-args -mf16c -Wall -O1 -std=c++17 -MD -c -x hip /space/pvelesko/chipStar/hip-tests-update/hip-tests/catch/unit/printf/printfSpecifiersNonHost_exe.cc -D__HIP_PLATFORM_SPIRV__= --offload=spirv64 -nohipwrapperinc --hip-path=/space/pvelesko/chipStar/hip-tests-update/build --target=x86_64-unknown-linux-gnu   -I/space/pvelesko/chipStar/hip-tests-update/include -I/space/pvelesko/chipStar/hip-tests-update/HIP/include -I/space/pvelesko/chipStar/hip-tests-update/build/include -o catch/catch_tests/unit/printf/CMakeFiles/printfSpecifiersNonHost_exe.dir/printfSpecifiersNonHost_exe.cc.o -MT catch/catch_tests/unit/printf/CMakeFiles/printfSpecifiersNonHost_exe.dir/printfSpecifiersNonHost_exe.cc.o -MF catch/catch_tests/unit/printf/CMakeFiles/printfSpecifiersNonHost_exe.dir/printfSpecifiersNonHost_exe.cc.o.d
[3/145] cd /space/pvelesko/chipStar/hip-tests-update/build/catch/catch_tests/unit...r/hip-tests-update/hip-tests/catch/unit/graph/../../include --rocm-path=/opt/rocm