[Mlir-commits] [mlir] [mlir][vector] Add DialectReductionPatternInterface and broadcast reduction (PR #183181)

Omer Farkash llvmlistbot at llvm.org
Thu Feb 26 01:54:48 PST 2026


OmerFarkash wrote:

Hi @Groverkss ,

Thank you for the feedback, about the architectural points, I have updated the PR to address them:

Dependency Inversion: I removed the implementation from the core Vector dialect. The reduction logic is now properly implemented as an ExternalModel (via DialectReductionPatternInterface) directly within the Reducer library (ReductionPatterns.cpp). This keeps the Vector dialect clean and free of tooling dependencies.

Generic Pattern: I updated the logic to use MatchAnyOpTypeTag(). Instead of explicitly targeting vector.broadcast, it now generically matches any operation that returns a VectorType and replaces those results with ub.poison. This makes the reducer significantly more powerful for arbitrary vector code.

Test Stability: I updated the tests to use a dedicated shell script (vector-test.sh) with the correct exit codes expected by the reducer, and added UNSUPPORTED: system-windows to resolve the posix_spawn issues on Windows CI.

Let me know if this updated architecture looks good to you.

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


More information about the Mlir-commits mailing list