Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fatal error: error in backend: Cannot select: t54: v4f32 = fexp10 t49, ../simde/x86/svml.h:4583:21 @[ ../test/x86/svml.c:15090:21 ] #117200

Open
Dave-Lowndes opened this issue Nov 21, 2024 · 5 comments
Labels
backend:WebAssembly crash Prefer [crash-on-valid] or [crash-on-invalid] llvm:SelectionDAG SelectionDAGISel as well

Comments

@Dave-Lowndes
Copy link

The above error occurs building the simd-everywhere project.
Hopefully the information you need is recorded here: https://github.com/simd-everywhere/simde/actions/runs/11917581735/job/33213028281?pr=1233#step:8:1067

@EugeneZelenko EugeneZelenko added backend:WebAssembly crash Prefer [crash-on-valid] or [crash-on-invalid] llvm:SelectionDAG SelectionDAGISel as well and removed new issue labels Nov 21, 2024
@llvmbot
Copy link
Member

llvmbot commented Nov 21, 2024

@llvm/issue-subscribers-backend-webassembly

Author: David Lowndes (Dave-Lowndes)

The above error occurs building the simd-everywhere project. Hopefully the information you need is recorded here: https://github.com/simd-everywhere/simde/actions/runs/11917581735/job/33213028281?pr=1233#step:8:1067

@dschuff
Copy link
Member

dschuff commented Nov 21, 2024

When clang crashes with that message, it also produces a preprocessed source (.i) and shell script file with the reproducer. Would it be possible for you to upload those?

@Dave-Lowndes
Copy link
Author

@dschuff
I'm afraid I'm not familiar with the project or where to start looking to find those things. I've just reported this as a courtesy to someone else on that project.

@mr-c
Copy link

mr-c commented Nov 22, 2024

@dschuff Here's a fresh compile and the request files
svml-774938.c.txt
svml-774938.sh.txt

ninja: Entering directory `build'
[1/8] emcc -Itest/x86/svml-emul-c.js.p -Itest/x86 -I../test/x86 -I. -I.. -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c99 -O2 -g -Weverything -fno-lax-vector-conversions -Werror -O2 -msimd128 -Wno-unsafe-buffer-usage -Wno-switch-default -fopenmp-simd -DSIMDE_CONSTRAINED_COMPILATION -DSIMDE_ENABLE_OPENMP -Wno-psabi -DSIMDE_TEST_BARE -DSIMDE_NO_NATIVE -MD -MQ test/x86/svml-emul-c.js.p/svml.c.o -MF test/x86/svml-emul-c.js.p/svml.c.o.d -o test/x86/svml-emul-c.js.p/svml.c.o -c ../test/x86/svml.c
FAILED: test/x86/svml-emul-c.js.p/svml.c.o 
emcc -Itest/x86/svml-emul-c.js.p -Itest/x86 -I../test/x86 -I. -I.. -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c99 -O2 -g -Weverything -fno-lax-vector-conversions -Werror -O2 -msimd128 -Wno-unsafe-buffer-usage -Wno-switch-default -fopenmp-simd -DSIMDE_CONSTRAINED_COMPILATION -DSIMDE_ENABLE_OPENMP -Wno-psabi -DSIMDE_TEST_BARE -DSIMDE_NO_NATIVE -MD -MQ test/x86/svml-emul-c.js.p/svml.c.o -MF test/x86/svml-emul-c.js.p/svml.c.o.d -o test/x86/svml-emul-c.js.p/svml.c.o -c ../test/x86/svml.c
fatal error: error in backend: Cannot select: t54: v4f32 = fexp10 t49, ../simde/x86/svml.h:4583:21 @[ ../test/x86/svml.c:15090:21 ]
  t49: v4f32,ch = load<(invariant load (s128) from %ir.arrayidx)> t0, t6, undef:i32, ../test/x86/avx512/../../../simde/x86/avx.h:3825:5 @[ ../test/x86/svml.c:15089:21 ]
    t6: i32 = add nuw t5, t87, ../test/x86/svml.c:15089:42
      t5: i32 = shl nuw nsw t3, Constant:i32<6>, ../test/x86/svml.c:15089:42
        t3: i32,ch = CopyFromReg t0, Register:i32 %1, ../test/x86/svml.c:15089:42
          t2: i32 = Register %1
        t4: i32 = Constant<6>
      t87: i32 = WebAssemblyISD::Wrapper TargetGlobalAddress:i32<ptr @test_simde_mm256_exp10_ps.test_vec> 0, ../test/x86/svml.c:15089:42
        t86: i32 = TargetGlobalAddress<ptr @test_simde_mm256_exp10_ps.test_vec> 0, ../test/x86/svml.c:15089:42
    t8: i32 = undef
In function: test_simde_mm256_exp10_ps
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.	Program arguments: /home/mi/crusoe/src/emsdk/upstream/bin/clang -target wasm32-unknown-emscripten -fignore-exceptions -mno-bulk-memory -mno-nontrapping-fptoint -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --sysroot=/home/mi/crusoe/src/emsdk/upstream/emscripten/cache/sysroot -DEMSCRIPTEN -Werror=implicit-function-declaration -Xclang -iwithsysroot/include/fakesdl -Xclang -iwithsysroot/include/compat -Itest/x86/svml-emul-c.js.p -Itest/x86 -I../test/x86 -I. -I.. -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c99 -O2 -g3 -Weverything -fno-lax-vector-conversions -Werror -O2 -msimd128 -Wno-unsafe-buffer-usage -Wno-switch-default -fopenmp-simd -DSIMDE_CONSTRAINED_COMPILATION -DSIMDE_ENABLE_OPENMP -Wno-psabi -DSIMDE_TEST_BARE -DSIMDE_NO_NATIVE -MD -MQ test/x86/svml-emul-c.js.p/svml.c.o -MF test/x86/svml-emul-c.js.p/svml.c.o.d -c ../test/x86/svml.c -o test/x86/svml-emul-c.js.p/svml.c.o
1.	<eof> parser at end of file
2.	Code generation
3.	Running pass 'Function Pass Manager' on module '../test/x86/svml.c'.
4.	Running pass 'WebAssembly Instruction Selection' on function '@test_simde_mm256_exp10_ps'
 #0 0x00007f728be93768 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/mi/crusoe/src/emsdk/upstream/bin/../lib/libLLVM.so.20.0git+0x2272768)
 #1 0x00007f728be911de llvm::sys::RunSignalHandlers() (/home/mi/crusoe/src/emsdk/upstream/bin/../lib/libLLVM.so.20.0git+0x22701de)
 #2 0x00007f728be92aef llvm::sys::CleanupOnSignal(unsigned long) (/home/mi/crusoe/src/emsdk/upstream/bin/../lib/libLLVM.so.20.0git+0x2271aef)
 #3 0x00007f728bdcb977 (anonymous namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long) CrashRecoveryContext.cpp:0:0
 #4 0x00007f728bdcb90f llvm::CrashRecoveryContext::HandleExit(int) (/home/mi/crusoe/src/emsdk/upstream/bin/../lib/libLLVM.so.20.0git+0x21aa90f)
 #5 0x00007f728be8dcc7 llvm::sys::Process::Exit(int, bool) (/home/mi/crusoe/src/emsdk/upstream/bin/../lib/libLLVM.so.20.0git+0x226ccc7)
 #6 0x000056186bce4993 (/home/mi/crusoe/src/emsdk/upstream/bin/clang+0x13993)
 #7 0x00007f728bddf363 llvm::report_fatal_error(llvm::Twine const&, bool) (/home/mi/crusoe/src/emsdk/upstream/bin/../lib/libLLVM.so.20.0git+0x21be363)
 #8 0x00007f728ca3b5da llvm::SelectionDAGISel::CannotYetSelect(llvm::SDNode*) (/home/mi/crusoe/src/emsdk/upstream/bin/../lib/libLLVM.so.20.0git+0x2e1a5da)
 #9 0x00007f728ca3a684 llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*, unsigned int) (/home/mi/crusoe/src/emsdk/upstream/bin/../lib/libLLVM.so.20.0git+0x2e19684)
#10 0x00007f728e94cd91 (anonymous namespace)::WebAssemblyDAGToDAGISel::Select(llvm::SDNode*) WebAssemblyISelDAGToDAG.cpp:0:0
#11 0x00007f728ca2f9cf llvm::SelectionDAGISel::DoInstructionSelection() (/home/mi/crusoe/src/emsdk/upstream/bin/../lib/libLLVM.so.20.0git+0x2e0e9cf)
#12 0x00007f728ca2e95f llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/home/mi/crusoe/src/emsdk/upstream/bin/../lib/libLLVM.so.20.0git+0x2e0d95f)
#13 0x00007f728ca2baa0 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/home/mi/crusoe/src/emsdk/upstream/bin/../lib/libLLVM.so.20.0git+0x2e0aaa0)
#14 0x00007f728ca298f1 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/home/mi/crusoe/src/emsdk/upstream/bin/../lib/libLLVM.so.20.0git+0x2e088f1)
#15 0x00007f728ca27329 llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/home/mi/crusoe/src/emsdk/upstream/bin/../lib/libLLVM.so.20.0git+0x2e06329)
#16 0x00007f728c3e8c57 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/home/mi/crusoe/src/emsdk/upstream/bin/../lib/libLLVM.so.20.0git+0x27c7c57)
#17 0x00007f728c05ac6a llvm::FPPassManager::runOnFunction(llvm::Function&) (/home/mi/crusoe/src/emsdk/upstream/bin/../lib/libLLVM.so.20.0git+0x2439c6a)
#18 0x00007f728c063042 llvm::FPPassManager::runOnModule(llvm::Module&) (/home/mi/crusoe/src/emsdk/upstream/bin/../lib/libLLVM.so.20.0git+0x2442042)
#19 0x00007f728c05b756 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/home/mi/crusoe/src/emsdk/upstream/bin/../lib/libLLVM.so.20.0git+0x243a756)
#20 0x00007f7291ccaf18 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::__2::unique_ptr<llvm::raw_pwrite_stream, std::__2::default_delete<llvm::raw_pwrite_stream>>, clang::BackendConsumer*) (/home/mi/crusoe/src/emsdk/upstream/bin/../lib/libclang-cpp.so.20.0git+0x2db2f18)
#21 0x00007f729213a5e6 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/home/mi/crusoe/src/emsdk/upstream/bin/../lib/libclang-cpp.so.20.0git+0x32225e6)
#22 0x00007f7290a00ca9 clang::ParseAST(clang::Sema&, bool, bool) (/home/mi/crusoe/src/emsdk/upstream/bin/../lib/libclang-cpp.so.20.0git+0x1ae8ca9)
#23 0x00007f7292884b4f clang::FrontendAction::Execute() (/home/mi/crusoe/src/emsdk/upstream/bin/../lib/libclang-cpp.so.20.0git+0x396cb4f)
#24 0x00007f729280184d clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/home/mi/crusoe/src/emsdk/upstream/bin/../lib/libclang-cpp.so.20.0git+0x38e984d)
#25 0x00007f729290ed1c clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/home/mi/crusoe/src/emsdk/upstream/bin/../lib/libclang-cpp.so.20.0git+0x39f6d1c)
#26 0x000056186bce44a3 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/home/mi/crusoe/src/emsdk/upstream/bin/clang+0x134a3)
#27 0x000056186bce0b7e ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#28 0x00007f72924bf039 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::__2::optional<llvm::StringRef>>, std::__2::basic_string<char, std::__2::char_traits<char>, std::__2::allocator<char>>*, bool*) const::$_0>(long) Job.cpp:0:0
#29 0x00007f728bdcb8ae llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/home/mi/crusoe/src/emsdk/upstream/bin/../lib/libLLVM.so.20.0git+0x21aa8ae)
#30 0x00007f72924be783 clang::driver::CC1Command::Execute(llvm::ArrayRef<std::__2::optional<llvm::StringRef>>, std::__2::basic_string<char, std::__2::char_traits<char>, std::__2::allocator<char>>*, bool*) const (/home/mi/crusoe/src/emsdk/upstream/bin/../lib/libclang-cpp.so.20.0git+0x35a6783)
#31 0x00007f7292486283 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/home/mi/crusoe/src/emsdk/upstream/bin/../lib/libclang-cpp.so.20.0git+0x356e283)
#32 0x00007f72924864de clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::__2::pair<int, clang::driver::Command const*>>&, bool) const (/home/mi/crusoe/src/emsdk/upstream/bin/../lib/libclang-cpp.so.20.0git+0x356e4de)
#33 0x00007f72924a0c6d clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::__2::pair<int, clang::driver::Command const*>>&) (/home/mi/crusoe/src/emsdk/upstream/bin/../lib/libclang-cpp.so.20.0git+0x3588c6d)
#34 0x000056186bce0278 clang_main(int, char**, llvm::ToolContext const&) (/home/mi/crusoe/src/emsdk/upstream/bin/clang+0xf278)
#35 0x000056186bcee367 main (/home/mi/crusoe/src/emsdk/upstream/bin/clang+0x1d367)
#36 0x00007f728981c24a __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#37 0x00007f728981c305 call_init ./csu/../csu/libc-start.c:128:20
#38 0x00007f728981c305 __libc_start_main ./csu/../csu/libc-start.c:347:5
#39 0x000056186bcde88a _start (/home/mi/crusoe/src/emsdk/upstream/bin/clang+0xd88a)
clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 20.0.0git (https:/github.com/llvm/llvm-project f84fc44f1a46969817bfd1b38991f7e43a8efe1d)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /home/mi/crusoe/src/emsdk/upstream/bin
Build config: +assertions
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: 

clang: note: diagnostic msg: /tmp/svml-774938.sh
clang: note: diagnostic msg: 

********************
ninja: build stopped: subcommand failed.
Found runner: /usr/bin/ninja

@mr-c
Copy link

mr-c commented Nov 22, 2024

On the emscripten side, I git-bisected the failure to when llvm was upgraded d72e711...9c8dab0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:WebAssembly crash Prefer [crash-on-valid] or [crash-on-invalid] llvm:SelectionDAG SelectionDAGISel as well
Projects
None yet
Development

No branches or pull requests

5 participants