Add support for 'transactions' in the pass manager #2488
Labels
bugzilla
Issues migrated from bugzilla
enhancement
Improving things as opposed to bug fixing, e.g. new or missing feature
llvm:core
Extended Description
Lots of passes operate by making incremental changes to a function: instcombine iterates through a worklist, mem2reg promotes allocas one at a time, and the inliner inlines a function one at a time. Before and after each transformation, the IR is valid, and could be snapshotted. It would be really awesome to expose this behavior through to the passmanager to allow the verifier to be run after each transaction and for bugpoint to be able to reduce bugs down to the level of a single transaction.
I haven't thought fully about how this would work, but it seems that a pass should be able to opt-in to the transaction system. Each time it does something, it should bump the per-pass counter (which is owned/maintained by the passmgr) and before it does a transaction it checks some counter or something. If the counter is reaches zero, then it stops making transformations.
This is a fairly large and open ended project, but would be incredibly valuable for tracking down nasty bugs, particularly miscompilations.
The text was updated successfully, but these errors were encountered: