Skip to content

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

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

Open
stevesuzuki-arm opened this issue Mar 17, 2022 · 5 comments
Open

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

stevesuzuki-arm opened this issue Mar 17, 2022 · 5 comments
Labels
backend:AArch64 llvm:crash SVE ARM Scalable Vector Extensions

Comments

@stevesuzuki-arm
Copy link
Contributor

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
@llvmbot
Copy link
Member

llvmbot commented Mar 17, 2022

@llvm/issue-subscribers-backend-aarch64

@vfdff
Copy link
Contributor

vfdff commented May 21, 2024

The same occurs with fadd, fsub, fmul, fdiv and fcmp

Base on the upstream, fadd, fsub, fmul, fdiv and fcmp with <vscale x 6 x float> are supported, https://godbolt.org/z/xsfYG7vdG

@vfdff
Copy link
Contributor

vfdff commented May 21, 2024

  • icmp slt <vscale x 6 x i8> %a0, %a1 is also supported, so the remain issue may related to type <vscale x 24 x i8>, https://godbolt.org/z/dz646zGMb

  • the new backtrace, and it report EltSize * 8 == EltVT.getFixedSizeInBits() && "Converting bits to bytes lost precision now

~/test/issue1129/nxv24 » ~/BiSheng/install/bin/llc -mattr=+sve2 -O3 nxv6.ll
llc: /home/zhongyunde/BiSheng/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:9594: llvm::SDValue llvm::TargetLowering::getVectorSubVecPointer(llvm::SelectionDAG&, llvm::SDValue, llvm::EVT, llvm::EVT, llvm::SDValue) const: Assertion `EltSize * 8 == EltVT.getFixedSizeInBits() && "Converting bits to bytes lost precision"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /home/zhongyunde/BiSheng/install/bin/llc -mattr=+sve2 -O3 nxv6.ll
1.	Running pass 'Function Pass Manager' on module 'nxv6.ll'.
2.	Running pass 'AArch64 Instruction Selection' on function '@icmp

@vfdff
Copy link
Contributor

vfdff commented May 21, 2024

It seems similar to #42304

@vfdff
Copy link
Contributor

vfdff commented May 22, 2024

The same occurs with fadd, fsub, fmul, fdiv and fcmp

Base on the upstream, fadd, fsub, fmul, fdiv and fcmp with <vscale x 6 x float> are supported, https://godbolt.org/z/xsfYG7vdG

The case fadd is fixed with D128286, which update the VT.getVectorNumElements() to VT.getVectorMinNumElements() to support scalable vector

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:AArch64 llvm:crash SVE ARM Scalable Vector Extensions
Projects
None yet
Development

No branches or pull requests

5 participants