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

[enhancement] Make invoke side-effecting + make a "safe to remove side-effecting op" category #1806

Open
grebe opened this issue Dec 19, 2024 · 0 comments
Labels
enhancement New feature or request optimizer Related to IR optimization or analysis

Comments

@grebe
Copy link
Collaborator

grebe commented Dec 19, 2024

What's hard to do? (limit 100 words)

There are places where we need to decide if it's OK to remove or change an op, and the check often looks something like

if (OpIsSideEffecting(node->op()) && !node->Is<Gate>()) { ... }

or something like that. Relatedly, #1805 implies that perhaps invoke() ops should be considered side-effecting, but you probably should be able to remove ffi-invokes.

Current best alternative workaround (limit 100 words)

Ad-hoc categories scattered throughout code + hope that fuzzing catches when these categories are misaligned.

Your view of the "best case XLS enhancement" (limit 100 words)

Make a category like MustKeepSideEffectOp() that excludes gate() and FFI invokes(), but includes "regular" invokes. Alternatively, make a separate op for FFI stuff.

@grebe grebe added enhancement New feature or request optimizer Related to IR optimization or analysis labels Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request optimizer Related to IR optimization or analysis
Projects
None yet
Development

No branches or pull requests

1 participant