Commit 80f7e29
feat: add option to print monomorphized program (#4119)
# Description
Debugging optimizations often requires inspecting the monomorphized
program. This adds an option to enable this.
## Problem\*
#4067
## Summary\*
Example usage:
```bash
❯ (cd test_programs/compile_success_contract/simple_contract && cargo run compile --show-monomorphized)
Compiling nargo_cli v0.23.0 (/Users/michaelklein/Coding/rust/noir/tooling/nargo_cli)
Finished dev [optimized + debuginfo] target(s) in 1.79s
Running `/Users/michaelklein/Coding/rust/noir/target/debug/nargo compile --show-monomorphized`
Monomorphized AST for program with hash: 18020856208726922572
fn triple$f0(x$l0: Field) -> Field {
(x$l0 * 3)
}
Monomorphized AST for program with hash: 9305131916264092540
fn skibbidy$f0(x$l0: Field) -> Field {
(x$l0 * 5)
}
Monomorphized AST for program with hash: 17799031513160233728
fn double$f0(x$l0: Field) -> Field {
(x$l0 * 2)
}
Monomorphized AST for program with hash: 16417890415031598568
fn quadruple$f0(x$l0: Field) -> Field {
(x$l0 * 4)
}
```
## Additional Context
## Documentation\*
Check one:
- [x] No documentation needed. (hidden option)
- [ ] Documentation included in this PR.
- [ ] **[Exceptional Case]** Documentation to be submitted in a separate
PR.
# PR Checklist\*
- [x] I have tested the changes locally.
- [ ] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
---------
Co-authored-by: jfecher <[email protected]>1 parent 4738beb commit 80f7e29
1 file changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
78 | 82 | | |
79 | 83 | | |
80 | 84 | | |
| |||
391 | 395 | | |
392 | 396 | | |
393 | 397 | | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
394 | 401 | | |
395 | 402 | | |
396 | 403 | | |
| |||
0 commit comments