[llvm] [RISCV][VLOPT] Enable the RISCVVLOptimizer by default (PR #119461)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 17 12:27:24 PST 2024
topperc 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. It 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.
https://github.com/llvm/llvm-project/pull/119461
More information about the llvm-commits
mailing list