[AArch64] lowering `@llvm.experimental.constrained.fcmp.nxv2f64` with SVE asserts: Possible incorrect use of EVT::getVectorNumElements() for scalable vector
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Lowering `@llvm.experimental.constrained.fcmp.nxv2f64` with SVE triggers an assertion.
https://llvm.godbolt.org/z/YdEE3jYPh
```llvm
llc -mtriple=aarch64 -mattr=+sve
define @f( %a, %b) #0 {
%c = call @llvm.experimental.constrained.fcmp.nxv2f64( %a, %b, metadata !"oeq", metadata !"fpexcept.strict") #0
ret %c
}
attributes #0 = { strictfp }
```
```
LLVM ERROR: Possible incorrect use of EVT::getVectorNumElements() for scalable vector. Scalable flag may be dropped, use EVT::getVectorElementCount() instead
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0. Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/llc -o /app/output.s -x86-asm-syntax=intel -mtriple=aarch64 -mattr=+sve
1. Running pass 'Function Pass Manager' on module ''.
2. Running pass 'AArch64 Instruction Selection' on function '@f'
#0 0x00000000044a91d8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x44a91d8)
#1 0x00000000044a6084 llvm::sys::RunSignalHandlers() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x44a6084)
#2 0x00000000044a61fe SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#3 0x00007fd876c45330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
#4 0x00007fd876c9ec0c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x9ec0c)
#5 0x00007fd876c4527e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4527e)
#6 0x00007fd876c288ff abort (/lib/x86_64-linux-gnu/libc.so.6+0x288ff)
#7 0x00000000007c2d92 llvm::json::operator==(llvm::json::Value const&, llvm::json::Value const&) (.cold) JSON.cpp:0:0
#8 0x00000000043e6610 llvm::reportFatalInternalError(llvm::StringRef) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x43e6610)
#9 0x00000000042cc423 (anonymous namespace)::VectorLegalizer::UnrollStrictFPOp(llvm::SDNode*, llvm::SmallVectorImpl&) (.isra.0) LegalizeVectorOps.cpp:0:0
#10 0x00000000042cd953 (anonymous namespace)::VectorLegalizer::ExpandSETCC(llvm::SDNode*, llvm::SmallVectorImpl&) LegalizeVectorOps.cpp:0:0
#11 0x00000000042db416 (anonymous namespace)::VectorLegalizer::LegalizeOp(llvm::SDValue) LegalizeVectorOps.cpp:0:0
#12 0x00000000042dbf17 llvm::SelectionDAG::LegalizeVectors() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x42dbf17)
#13 0x000000000421d0a6 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x421d0a6)
#14 0x0000000004220f66 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x4220f66)
#15 0x0000000004222664 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x4222664)
#16 0x000000000421bb0e llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x421bb0e)
#17 0x00000000032399ad llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#18 0x000000000387cc11 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x387cc11)
#19 0x000000000387d141 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x387d141)
#20 0x000000000387db01 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x387db01)
#21 0x0000000000890ac1 compileModule(char**, llvm::SmallVectorImpl&, llvm::LLVMContext&, std::__cxx11::basic_string, std::allocator>&) llc.cpp:0:0
#22 0x00000000007c6ecc main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x7c6ecc)
#23 0x00007fd876c2a1ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
#24 0x00007fd876c2a28b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b)
#25 0x0000000000885a15 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x885a15)
Program terminated with signal: SIGSEGV
Compiler returned: 139
````
Contributor guide
Assessment
This issue has not been assessed yet.