[PATCH] D133739: [RISCV][WIP] Form more VW instructions

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 14 09:35:14 PDT 2022


qcolombet added a comment.

> On the other hand, it starts getting expensive to fully check that all uses can fold. If there are N users, we'll run the checks something like (N*(N+1))/2 times.

Agree, that's also a problem with the current patch. Even if the checks are lightweight we still do them n^2 times.
One thing I had in mind is we could do the transformation in one go for an extension (i.e., replace its users all at once).

The problem with that is it doesn't fit nicely with SDISel combining model, though I still believe it may be possible to do (at least I vaguely remember doing that in the past.)



================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:8588
+bool canFoldExtensionInAllUsers(SDValue Val) {
+  return std::all_of(Val->use_begin(), Val->use_end(),
+                     canFoldExtensionInOpcode);
----------------
craig.topper wrote:
> Can this be something like `llvm::all_of(Val->uses()`?
Good catch, yes, we should be able to use that.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133739



More information about the llvm-commits mailing list