<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/107370>107370</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            error in backend: Invalid size request on a scalable vector
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          ktkachov
      </td>
    </tr>
</table>

<pre>
    `#include <arm_sve.h>

svint64x2_t
foo (svbool_t pg, int64_t* base, svint64x2_t in)
{
    svint64x2_t result = svld2_s64 (pg, base);

    if (base == 0)
      return in;
 return result;
}
`
Compiled with -O2 -mcpu=neoverse-v2 crashes:
fatal error: error in backend: Invalid size request on a scalable vector.
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: /opt/compiler-explorer/clang-trunk/bin/clang -gdwarf-4 -g -o /app/output.s -fno-verbose-asm -S -target aarch64-linux-gnu --gcc-toolchain=/opt/compiler-explorer/arm64/gcc-12.2.0/aarch64-unknown-linux-gnu --sysroot=/opt/compiler-explorer/arm64/gcc-12.2.0/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot -fcolor-diagnostics -fno-crash-diagnostics -O2 -mcpu=grace <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 '@foo'
 #0 0x00000000038a1668 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-trunk/bin/clang+0x38a1668)
 #1 0x000000000389f7d4 llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-trunk/bin/clang+0x389f7d4)
 #2 0x00000000037ea713 llvm::CrashRecoveryContext::HandleExit(int) (/opt/compiler-explorer/clang-trunk/bin/clang+0x37ea713)
 #3 0x0000000003896fae llvm::sys::Process::Exit(int, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+0x3896fae)
 #4 0x0000000000cb6276 (/opt/compiler-explorer/clang-trunk/bin/clang+0xcb6276)
 #5 0x00000000037f4723 llvm::report_fatal_error(llvm::Twine const&, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+0x37f4723)
 #6 0x00000000037f4888 (/opt/compiler-explorer/clang-trunk/bin/clang+0x37f4888)
 #7 0x000000000384716d (/opt/compiler-explorer/clang-trunk/bin/clang+0x384716d)
 #8 0x000000000384718c llvm::TypeSize::operator unsigned long() const (/opt/compiler-explorer/clang-trunk/bin/clang+0x384718c)
 #9 0x0000000004a02276 llvm::SelectionDAGBuilder::EmitFuncArgumentDbgValue(llvm::Value const*, llvm::DILocalVariable*, llvm::DIExpression*, llvm::DILocation*, llvm::SelectionDAGBuilder::FuncArgumentDbgValueKind, llvm::SDValue const&)::'lambda0'(llvm::ArrayRef<std::pair<unsigned int, llvm::TypeSize>>)::operator()(llvm::ArrayRef<std::pair<unsigned int, llvm::TypeSize>>) const SelectionDAGBuilder.cpp:0:0
#10 0x0000000004a1c6ec llvm::SelectionDAGBuilder::EmitFuncArgumentDbgValue(llvm::Value const*, llvm::DILocalVariable*, llvm::DIExpression*, llvm::DILocation*, llvm::SelectionDAGBuilder::FuncArgumentDbgValueKind, llvm::SDValue const&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x4a1c6ec)
#11 0x0000000004a1da71 llvm::SelectionDAGBuilder::handleDebugValue(llvm::ArrayRef<llvm::Value const*>, llvm::DILocalVariable*, llvm::DIExpression*, llvm::DebugLoc, unsigned int, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+0x4a1da71)
#12 0x0000000004a20b6f llvm::SelectionDAGBuilder::visitDbgInfo(llvm::Instruction const&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x4a20b6f)
#13 0x0000000004a64dd9 llvm::SelectionDAGBuilder::visit(llvm::Instruction const&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x4a64dd9)
#14 0x0000000004ae0aec llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator_w_bits<llvm::ilist_detail::node_options<llvm::Instruction, false, false, void, true, llvm::BasicBlock>, false, true>, llvm::ilist_iterator_w_bits<llvm::ilist_detail::node_options<llvm::Instruction, false, false, void, true, llvm::BasicBlock>, false, true>, bool&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x4ae0aec)
#15 0x0000000004ae200c llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x4ae200c)
#16 0x0000000004ae3c6f llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x4ae3c6f)
#17 0x0000000004acfea1 llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x4acfea1)
#18 0x0000000002ce188b llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#19 0x000000000322a772 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x322a772)
#20 0x000000000322a9f1 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x322a9f1)
#21 0x000000000322c396 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x322c396)
#22 0x0000000003b3dc76 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::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>, clang::BackendConsumer*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x3b3dc76)
#23 0x00000000041b3e94 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x41b3e94)
#24 0x000000000617a7cc clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+0x617a7cc)
#25 0x00000000041b4625 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-trunk/bin/clang+0x41b4625)
#26 0x0000000004460581 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-trunk/bin/clang+0x4460581)
#27 0x00000000043e2d0b clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x43e2d0b)
#28 0x0000000004547dc3 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x4547dc3)
#29 0x0000000000cb81bc cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-trunk/bin/clang+0xcb81bc)
#30 0x0000000000cb20fd ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#31 0x00000000041fdde9 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
#32 0x00000000037ea613 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-trunk/bin/clang+0x37ea613)
#33 0x00000000041fe009 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
#34 0x00000000041c3c87 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-trunk/bin/clang+0x41c3c87)
#35 0x00000000041c463d 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+0x41c463d)
#36 0x00000000041ce62c clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x41ce62c)
#37 0x0000000000cb54a1 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-trunk/bin/clang+0xcb54a1)
#38 0x0000000000b8a7d4 main (/opt/compiler-explorer/clang-trunk/bin/clang+0xb8a7d4)
#39 0x0000768fb9429d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#40 0x0000768fb9429e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#41 0x0000000000cb1b9e _start (/opt/compiler-explorer/clang-trunk/bin/clang+0xcb1b9e)
clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWl9v4zYS_zTKC2FDomRJfsiDY8ft9rbYYJ3rq0FRI5sXmlRJykn66Q8UZVtU7N208fZwuAvQrsw_Mz_O_DgzpES0ZhsBcBtM7oLJ4oY0ZivV7ZN5InQr9zeFLF9vgzQMcMwE5U0JKIjnRO3Weg_jbRDfB-EiCGfu_3rPhEmTF7w2rqGSEgU41_tCSr42qN4EeI7aQWsT4BkqiAbb1JuJmAjwtBOb3bkHhJA3RoFuuEFBvEB6z0u81mliNTkFTuo0iO_66KwMVtlRtt_OtdPDozLU_ikwjRIWxGH2ocnpPAnNFt1DGrqHudzVjEOJnpnZotEXjEY7WjdBvBAg96A0jPYYUUX0FnQQd7AqYghHoJRUQTxzD4gJVBD6BKK0bZ_EnnBWIs3-AKTg9wa0QVIggjQlnBQc0B6okWrsRD58vp-t7pFuih0ziKCi2SAFtVQGGYm2xtSterwM8HLDzLYp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