Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1532 +/- ##
==========================================
+ Coverage 83.79% 83.82% +0.02%
==========================================
Files 188 188
Lines 29032 29036 +4
Branches 27928 27932 +4
==========================================
+ Hits 24326 24338 +12
+ Misses 3543 3536 -7
+ Partials 1163 1162 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Ok let's combine functionality (not necessarily PRs) here with #1449.
I've updated that to use a similar metadata (there without the Never, with #[non_exhaustive], and I called it InlineAnnotation rather than hint, but at least it's in the same place ;-)).
Noting that #1524 uses inline_acyclic which will mean any function on a cycle will not be inlined at all (cycles are removed from graph rather than merely broken), I think #1449 handles the "Always" bit better, so that can be run first as a separate pass.
Thus, either (a) put this in first, but without the Always option (to be added in 1449); or (b) let's get #1449 in first and then this can add the Never option. I don't really mind which way around, and I think #1449 can be marked ready now (probably for a random reviewer? But you might want to check over the annotation).
WRT this PR:
- I am also unsure about "follow_hints=False" still respecting the "Never" hint; are we sure it shouldn't follow that too? (Otherwise, follow_hints will do nothing when Always is removed. One could say "Always is not a hint" but an annotation, iow it's correct for "follow_hints" to have no effect until we add some InlineAnnotation::XYZHint).
- Would be nice to add to the heuristic here that (non-preserved?) functions with only one call "are always small enough" ;)
- I haven't checked what you're doing here, but I note it's quite tricksy doing inlining respecting PassScope::EntrypointXXX :(
Follow up to #1524. Defines a metadata value for hinting the compiler on which functions to inline.
Part of Quantinuum/hugr#2328.
Note that this definition is rust-only. We still need to add exports for all tket metadata definitions on the python bindings.
Guppy issue/PR (they'll need to be updated):