Current generated Python binding for the SCF dialect does not allow
users to call IfOp to create if-else branches on their own.
This PR sets up the default binding generation for scf.if operation
to address this problem.
Details
- Reviewers
ftynse - Commits
- rG036088fd6ea2: [MLIR][Python] Add SCFIfOp Python binding
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks! This looks almost good. Could you please add a test?
mlir/python/mlir/dialects/_scf_ops_ext.py | ||
---|---|---|
72–78 ↗ | (On Diff #413308) | I would rather use the following signature: self, cond, results_ = [], *, hasElse=False, loc=None, ip=None). This will (1) make it easy to create if operations that don't return values (most cases I've seen so far) and (2) require passing hasElse using kwargs syntax as opposed to just having magic True in the call. |
81 ↗ | (On Diff #413308) | "a boolean value" can be misinterpreted as Python True/False. |
@ftynse Sorry for messing up this PR a bit. I've made the changes you suggested. Please have a check. Thanks!
Hi @ftynse , could you please take a look at it and see if there is anything that should be changed? Thanks!
@ftynse Thanks for reviewing! Could you help land the PR? Seems I do not have access rights to push to the main repository.
I've rebased to the latest commit in the main branch, but the pre-merge checks still failed.
Seems like there is a local base commit in your repository: you're not uploading a diff that applies on HEAD.