Skip to content

[AArch64][SVE] Invalid size request on a scalable vector #54423

@stevesuzuki-arm

Description

@stevesuzuki-arm

icmp <vscale x 24 x i8> https://godbolt.org/z/a1eeWPr4P

define <vscale x 24 x i1> @icmp_i8nxv24(<vscale x 24 x i8> %a0, <vscale x 24 x i8> %a1) #0 {
  %1 = icmp slt <vscale x 24 x i8> %a0, %a1
  ret <vscale x 24 x i1> %1
}

Crashes with target triple = "aarch64-linux-gnu" -mattr=+sve2 -O3

The same occurs with fadd, fsub, fmul, fdiv and fcmp
e.g. fadd <vscale x 6 x float> https://godbolt.org/z/s9n4Kbcnc

LLVM ERROR: 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.
Stack dump:
0.	Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/llc -o /app/output.s -x86-asm-syntax=intel -mattr=+sve2 -O3 <source>
1.	Running pass 'Function Pass Manager' on module '<source>'.
2.	Running pass 'AArch64 Instruction Selection' on function '@icmp_i8nxv24'
 #0 0x0000555cae1449ef PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #1 0x0000555cae1421ad SignalHandler(int) Signals.cpp:0:0
 #2 0x00007fed067fc3c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x143c0)
 #3 0x00007fed062c903b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4303b)
 #4 0x00007fed062a8859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
 #5 0x0000555cae0875e8 llvm::report_fatal_error(llvm::Twine const&, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x30875e8)
 #6 0x0000555cae087758 (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3087758)
 #7 0x0000555cae0e74c5 (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x30e74c5)
 #8 0x0000555cabd409fc llvm::EVT::getVectorNumElements() const (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0xd409fc)
 #9 0x0000555cadfe14c8 llvm::DAGTypeLegalizer::WidenVecRes_SETCC(llvm::SDNode*) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2fe14c8)
#10 0x0000555cadfeb5eb llvm::DAGTypeLegalizer::WidenVectorResult(llvm::SDNode*, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2feb5eb)
#11 0x0000555cadfac698 llvm::DAGTypeLegalizer::run() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2fac698)
#12 0x0000555cadfad7e6 llvm::SelectionDAG::LegalizeTypes() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2fad7e6)
#13 0x0000555cadf4361e llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2f4361e)
#14 0x0000555cadf47233 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2f47233)
#15 0x0000555cadf48ee8 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (.part.960) SelectionDAGISel.cpp:0:0
#16 0x0000555cad487546 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2487546)
#17 0x0000555cad93a7d6 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x293a7d6)
#18 0x0000555cad93ab29 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x293ab29)
#19 0x0000555cad93b469 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x293b469)
#20 0x0000555cabb2f5c8 compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#21 0x0000555caba86197 main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0xa86197)
#22 0x00007fed062aa0b3 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x240b3)
#23 0x0000555cabb2604a _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0xb2604a)
Compiler returned: 139

Metadata

Metadata

Assignees

No one assigned

    Labels

    SVEARM Scalable Vector Extensionsbackend:AArch64crashPrefer [crash-on-valid] or [crash-on-invalid]

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions