[llvm] [RISCV] Move RISCVInsertVSETVLI to after phi elimination (PR #91440)

Roger Ferrer Ibáñez via llvm-commits llvm-commits at lists.llvm.org
Wed May 15 11:08:32 PDT 2024


rofirrim wrote:

This is probably a bit of an edge case (note the `undef` in the AVL position), but the following IR now crashes

```llvm
declare <vscale x 1 x i8> @llvm.riscv.vadd.nxv1i8.nxv1i8(
  <vscale x 1 x i8>,
  <vscale x 1 x i8>,
  <vscale x 1 x i8>,
  i64);

define <vscale x 1 x i8> @intrinsic_vadd_vv_nxv1i8_nxv1i8_nxv1i8(<vscale x 1 x i8> %0, <vscale x 1 x i8> %1, <vscale x 1 x i8> %2) nounwind {
entry:
  %a = call <vscale x 1 x i8> @llvm.riscv.vadd.nxv1i8.nxv1i8(
    <vscale x 1 x i8> %0,
    <vscale x 1 x i8> %1,
    <vscale x 1 x i8> %2,
    i64 undef)

  ret <vscale x 1 x i8> %a
}
```

```
llc -mtriple riscv64 -mattr=+v,+f,+d -o - t.ll
	.text
	.attribute	4, 16
	.attribute	5, "rv64i2p1_f2p2_d2p2_v1p0_zicsr2p0_zve32f1p0_zve32x1p0_zve64d1p0_zve64f1p0_zve64x1p0_zvl128b1p0_zvl32b1p0_zvl64b1p0"
	.file	"t.ll"
llc: /llvm-src/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp:58: VNInfo *(anonymous namespace)::getVNInfoFromReg(Register, const MachineInstr &, const LiveIntervals *): Assertion `VNI' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: ./bin/llc -mtriple riscv64 -mattr=+v,+f,+d -o - t.ll
1.	Running pass 'Function Pass Manager' on module 't.ll'.
2.	Running pass 'RISC-V Insert VSETVLI pass' on function '@intrinsic_vadd_vv_nxv1i8_nxv1i8_nxv1i8'
```

https://github.com/llvm/llvm-project/pull/91440


More information about the llvm-commits mailing list