Issue 177863
Summary [LoongArch] LLVM ERROR: Cannot select: t16: v4i32 = setcc t4, t2, seteq:ch
Labels crash-on-valid, backend:loongarch, generated by fuzzer
Assignees
Reporter XChy
    Reproducer: https://godbolt.org/z/33WKW7fq9
Testcase:
```llvm
target datalayout = "e-m:e-p:64:64-i64:64-i128:128-n32:64-s128"
target triple = "loongarch64-unknown-linux-musl"

define <4 x i1> @backsmith_pure_1(<4 x i64> %shuffle2, <4 x i64> %shuffle4) #0 {
entry:
  %conv5 = trunc nuw <4 x i64> %shuffle4 to <4 x i32>
  %conv3 = trunc nuw <4 x i64> %shuffle2 to <4 x i32>
  %cmp = icmp ne <4 x i32> %conv5, %conv3
  ret <4 x i1> %cmp
}

attributes #0 = { "target-features"="+lasx" }
```

Dump:
```
LLVM ERROR: Cannot select: t16: v4i32 = setcc t4, t2, seteq:ch
  t4: v4i64,ch = CopyFromReg t0, Register:v4i64 %1
  t2: v4i64,ch = CopyFromReg t0, Register:v4i64 %0
In function: backsmith_pure_1
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 <source>
1.	Running pass 'Function Pass Manager' on module '<source>'.
2.	Running pass 'LoongArch DAG->DAG Pattern Instruction Selection' on function '@backsmith_pure_1'
 #0 0x0000000004252e38 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x4252e38)
 #1 0x000000000424fd14 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #2 0x000078d670c42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x000078d670c969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #4 0x000078d670c42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #5 0x000078d670c287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #6 0x00000000007bf50b llvm::json::operator==(llvm::json::Value const&, llvm::json::Value const&) (.cold) JSON.cpp:0:0
 #7 0x0000000003fd7751 llvm::SelectionDAGISel::CannotYetSelect(llvm::SDNode*) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3fd7751)
 #8 0x0000000003fde2cd llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3fde2cd)
 #9 0x000000000195d827 llvm::LoongArchDAGToDAGISel::Select(llvm::SDNode*) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x195d827)
#10 0x0000000003fd35ab llvm::SelectionDAGISel::DoInstructionSelection() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3fd35ab)
#11 0x0000000003fe3058 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3fe3058)
#12 0x0000000003fe6355 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3fe6355)
#13 0x0000000003fe7cec llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3fe7cec)
#14 0x0000000003fd2d9f llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3fd2d9f)
#15 0x000000000310b3f9 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#16 0x0000000003768236 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3768236)
#17 0x00000000037685e1 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x37685e1)
#18 0x0000000003768e4f llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3768e4f)
#19 0x00000000008ea142 compileModule(char**, llvm::SmallVectorImpl<llvm::PassPlugin>&, llvm::LLVMContext&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&) llc.cpp:0:0
#20 0x00000000007c591c main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x7c591c)
#21 0x000078d670c29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#22 0x000078d670c29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#23 0x00000000008df1e5 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x8df1e5)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to