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

Optimize opt_expr evaluation ordering #4900

Open
KrystalDelusion opened this issue Feb 14, 2025 · 0 comments
Open

Optimize opt_expr evaluation ordering #4900

KrystalDelusion opened this issue Feb 14, 2025 · 0 comments

Comments

@KrystalDelusion
Copy link
Member

Feature Description

While working on #4899 I discovered that opt_expr has optimizations for folding cells with constant outputs (e.g. when a shift cell has two constant inputs), but these don't get checked until after the optimizations for cells with one constant input. This means for example, that if a shift cell has two constant inputs, it will first replace the cell with a wire connecting the relevant bits of A directly to Y, which then requires a separate operation to optimize the new wire. It seems to me that reordering the opt_expr::replace_const_cells() to perform the FOLD_NARG_CELL() checks first could be an improvement to performance (albeit a slight one).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant