Latest Results
Optionally print IR metadata block (#7684)
## Description
This PR makes printing of the IR metadata block optional.
For IR analysis, in most of the cases, the printed IR just introduces
clutter. It is now not printed by default. To print it, `print-md`
directive must be added to the `--ir` CLI argument (or `--print-ir` in
E2E tests). E.g.:
```
--ir all modified print-md
--if final print-md
```
IR metadata is removed from almost all the snapshots, except the two
that use the whole `sway-lib-std`. Seeing changes in metadata when
changing `std` code is still useful.
The `filter-fn` option in snapshot tests was previously relying on the
first `!0` as an end of the printed IR step. This is now changed to
checking for a `}` in at the beginning of a line.
## Breaking Change
Strictly seen, this is a breaking change, in case someone prints IR and
relies on having metadata printed.
## Checklist
- [ ] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers. Latest Branches
+11%
+25%
0%
ironcev/optionally-print-ir-metadata © 2026 CodSpeed Technology