[llvm] [RISCV][VLOPT] Don't reduce the VL is the same as CommonVL (PR #123878)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 22 09:43:21 PST 2025


preames wrote:

> The problem is that we visit every instruction in the basic block in the outer loop. And we visit every earlier instruction anytime we make a change using a worklist. So the problem is that we process most of the graph using the worklist, but then the outer loop still causes us to revisit everything again. Each time we run through the worklist all over again.
> 
> What we should probably do is pre-load the worklist with the entire basic block instead of using the outer loop. The worklist is a SetVector so won't add anything more than once.

I implemented this suggestion in https://github.com/llvm/llvm-project/pull/123973.  I want to be careful to say I don't see this as an alternative, but as a possible *additional* fix or defense in depth.  I do want to see this change move forward as it will reduce the depth of the recursive (worklist) walk when we're not achieving anything useful.

https://github.com/llvm/llvm-project/pull/123878


More information about the llvm-commits mailing list