[llvm] [RISCV][VLOPT] Fix assertion failure across blocks (PR #124734)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 28 07:50:08 PST 2025


lukel97 wrote:

> 2. Do a better job of not adding something that !isCandidate to the worklist.

The issue lies in that a candidate can become a non-candidate whilst on the worklist, because after an instruction gets reduced it's no longer a candidate, which can happen before it's popped off the worklist.

> 1. Allow things on the worklist that are not isCandidate. When when we pop it off, we will check whether it isCandidate and decide whether to optimize or not.

I think we can do this approach. 

It's probably worth noting that there's two types of check going on in isCandidate at the moment, those to ensure correctness (isSupportedInstr, mayRaiseFPException), and those to see if it's worthwhile (VL > 1). We could potentially move the latter into tryReduceVL to keep it alongside the other VL checks.

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


More information about the llvm-commits mailing list