Issue 141653
Summary [SystemZ] Crash with `SystemZConvCC` intrinsics
Labels new issue
Assignees
Reporter sayantn
    When this IR is compiled

```llvm
define void @foo(ptr dead_on_unwind noalias nocapture noundef writable writeonly sret([24 x i8]) align 8 dereferenceable(24) initializes((0, 20)) %_0, ptr noalias nocapture noundef readonly align 8 dereferenceable(16) %a, ptr noalias nocapture noundef readonly align 8 dereferenceable(16) %b, ptr noalias nocapture noundef readonly align 8 dereferenceable(16) %c) unnamed_addr #0 {
start:
  %0 = load <16 x i8>, ptr %a, align 8
  %1 = load <16 x i8>, ptr %b, align 8
  %2 = load <16 x i8>, ptr %c, align 8
  %3 = tail call { <16 x i8>, i32 } @llvm.s390.vstrsb(<16 x i8> %0, <16 x i8> %1, <16 x i8> %2) #2
  %4 = extractvalue { <16 x i8>, i32 } %3, 0
  %5 = extractvalue { <16 x i8>, i32 } %3, 1
  store <16 x i8> %4, ptr %_0, align 8
  %6 = getelementptr inbounds nuw i8, ptr %_0, i64 16
  store i32 %5, ptr %6, align 8
  ret void
}

declare { <16 x i8>, i32 } @llvm.s390.vstrsb(<16 x i8>, <16 x i8>, <16 x i8>) #1

attributes #0 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "probe-stack"="inline-asm" "target-cpu"="z10" "target-features"="+vector" }
attributes #1 = { nofree nosync nounwind memory(none) }
attributes #2 = { nounwind }
```
`llc` crashes with

```
LLVM ERROR: Cannot select: 0x3dcc0ab8: v16i8,i32 = SystemZISD::VSTRS_CC 0x3dcc0860, 0x3dcc08d8, 0x3dcc0950
  0x3dcc0860: v16i8,ch = load<(dereferenceable load (s128) from %ir.a, align 8)> 0x3dc91c30, 0x3dcc0518, undef:i64
    0x3dcc0518: i64,ch = CopyFromReg 0x3dc91c30, Register:i64 %1
      0x3dcc04a0: i64 = Register %1
 0x3dcc07e8: i64 = undef
  0x3dcc08d8: v16i8,ch = load<(dereferenceable load (s128) from %ir.b, align 8)> 0x3dc91c30, 0x3dcc0608, undef:i64
 0x3dcc0608: i64,ch = CopyFromReg 0x3dc91c30, Register:i64 %2
 0x3dcc0590: i64 = Register %2
    0x3dcc07e8: i64 = undef
  0x3dcc0950: v16i8,ch = load<(dereferenceable load (s128) from %ir.c, align 8)> 0x3dc91c30, 0x3dcc06f8, undef:i64
    0x3dcc06f8: i64,ch = CopyFromReg 0x3dc91c30, Register:i64 %3
      0x3dcc0680: i64 = Register %3
 0x3dcc07e8: i64 = undef
In function: foo
```

[Godbolt (also contains the Rust code that generated this IR)](https://godbolt.org/z/x6z9G8P96)
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to