Skip to content

Crash when trying to compile i32x4 type with VE backend #64420

Closed
@lenawanel

Description

@lenawanel

compiling the following code with llc:

; ModuleID = 'bugpoint-reduced-simplified.bc'
source_filename = "adler.707c2e002c6e23cc-cgu.0"
target datalayout = "e-m:e-i64:64-n32:64-S128-v64:64:64-v128:64:64-v256:64:64-v512:64:64-v1024:64:64-v2048:64:64-v4096:64:64-v8192:64:64-v16384:64:64"
target triple = "ve-unknown-linux-gnu"

define dso_local void @_ZN5adler4algo5U32X44from17heee8ff6a15a219acE(ptr %_0) unnamed_addr #0 {
start:
  br i1 poison, label %bb7, label %panic3

bb7:                                              ; preds = %start
  store <4 x i32> zeroinitializer, ptr %_0, align 4
  ret void

panic3:                                           ; preds = %start
  unreachable
}

attributes #0 = { "target-features"="+vpu" }

!llvm.ident = !{!0}

!0 = !{!"rustc version 1.73.0-dev"}

crashes with

Do not know how to custom type legalize this operation!
UNREACHABLE executed at /home/lena/GitClone/llvm-project/llvm/lib/Target/VE/VEISelLowering.cpp:1963!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
backtrace

Stack dump:
0.	Program arguments: ./build/bin/llc /home/lena/test.ll
1.	Running pass 'Function Pass Manager' on module '/home/lena/test.ll'.
2.	Running pass 'VE DAG->DAG Pattern Instruction Selection' on function '@_ZN5adler4algo5U32X44from17heee8ff6a15a219acE'
 #0 0x000055ea921280ce llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/lena/GitClone/llvm-project/llvm/lib/Support/Unix/Signals.inc:602:22
 #1 0x000055ea9212849f PrintStackTraceSignalHandler(void*) /home/lena/GitClone/llvm-project/llvm/lib/Support/Unix/Signals.inc:675:1
 #2 0x000055ea92125b5f llvm::sys::RunSignalHandlers() /home/lena/GitClone/llvm-project/llvm/lib/Support/Signals.cpp:104:20
 #3 0x000055ea92127a33 SignalHandler(int) /home/lena/GitClone/llvm-project/llvm/lib/Support/Unix/Signals.inc:413:1
 #4 0x00007f6437a4fab0 (/usr/lib/libc.so.6+0x39ab0)
 #5 0x00007f6437a9f26c (/usr/lib/libc.so.6+0x8926c)
 #6 0x00007f6437a4fa08 raise (/usr/lib/libc.so.6+0x39a08)
 #7 0x00007f6437a38538 abort (/usr/lib/libc.so.6+0x22538)
 #8 0x000055ea9206c7aa bindingsErrorHandler(void*, char const*, bool) /home/lena/GitClone/llvm-project/llvm/lib/Support/ErrorHandling.cpp:221:55
 #9 0x000055ea90738f2f llvm::VETargetLowering::ReplaceNodeResults(llvm::SDNode*, llvm::SmallVectorImpl<llvm::SDValue>&, llvm::SelectionDAG&) const /home/lena/GitClone/llvm-project/llvm/lib/Target/VE/VEISelLowering.cpp:1960:5
#10 0x000055ea91f68ab5 llvm::DAGTypeLegalizer::CustomLowerNode(llvm::SDNode*, llvm::EVT, bool) /home/lena/GitClone/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp:931:27
#11 0x000055ea91f86603 llvm::DAGTypeLegalizer::SplitVectorResult(llvm::SDNode*, unsigned int) /home/lena/GitClone/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp:972:3
#12 0x000055ea91f653ef llvm::DAGTypeLegalizer::run() /home/lena/GitClone/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp:283:17
#13 0x000055ea91f69a58 llvm::SelectionDAG::LegalizeTypes() /home/lena/GitClone/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp:1059:37
#14 0x000055ea91ed11d8 llvm::SelectionDAGISel::CodeGenAndEmitDAG() /home/lena/GitClone/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:807:36
#15 0x000055ea91ed06b2 llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, true, false, void>, false, true>, llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, true, false, void>, false, true>, bool&) /home/lena/GitClone/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:702:1
#16 0x000055ea91ed63b2 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) /home/lena/GitClone/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1705:33
#17 0x000055ea91ecf0df llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) /home/lena/GitClone/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:483:7
#18 0x000055ea90726e1a (anonymous namespace)::VEDAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) /home/lena/GitClone/llvm-project/llvm/lib/Target/VE/VEISelDAGToDAG.cpp:46:3
#19 0x000055ea90f96169 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /home/lena/GitClone/llvm-project/llvm/lib/CodeGen/MachineFunctionPass.cpp:91:33
#20 0x000055ea917742d8 llvm::FPPassManager::runOnFunction(llvm::Function&) /home/lena/GitClone/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1435:20
#21 0x000055ea917745aa llvm::FPPassManager::runOnModule(llvm::Module&) /home/lena/GitClone/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1481:13
#22 0x000055ea917749ff (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) /home/lena/GitClone/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1550:20
#23 0x000055ea9176f608 llvm::legacy::PassManagerImpl::run(llvm::Module&) /home/lena/GitClone/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:535:13
#24 0x000055ea917752d1 llvm::legacy::PassManager::run(llvm::Module&) /home/lena/GitClone/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1678:1
#25 0x000055ea9016cb4e compileModule(char**, llvm::LLVMContext&) /home/lena/GitClone/llvm-project/llvm/tools/llc/llc.cpp:754:66
#26 0x000055ea9016a37a main /home/lena/GitClone/llvm-project/llvm/tools/llc/llc.cpp:416:35
#27 0x00007f6437a39850 (/usr/lib/libc.so.6+0x23850)
#28 0x00007f6437a3990a __libc_start_main (/usr/lib/libc.so.6+0x2390a)
#29 0x000055ea90168f25 _start (./build/bin/llc+0x592f25)
[1]    1802379 IOT instruction (core dumped)  ./build/bin/llc ~/test.ll

this issue was encountered while trying to port rust to the NEC Vector Engine and doesn't occur when using SX-Aurora TSUBASA Research's llvm fork.

this requires llvm to be built with the VE backend enabled. (-DLLVM_TARGETS_TO_BUILD="X86;VE")

tested on commit 16a0fc2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backend:VEquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions