[PATCH] D120287: [RISCV] Add isel patterns for masked RISCVISD::FMA_VL with RISCVISD::FNEG_VL.

Fraser Cormack via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 24 02:14:51 PST 2022


frasercrmck added a comment.

In D120287#3342330 <https://reviews.llvm.org/D120287#3342330>, @rogfer01 wrote:

> It seems a bit hacky at first and I guess it works because those patterns are kind of skipped during matching, right?
>
>> If we don't think srcvalue is ok, we'll need to change to true_mask or use C++ code to match.
>
> Does it make sense to have `riscv_fmsub_vl`, `riscv_fnmsub_vl`, ... nodes that we combine earlier using `riscv_fma_vl` and others? I understand this would make the patterns straightforward but maybe it is not feasible.

I was thinking we'd (have to) go down the `srcvalue` route, personally. It should be correct and I can't think of a reason we'd want more control over this kind of thing while pattern matching.

I fear that adding more custom combined nodes would get unwieldy as they don't scale particularly well: we'd probably want corresponding ones for integer madd/macc, for narrowing operations, etc. They may inhibit theoretical optimizations we can perform on generic VP nodes. But the key word is "theoretical" and so that's just a gut reaction. We do have custom nodes for all of the widening operations, so it's feasible.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120287



More information about the llvm-commits mailing list