[llvm] [VPlan] Extract reverse operation for reverse accesses (PR #146525)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 10 03:36:29 PST 2025


lukel97 wrote:

> Ping. Currently, there are three different approaches for converting reverse to vp.reverse. Can we decide which approach we want to move forward with for now?

I don't see any way forward other than doing it optimizeMaskToEVL, i.e. in https://github.com/llvm/llvm-project/commit/32504676f616a98d3282ef2601550e6ed3e25714. Having the VPlan be in an incorrect state temporarily makes things much harder to reason about and is likely to lead to more subtle miscompiles down the line.

After this PR I am confident we can rewrite the reverse -> vp.reverse pattern in terms of slides which should address the issue when two reverses are folded away. 

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


More information about the llvm-commits mailing list