noir icon indicating copy to clipboard operation
noir copied to clipboard

Investigate how well SSA passes optimize near-inverse stdlib functions

Open michaeljklein opened this issue 4 months ago • 0 comments

Problem

Investigate and/or test that the following near-inverse stdlib function pairs are well-optimized by the SSA passes:

  • to_be_bytes / from_be_bytes (needs range checks and / or modulo)
  • to_le_bytes / from_le_bytes (needs range checks and / or modulo)
  • Add / Sub for Field
  • Mul / Div for Field (with known divisor != 0)
  • Option::some / Option::unwrap

Happy Case

There are tests that the listed near-inverse functions are well-optimized

Workaround

None

Workaround Description

No response

Additional Context

No response

Project Impact

Nice-to-have

Blocker Context

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

michaeljklein avatar Oct 22 '24 17:10 michaeljklein