[mlir][vector] Fix invalid IR in `ContractionOpLowering` (#78130)
If a rewrite pattern returns "failure", it must not have modified the IR. This commit fixes `Dialect/Vector/vector-contract-to-outerproduct-transforms-unsupported.mlir` when running with `MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS`. ``` * Pattern (anonymous namespace)::ContractionOpToOuterProductOpLowering : 'vector.contract -> ()' { Trying to match "(anonymous namespace)::ContractionOpToOuterProductOpLowering" ** Insert : 'vector.transpose'(0x5625b3a8cb30) ** Insert : 'vector.transpose'(0x5625b3a8cbc0) "(anonymous namespace)::ContractionOpToOuterProductOpLowering" result 0 } -> failure : pattern failed to match } -> failure : pattern failed to match LLVM ERROR: pattern returned failure but IR did change ``` Note: `vector-contract-to-outerproduct-transforms-unsupported.mlir` is merged into `vector-contract-to-outerproduct-matvec-transforms.mlir`. The `greedy pattern application failed` error is not longer produced. This error indicates that the greedy pattern rewrite did not convergence; it does not mean that a pattern could not be applied.
Loading
Please sign in to comment