[PATCH] D151969: [RISCV] Add RISCVISD nodes for vfwadd/vfwsub.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 8 08:32:28 PDT 2023


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td:1403
+                                      vti.LMul, wti.RegClass, vti.RegClass>;
+      def : VPatBinaryVL_VF<vop_w, instruction_name#"_W"#vti.ScalarSuffix,
+                            wti.Vector, wti.Vector, vti.Vector, vti.Mask,
----------------
rogfer01 wrote:
> I think we may need a `VPatBinaryVL_V` here (similar to the one in `PseudoVWADD` for integers).
> 
> I'm seeing a crash in our downstream while building the llvm-testsuite in column 11 of https://github.com/llvm/llvm-test-suite/blob/main/MultiSource/Benchmarks/McCat/18-imp/L_canny.c#L238
> 
> ```
> fatal error: error in backend: Cannot select: t329: nxv2f64 = RISCVISD::VFWADD_W_VL t363, t313, undef:nxv2f64, t319, t11
> ```
> 
> The compiler is computing `y + EPS` but `y` is a `nxv2f32` and `EPS` is a `double` that has been splatted into `nxv2f64` (and we have a mask around due to the control flow) so the compiler chooses `VFWADD_W_VL` here (I understand the `vfwadd.wf` version expects a `f32` as the scalar operand so it can't be selected) where the first operand is the splatted `EPS` and the second one is `y`.
Hopefully fixed by 11f3b15935a4954f648473b688a20780d662f1e8


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151969/new/

https://reviews.llvm.org/D151969



More information about the llvm-commits mailing list