| Issue |
239523
|
| Summary |
[AArch64] Compiling a streaming function containing floating point reduction when Auto SSVE flag "enable-scalable-autovec-in-streaming-mode" is used, causes toolchain crash.
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
ShikharJ-Corp
|
C Code:
```
__arm_locally_streaming
float kernel(const float *__restrict a,
unsigned int n0,
const float *__restrict b
) {
float x0 = 0.0f;
unsigned int i1, q0, q1;
q0 = 0;
q1 = 0;
for (i1 = 0; i1 < n0; ++i1) {
x0 += a[q0] * b[q1];
++q0;
++q1;
}
return x0;
}
```
Compile Command : `-O3 -march=armv9-a+sme2+sve2 -mllvm -enable-scalable-autovec-in-streaming-mode `
Stack Dump :
```
fatal error: error in backend: Expanding reductions for scalable vectors is undefined.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and dumped files.
Stack dump:
0. Program arguments: /opt/compiler-explorer/clang-trunk/bin/clang -g -o /app/output.s -fno-verbose-asm -S -target aarch64-linux-gnu --gcc-toolchain=/opt/compiler-explorer/arm64/gcc-15.2.0/aarch64-unknown-linux-gnu --sysroot=/opt/compiler-explorer/arm64/gcc-15.2.0/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot -fcolor-diagnostics -fno-crash-diagnostics -O3 -march=armv9-a+sme2+sve2 -mllvm -enable-scalable-autovec-in-streaming-mode -Rpass=loop-vectorize -Rpass-missed=loop-vectorize -Rpass-analysis=loop-vectorize <source>
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module '<source>'.
4. Running pass 'AArch64 Instruction Selection' on function '@kernel'
#0 0x0000000004814468 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-trunk/bin/clang+0x4814468)
#1 0x000000000481214c llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-trunk/bin/clang+0x481214c)
#2 0x000000000474f343 llvm::CrashRecoveryContext::HandleExit(int) (/opt/compiler-explorer/clang-trunk/bin/clang+0x474f343)
#3 0x0000000004809a9e llvm::sys::Process::Exit(int, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+0x4809a9e)
#4 0x00000000017821cb LLVMErrorHandler(void*, char const*, bool) cc1_main.cpp:0:0
#5 0x0000000004758f03 llvm::report_fatal_error(llvm::Twine const&, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+0x4758f03)
#6 0x0000000004759068 (/opt/compiler-explorer/clang-trunk/bin/clang+0x4759068)
#7 0x0000000005f2486c (/opt/compiler-explorer/clang-trunk/bin/clang+0x5f2486c)
#8 0x0000000005f8c382 (anonymous namespace)::VectorLegalizer::Expand(llvm::SDNode*, llvm::SmallVectorImpl<llvm::SDValue>&) LegalizeVectorOps.cpp:0:0
#9 0x0000000005f8f5f2 (anonymous namespace)::VectorLegalizer::LegalizeOp(llvm::SDValue) LegalizeVectorOps.cpp:0:0
#10 0x0000000005f90878 llvm::SelectionDAG::LegalizeVectors() (/opt/compiler-explorer/clang-trunk/bin/clang+0x5f90878)
#11 0x0000000005ee665c llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-trunk/bin/clang+0x5ee665c)
#12 0x0000000005ee8a21 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x5ee8a21)
#13 0x0000000005eea465 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x5eea465)
#14 0x0000000005ed8e61 llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x5ed8e61)
#15 0x0000000003c06315 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x3c06315)
#16 0x000000000413cbb2 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x413cbb2)
#17 0x000000000413cf91 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x413cf91)
#18 0x000000000413daa6 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x413daa6)
#19 0x0000000005aaf938 runCodeGenPipelineLegacy(llvm::TargetMachine&, llvm::Module&, llvm::raw_pwrite_stream&, llvm::raw_pwrite_stream*, llvm::CodeGenFileType, bool, bool) RunCodeGen.cpp:0:0
#20 0x0000000005aafa8e llvm::runCodeGenPipeline(llvm::TargetMachine&, llvm::Module&, llvm::raw_pwrite_stream&, llvm::raw_pwrite_stream*, llvm::CodeGenFileType, bool, bool, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>) (/opt/compiler-explorer/clang-trunk/bin/clang+0x5aafa8e)
#21 0x0000000004bb27ed (anonymous namespace)::EmitAssemblyHelper::emitAssembly(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>, clang::BackendConsumer*) BackendUtil.cpp:0:0
#22 0x0000000004bb2cb4 clang::emitBackendOutput(clang::CompilerInstance&, clang::CodeGenOptions&, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>, clang::BackendConsumer*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x4bb2cb4)
#23 0x00000000051e90ea clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x51e90ea)
#24 0x00000000082da9fc clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+0x82da9fc)
#25 0x00000000051e9f15 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-trunk/bin/clang+0x51e9f15)
#26 0x000000000551ace1 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-trunk/bin/clang+0x551ace1)
#27 0x00000000054acf35 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x54acf35)
#28 0x00000000055f01fb clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x55f01fb)
#29 0x00000000017841d8 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x17841d8)
#30 0x000000000177c15b ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>) driver.cpp:0:0
#31 0x000000000177c203 int llvm::function_ref<int (llvm::SmallVectorImpl<char const*>&)>::callback_fn<clang_main(int, char**, llvm::ToolContext const&)::'lambda'(llvm::SmallVectorImpl<char const*>&)>(long, llvm::SmallVectorImpl<char const*>&) driver.cpp:0:0
#32 0x0000000005265359 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#33 0x000000000474f243 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-trunk/bin/clang+0x474f243)
#34 0x0000000005265d9d clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (.part.0) Job.cpp:0:0
#35 0x0000000005224e52 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-trunk/bin/clang+0x5224e52)
#36 0x0000000005227dc4 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-trunk/bin/clang+0x5227dc4)
#37 0x0000000005235edc clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x5235edc)
#38 0x0000000001780c61 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x1780c61)
#39 0x00000000016fe5b3 main (/opt/compiler-explorer/clang-trunk/bin/clang+0x16fe5b3)
#40 0x0000719c94a2a1ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
#41 0x0000719c94a2a28b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b)
#42 0x000000000177bc05 _start (/opt/compiler-explorer/clang-trunk/bin/clang+0x177bc05)
```
Reproduce : https://godbolt.org/z/o5hdeEY3W
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs