Issue 244092
Summary [RISCV][P-ext] Assertion failure when selecting WADDA[U]/WSUBA[U] with a zero accumulator.
Labels backend:RISC-V, crash-on-valid
Assignees zeyi2
Reporter zeyi2
    On RV32 with the experimental P extension, compiling IR that produces a `RISCVISD::WADDAU`, `WSUBAU`, `WADDA` or `WSUBA` node with a zero 64-bit accumulator `(0, 0)` crashes an assertions-enabled `llc`.

Reproducer: https://godbolt.org/z/ae8Tzh6aa

Minimal IR:

```llvm
target triple = "riscv32"

define i64 @f() {
  %r = call i64 @llvm.riscv.pm2suba.i64.v2i32(i64 2, <2 x i32> zeroinitializer, <2 x i32> zeroinitializer)
  ret i64 %r
}
```

```
llc -mtriple=riscv32 -mattr=+experimental-p -O2
```

`sub i64 0, (sext i32 %a to i64)` can also reach the same path.

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

Reply via email to