Skip to content

[xls][mlir] Fix issues found by MLIR's "expensive checks." - #4719

Draft
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_959590529
Draft

[xls][mlir] Fix issues found by MLIR's "expensive checks."#4719
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_959590529

Conversation

@copybara-service

Copy link
Copy Markdown

[xls][mlir] Fix issues found by MLIR's "expensive checks."

This CL fixes several issues found in rewrite patterns by MLIR's MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS. Concretely, it fixes two issues:

  • A pattern in -instantiate-eprocs erased an op without going through the rewriter, so the CL uses rewriter.eraseOp(op) instead.

  • Two patterns in -optimize-spawns modified ops in place without going through PatternRewriter::modifyOpInPlace, so the CL moves the logic into a lambda and passes it to that function.

This CL fixes several issues found in rewrite patterns by MLIR's `MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS`. Concretely, it fixes two issues:

* A pattern in `-instantiate-eprocs` erased an op without going through the rewriter, so the CL uses `rewriter.eraseOp(op)` instead.

* Two patterns in `-optimize-spawns` modified ops in place without going through `PatternRewriter::modifyOpInPlace`, so the CL moves the logic into a lambda and passes it to that function.

PiperOrigin-RevId: 959590529
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant