[llvm] [VectorCombine] Fold Deinterleave/Interleave Pairs (PR #211022)

Gaƫtan Bossu via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 6 03:39:51 PDT 2026


================

----------------
gbossu wrote:

I believe it could work for both steps, because `InstVisitor` also provides "intermediate" handlers like `visitBinaryOperator`. Even though introducing a custom `InstVisitor` would add more structure to the code, I agree it would also make it longer, so I won't push for that change.

A good middle ground could be to create a class that wraps around `SmallVector<ElementwiseStep, 4> Steps` and has methods like
* `bool visitInstLevel(ArrayRef<Instruction> Insts)` to add a new level of instructions
* `Value *widenInstructions()` to return the final instruction to replace the final `Interleave` after widening all levels
* And some private helper methods I guess

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


More information about the llvm-commits mailing list