[SYCL][CUDA] pass 'Add implicit SYCL global offset': Assertion `Val && "isa<> used on a null pointer"' failed. #3271
Closed
Description
Trying to build GROMACS SYCL fails during linking:
clang-13: /nfs/pdx/home/schulzro/sycl/llvm/include/llvm/Support/Casting.h:90: static bool llvm::isa_impl_cl<To, From*>::doit(const From*) [with To = llvm::ConstantAsMetadata; From = llvm::Metadata]: Assertion `Val && "isa<> used on a null pointer"' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /nfs/pdx/home/schulzro/sycl/build.devtoolset.cuda/bin/clang-13 -cc1 -triple nvptx64-nvidia-cuda-sycldevice -fsycl -fsycl-is-device -fdeclare-spirv-builtins -aux-triple x86_64-unknown-linux-gnu -Wno-sycl-strict -sycl-std=2020 -S -disable-free -main-file-name gmx.cpp.o -mrelocation-model static -mframe-pointer=all -fno-rounding-math -fno-verbose-asm -no-integrated-as -aux-target-cpu x86-64 -internal-isystem /nfs/pdx/home/schulzro/sycl/build.devtoolset.cuda/bin/../include/sycl -mlink-builtin-bitcode /nfs/pdx/home/schulzro/sycl/build.devtoolset.cuda/lib/clang/13.0.0/../../clc/libspirv-nvptx64--nvidiacl.bc -mlink-builtin-bitcode /usr/local/cuda/nvvm/libdevice/libdevice.10.bc -target-feature +ptx70 -target-sdk-version=11.0 -target-cpu sm_50 -fno-split-dwarf-inlining -debugger-tuning=gdb -resource-dir /nfs/pdx/home/schulzro/sycl/build.devtoolset.cuda/lib/clang/13.0.0 -O3 -fno-dwarf-directory-asm -fdebug-compilation-dir /nfs/pdx/home/schulzro/gromacs.sycl/clang.cuda_be -ferror-limit 19 -pthread -fgnuc-version=4.2.1 -fcolor-diagnostics -vectorize-loops -vectorize-slp -o /tmp/gmx-c516da.s -x ir /tmp/gmx-637e0f.bc
1. Code generation
2. Running pass 'Add implicit SYCL global offset' on module '/tmp/gmx-637e0f.bc'.
#0 0x0000000001e7230d llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/nfs/pdx/home/schulzro/sycl/build.devtoolset.cuda/bin/clang-13+0x1e7230d)
#1 0x0000000001e70274 llvm::sys::RunSignalHandlers() (/nfs/pdx/home/schulzro/sycl/build.devtoolset.cuda/bin/clang-13+0x1e70274)
#2 0x0000000001e703db SignalHandler(int) (/nfs/pdx/home/schulzro/sycl/build.devtoolset.cuda/bin/clang-13+0x1e703db)
#3 0x00007ff8804a4630 __restore_rt (/lib64/libpthread.so.0+0xf630)
#4 0x00007ff87f5c3387 raise (/lib64/libc.so.6+0x36387)
#5 0x00007ff87f5c4a78 abort (/lib64/libc.so.6+0x37a78)
#6 0x00007ff87f5bc1a6 __assert_fail_base (/lib64/libc.so.6+0x2f1a6)
#7 0x00007ff87f5bc252 (/lib64/libc.so.6+0x2f252)
#8 0x0000000000d5013b (anonymous namespace)::GlobalOffset::runOnModule(llvm::Module&) (/nfs/pdx/home/schulzro/sycl/build.devtoolset.cuda/bin/clang-13+0xd5013b)
#9 0x00000000016141a6 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/nfs/pdx/home/schulzro/sycl/build.devtoolset.cuda/bin/clang-13+0x16141a6)
#10 0x000000000217ff44 (anonymous namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) (/nfs/pdx/home/schulzro/sycl/build.devtoolset.cuda/bin/clang-13+0x217ff44)
#11 0x0000000002181a93 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) (/nfs/pdx/home/schulzro/sycl/build.devtoolset.cuda/bin/clang-13+0x2181a93)
#12 0x0000000002eb2ba0 clang::CodeGenAction::ExecuteAction() (/nfs/pdx/home/schulzro/sycl/build.devtoolset.cuda/bin/clang-13+0x2eb2ba0)
#13 0x00000000027fc0f9 clang::FrontendAction::Execute() (/nfs/pdx/home/schulzro/sycl/build.devtoolset.cuda/bin/clang-13+0x27fc0f9)
#14 0x000000000279f2de clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/nfs/pdx/home/schulzro/sycl/build.devtoolset.cuda/bin/clang-13+0x279f2de)
#15 0x00000000028cce08 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/nfs/pdx/home/schulzro/sycl/build.devtoolset.cuda/bin/clang-13+0x28cce08)
#16 0x00000000009d5857 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/nfs/pdx/home/schulzro/sycl/build.devtoolset.cuda/bin/clang-13+0x9d5857)
#17 0x00000000009d1548 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) (/nfs/pdx/home/schulzro/sycl/build.devtoolset.cuda/bin/clang-13+0x9d1548)
#18 0x000000000094da16 main (/nfs/pdx/home/schulzro/sycl/build.devtoolset.cuda/bin/clang-13+0x94da16)
#19 0x00007ff87f5af555 __libc_start_main (/lib64/libc.so.6+0x22555)
#20 0x00000000009d1093 _start (/nfs/pdx/home/schulzro/sycl/build.devtoolset.cuda/bin/clang-13+0x9d1093)
clang-13: error: unable to execute command: Aborted (core dumped)
clang-13: error: clang frontend command failed due to signal (use -v to see invocation) clang version 13.0.0 (/nfs/pdx/home/schulzro/sycl/clang f640bd0bf6225c84f489b05af2454bdaac6c92c7)
Target: x86_64-unknown-linux-gnu
Thread model: posix
(filename doesn't match because I copied error and file from two different invocations)