Refactor: extend cache transforms to store OptimizedSource#638
Refactor: extend cache transforms to store OptimizedSource#638serenity4 wants to merge 4 commits intoJuliaDebug:masterfrom
OptimizedSource#638Conversation
| function CC.transform_result_for_cache(interp::CthulhuInterpreter, result::InferenceResult, edges::Core.SimpleVector) | ||
| if isa(result.src, CodeInfo) | ||
| result.src.edges = edges | ||
| end | ||
| result.src = CC.transform_result_for_local_cache(interp, result) |
There was a problem hiding this comment.
@aviatesk do you know if it is safe to discard edges for OptimizationState? My understanding is that edges anyways come from opt.inlining.edges, so the structure already has them, but before that we used to take the OptimizationState -> CodeInfo path and attach edges to the resulting CodeInfo.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #638 +/- ##
======================================
Coverage 0.00% 0.00%
======================================
Files 9 11 +2
Lines 1556 1547 -9
======================================
+ Misses 1556 1547 -9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Whoops, I may have been to eager to get rid of |
| using Cthulhu: CTHULHU_MODULE | ||
| const Cthulhu = CTHULHU_MODULE[] | ||
| const CC = Cthulhu.CC |
There was a problem hiding this comment.
That's to ensure that we can do using Compiler and have tests switch to using the extension module and keep working.
|
Marking as draft for now, there will be upcoming refactors to related functions in Compiler. |
It seems that using the
transform_result_for_cacheandtransform_result_for_local_cachemechanisms, we don't need to overridefinish!anymore.Therefore, we now have:
CC.finishinfer!to store inferred, unoptimized sources (InferredSource)CC.transform_result_for_cacheandCC.transform_result_for_local_cacheto store inferred, optimized sources (OptimizedSource)