[PATCH] D122769: [RISCV] Add a prepass to vsetvli insertion to propagate VLMAX vsetvli to the instructions.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 6 15:57:57 PDT 2022


craig.topper added a comment.

In D122769#3498032 <https://reviews.llvm.org/D122769#3498032>, @reames wrote:

> Taking another look at this triggered by our offline chat.
>
> I can't help but think the forward direction here is a bit awkward.  It would seem more natural to visit all the instructions with VL operands, and then check for the VReg which defines it whether we could prove it be equivalent to VLMAX.  Doing this either as a pre-pass, or maybe even inside getInfoForVSETVLI does seem to be worthwhile as it could eliminate inserted vsetvlis.  On the other hand, a post-pass could be easier to test (via explicit vsetvli tests), and might catch some intrinsic cases.
>
> In short, I don't have strong opinions on pre-vs-post, but might encourage working back from the consumer instruction instead of forward.

Makes sense. I'll make that change

> Hm, just a thought, if we are working backwards in a pre-pass this starts looking like a dag combine?  Would we benefit from doing this there instead?

DAGCombine can't do cross basic block.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122769



More information about the llvm-commits mailing list