Repository navigation
Document today's new APIs in the manual - #695
Merged
Merged
Conversation
split_block!, split_block_and_insert_if_then! and its else variant were listed with the dominator tree analysis, and promote_mem_to_reg! and is_promotable with the operations on single instructions. They change the IR, so list them on the transforms page, next to inlining.
Show promote_mem_to_reg!, inline!, simplify_instruction and split_block_and_insert_if_then! at work on small functions, in a section of the transforms page that explains how they differ from passes.
Explain when to add a metadata attachment instead of replacing one, and why a pass drops the metadata of an instruction it moves, and point to map_metadata for cloned IR.
The analyses page did not mention LoopInfo and ScalarEvolution yet. Show how a custom pass gets them, and use them to print the trip count and the induction variable of a loop.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #695 +/- ##
=======================================
Coverage 95.07% 95.07%
=======================================
Files 58 58
Lines 6999 6999
=======================================
Hits 6654 6654
Misses 345 345 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The APIs merged today (#678–#683, #686, #690–#692) all have docstrings and are listed in the API reference, so
checkdocspasses. Two things were still missing for someone who hasn't read the code:split_block!,split_block_and_insert_if_then!andsplit_block_and_insert_if_then_else!were under the dominator tree analysis.promote_mem_to_reg!andis_promotablewere with the operations on single instructions. They all change the IR, so they now sit on the transforms page next to inlining.promote_mem_to_reg!,inline!,simplify_instructionandsplit_block_and_insert_if_then!(with branch weights) run on small functions. The section also explains how these utilities differ from passes, for example that they don't keep analyses up to date.add_metadata!instead of assigning toobj.metadata[kind], and why a pass callsdrop_unknown_metadata!on an instruction it moves. It also points tomap_metadatafor cloned IR.LoopInfoandScalarEvolutionfrom its analysis manager, and prints a loop's backedge-taken count and the step of its induction variable.Value mapping and cloning (
ValueMap,map_value,map_metadata) already had a section in the transforms manual from #683, so this PR doesn't change it.The PR only changes docs. The docs build passes locally on Julia 1.12 with LLVMExtra built from the current
deps/LLVMExtra, and all doctests pass.