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

pass: optimise away array get->put #1846

Open
ss2165 opened this issue Jan 8, 2025 · 0 comments
Open

pass: optimise away array get->put #1846

ss2165 opened this issue Jan 8, 2025 · 0 comments

Comments

@ss2165
Copy link
Member

ss2165 commented Jan 8, 2025

In guppy it is common to do things like

q = array(qubit(), qubit())
h(q[0])
x(q[0])

This lowers to get from array -> unwrap option -> do thing -> construct option -> put back in array -> get from array.
This results in a lot of LLVM bloat.

It would be better to defer the "put back in array" until as late as possible.

This may be easier once Guppy has a dedicated array extension. CQCL/guppylang#628

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