Issue 145046
Summary [codegen] LLVM ERROR: Cannot select: t143: v4i32 = X86ISD::VPERMILPV t2, t147
Labels new issue
Assignees
Reporter TatyanaDoubts
    To reproduce run llc with the test below:
```
; ModuleID = 'reduced.ll'
source_filename = "reduced.ll"
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-ni:1-p2:32:8:8:32-ni:2"
target triple = "x86_64-unknown-linux-gnu"

define void @widget(<2 x i32> %arg) #0 gc "statepoint-example" {
bb:
  %call = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void (ptr addrspace(1))) null, i32 1, i32 0, ptr addrspace(1) null, i32 0, i32 0)
  %call1 = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(i32 (float)) null, i32 1, i32 0, float 0.000000e+00, i32 0, i32 0)
  %call2 = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(ptr addrspace(1) (ptr addrspace(1))) null, i32 1, i32 0, ptr addrspace(1) null, i32 0, i32 0)
  %call3 = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(ptr addrspace(1) (ptr addrspace(1))) null, i32 1, i32 0, ptr addrspace(1) null, i32 0, i32 0)
  %call4 = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(i32 (ptr addrspace(1))) null, i32 1, i32 0, ptr addrspace(1) null, i32 0, i32 0)
 %shufflevector = shufflevector <2 x i32> %arg, <2 x i32> zeroinitializer, <8 x i32> <i32 poison, i32 poison, i32 poison, i32 poison, i32 1, i32 poison, i32 poison, i32 poison>
  %shufflevector5 = shufflevector <2 x i32> %arg, <2 x i32> zeroinitializer, <8 x i32> <i32 0, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
  %shufflevector6 = shufflevector <8 x i32> %shufflevector, <8 x i32> %shufflevector5, <8 x i32> <i32 poison, i32 poison, i32 poison, i32 poison, i32 4, i32 poison, i32 poison, i32 8>
  %shufflevector7 = shufflevector <8 x i32> %shufflevector6, <8 x i32> zeroinitializer, <4 x i32> <i32 4, i32 poison, i32 poison, i32 7>
 %shufflevector8 = shufflevector <4 x i32> %shufflevector7, <4 x i32> zeroinitializer, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison>
  %shufflevector9 = shufflevector <8 x i32> zeroinitializer, <8 x i32> %shufflevector8, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 8, i32 9, i32 10, i32 11>
  %extractelement = extractelement <8 x i32> %shufflevector9, i64 4
  %extractelement10 = extractelement <8 x i32> %shufflevector9, i64 7
  %call11 = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void (i32)) null, i32 1, i32 0, i32 0, i32 0, i32 0) [ "deopt"([53 x i32] zeroinitializer, ptr addrspace(1) null, i32 0, ptr addrspace(1) null, i32 %extractelement, i32 0, i32 0, i32 0, i32 %extractelement10, i32 0, i32 0, i32 0, i32 0, ptr addrspace(1) null, double 0.000000e+00, i32 0, ptr addrspace(1) null, ptr addrspace(1) null) ]
  unreachable
}

declare token @llvm.experimental.gc.statepoint.p0(i64 immarg, i32 immarg, ptr, i32 immarg, i32 immarg, ...)

attributes #0 = { "target-cpu"="znver2" }
```
Reproducer: https://godbolt.org/z/GWbc95Yha

```
LLVM ERROR: Cannot select: t143: v4i32 = X86ISD::VPERMILPV t2, t147
  t2: v4i32,ch = CopyFromReg t0, Register:v4i32 %0
  t147: v4i32,ch = load<(load (s128) from constant-pool + 16, basealign 32)> t0, t146, undef:i64
    t146: i64 = add t135, Constant:i64<16>
      t135: i64 = X86ISD::Wrapper TargetConstantPool:i64<<8 x i32> <i32 undef, i32 undef, i32 undef, i32 undef, i32 1, i32 undef, i32 undef, i32 0>> 0
In function: widget
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 <source>
1.	Running pass 'Function Pass Manager' on module '<source>'.
2.	Running pass 'X86 DAG->DAG Instruction Selection' on function '@widget'
 #0 0x0000000003ee3af8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3ee3af8)
 #1 0x0000000003ee1484 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #2 0x0000782b9a442520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x0000782b9a4969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #4 0x0000782b9a442476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #5 0x0000782b9a4287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #6 0x00000000007a1e8d llvm::json::operator==(llvm::json::Value const&, llvm::json::Value const&) (.cold) JSON.cpp:0:0
 #7 0x0000000003c7a631 llvm::SelectionDAGISel::CannotYetSelect(llvm::SDNode*) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3c7a631)
 #8 0x0000000003c7fef9 llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3c7fef9)
 #9 0x00000000021ce507 (anonymous namespace)::X86DAGToDAGISel::Select(llvm::SDNode*) X86ISelDAGToDAG.cpp:0:0
#10 0x0000000003c76b9b llvm::SelectionDAGISel::DoInstructionSelection() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3c76b9b)
#11 0x0000000003c867b8 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3c867b8)
#12 0x0000000003c89e8d llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3c89e8d)
#13 0x0000000003c8b335 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3c8b335)
#14 0x0000000003c7b44f llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3c7b44f)
#15 0x0000000002e1f2fa llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#16 0x000000000344c73f llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x344c73f)
#17 0x000000000344caf1 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x344caf1)
#18 0x000000000344d361 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x344d361)
#19 0x00000000008d32d8 compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#20 0x00000000007aa26e main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x7aa26e)
#21 0x0000782b9a429d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#22 0x0000782b9a429e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#23 0x00000000008c99b5 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x8c99b5)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to