[mlir][linalg] Fix crash in linalg.reduce verifier when inputs \!= inits count (#186278)

Add an early check in `ReduceOp::verify()` that compares the operand
count from the ODS accessor with `getNumDpsInputs()`. A mismatch means
the `SameVariadicOperandSize` invariant is violated and the verifier
emits a clear diagnostic instead of crashing.

Fixes #93973

Assisted-by: Claude Code
GitOrigin-RevId: 4a06f38c6b925eb587ac0b6ab51d9e3c5844d33c
2 files changed
tree: e0d8eb1db14b65196c35ad5c493e58219881698f
  1. benchmark/
  2. cmake/
  3. docs/
  4. examples/
  5. include/
  6. lib/
  7. python/
  8. test/
  9. tools/
  10. unittests/
  11. utils/
  12. .clang-format
  13. .clang-tidy
  14. CMakeLists.txt
  15. LICENSE.TXT
  16. Maintainers.md
  17. README.md
README.md

Multi-Level Intermediate Representation

See https://mlir.llvm.org/ for more information.