Issue 168594
Summary [X86] llc crashed at -O0/O1/O2/O3: Cannot select: t20: v8i16 = BUILD_VECTOR
Labels backend:X86, crash-on-valid
Assignees
Reporter XChy
    Reproducer: https://godbolt.org/z/fWTr6E55h

Testcase:
```llvm
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

define <8 x i16> @backsmith_pure_1() {
entry:
  %0 = tail call <8 x i16> @llvm.x86.sse2.pavg.w(<8 x i16> splat (i16 1), <8 x i16> zeroinitializer)
  %sub = sub <8 x i16> zeroinitializer, %0
  ret <8 x i16> %sub
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare <8 x i16> @llvm.x86.sse2.pavg.w(<8 x i16>, <8 x i16>) #0

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(none) }
```

llc output:
```
LLVM ERROR: Cannot select: t20: v8i16 = BUILD_VECTOR Constant:i16<-1>, Constant:i16<-1>, Constant:i16<-1>, Constant:i16<-1>, Constant:i16<-1>, Constant:i16<-1>, Constant:i16<-1>, Constant:i16<-1>
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 -O0 <source>
1.	Running pass 'Function Pass Manager' on module '<source>'.
2.	Running pass 'X86 DAG->DAG Instruction Selection' on function '@backsmith_pure_1'
 #0 0x00000000041a29e8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x41a29e8)
 #1 0x000000000419f894 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #2 0x0000784542e42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x0000784542e969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #4 0x0000784542e42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #5 0x0000784542e287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #6 0x00000000007bef3e llvm::json::operator==(llvm::json::Value const&, llvm::json::Value const&) (.cold) JSON.cpp:0:0
 #7 0x0000000003f2cef1 llvm::SelectionDAGISel::CannotYetSelect(llvm::SDNode*) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3f2cef1)
 #8 0x0000000003f338d9 llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3f338d9)
 #9 0x00000000022fd197 (anonymous namespace)::X86DAGToDAGISel::Select(llvm::SDNode*) X86ISelDAGToDAG.cpp:0:0
#10 0x0000000003f28d4b llvm::SelectionDAGISel::DoInstructionSelection() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3f28d4b)
#11 0x0000000003f38158 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3f38158)
#12 0x0000000003f3b348 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3f3b348)
#13 0x0000000003f3cdc5 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3f3cdc5)
#14 0x0000000003f2853f llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3f2853f)
#15 0x0000000003090789 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#16 0x00000000036da9c6 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x36da9c6)
#17 0x00000000036dad71 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x36dad71)
#18 0x00000000036db5df llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x36db5df)
#19 0x00000000008f821f compileModule(char**, llvm::LLVMContext&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&) llc.cpp:0:0
#20 0x00000000007c5db9 main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x7c5db9)
#21 0x0000784542e29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#22 0x0000784542e29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#23 0x00000000008ed4c5 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x8ed4c5)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```

cc @RKSimon @phoebewang 
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to