Track adding control flow passes for optimization level 1
See original GitHub issueWhat should we add?
This issue is to track the target set of passes to enable control flow handling for transpiler optimization_level
=1.
- SetLayout (no change)
- TrivialLayout (no change)
- DenseLayout (#8742)
- EnlargeWithAncilla (no change)
- FullAncillaAllocation (no change)
- ApplyLayout (no change)
- VF2Layout (#8804)
- VF2PostLayout (#8804)
- CheckMap (#8793 )
- CheckGateDirection (#8822)
- GateDirection (#8822)
- StochasticSwap (#8418)
- ContainsInstruction (#8763)
- GatesInBasis (#8823)
- UnitarySynthesis (#8565 )
- Unroll3qOrMore (#8752 )
- UnrollCustomDefinitions (#8752)
- BasisTranslator(#7808)
- BarrierBeforeFinalMeasurements (no change)
- Depth (#8763)
- FixedPoint (no changes)
- Size (#8763)
- Optimize1qGatesDecomposition (#8766)
- CXCancellation (#8752)
- RemoveResetInZeroState (no change required)
We also need to update the preset pass managers (esp level 1) to suitably modify the defaults / reject scheduling_method != None
if a given circuit has control flow:
- Update preset pass managers (#8830)
Time permitting:
- SabreSwap
- SabreLayout
- Layout2qDistance - we elected to swap the O1 PM to use
CheckMap
instead, to avoid adding the questionable “weighting” of control-flow blocks to another pass (#8733)
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Optimize Options (Using the GNU Compiler Collection (GCC))
This option enables simple constant folding optimizations at all optimization levels. In addition, other optimization passes in GCC use this flag to control...
Read more >Optimization passes
GCC jump optimization pass was implemented using simplistic RTL instruction chain analysis and it disturbed control flow graph completely during optimizing.
Read more >Control-Flow and Low-Level Optimizations Outline
– Requires that we determine that the loop is entered. Requires that we determine that the loop is entered at least once! Loop...
Read more >Optimization Compiler Passes Optimizations The Role of the ...
1. Optimization. Before and after generating machine code, devote one or more passes over the program to “improve” code quality. 2. Compiler. Passes....
Read more >LLVM's Analysis and Transform Passes - Documentation
This pass, only available in opt , prints the control flow graph into a .dot graph, omitting the function bodies. This graph can...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ll handle all the trivial passes in a PR that I’ll post tomorrow.
Just a note:
BarrierBeforeFinalMeasure
doesn’t need to recurse in, because any measurements in a control-flow block can’t be final measurements by the original definition.ResetInZeroState
can’t trivially recurse, because the start of a block cannot be assumed to be zero.I found some more transpiler passes while trying to update the preset pass managers, so I’ve added them to the list.