Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lower-to-smt: Provide a better rewrite pattern mechanism #32

Open
math-fehr opened this issue Oct 15, 2024 · 0 comments
Open

lower-to-smt: Provide a better rewrite pattern mechanism #32

math-fehr opened this issue Oct 15, 2024 · 0 comments

Comments

@math-fehr
Copy link
Contributor

Currently, the OperationSemantics class has the following signature:

    @abstractmethod
    def get_semantics(
        self,
        operands: Sequence[SSAValue],
        results: Sequence[Attribute],
        attributes: Mapping[str, Attribute | SSAValue],
        effect_state: SSAValue | None,
        rewriter: PatternRewriter,
    ) -> tuple[Sequence[SSAValue], SSAValue | None]:
      ...

operands contains the new operands passed to the operation, meaning that the old operands type are now lost.

Instead, our signature sholud probably start with:

op: Operation:
new_operands: Sequence[SSAValue],
new_attributes: Mapping[str, Attribute | SSAValue],

so that all information remain.

Additionally, this would require to keep the old operations alive during the translation process.
This should be done similarly to the conversion patterns in MLIR.

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

No branches or pull requests

1 participant