[llvm] [RISCV][VLOPT] Enable the RISCVVLOptimizer by default (PR #119461)

Michael Maitland via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 17 12:28:42 PST 2024


michaelmaitland wrote:

> > > > Should we just remove this code for now
> > > 
> > > 
> > > This would be fine by me. Incrementalism is good. :)
> > 
> > 
> > I've removed it in #120291.
> > FWIW, I don't think what you're concerned about can happen with or without #120291 merged since all the instructions that isVectorOpUsedAsScalarOp deal with return `OperandInfo(Unknown)` and won't lead to any (incorrect) optimization.
> 
> The code that was there said that we could ignore the reduction and not call getOperandInfo on it. So it doesn't matter that the reduction is missing from getOperandInfo. The code effectively said that a scalar operand doesn't depend on any elements from the producer. This is incorrect, it demands exactly 1 element. With that code in place only the VL of the other consumers was used. If they used less than 1 element then the 1 element that scalar op needs wouldn't be valid.

Yes, my bad.

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


More information about the llvm-commits mailing list