LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 2116 - Add support for 'transactions' in the pass manager
Summary: Add support for 'transactions' in the pass manager
Status: NEW
Alias: None
Product: libraries
Classification: Unclassified
Component: Core LLVM classes (show other bugs)
Version: 2.2
Hardware: PC All
: P normal
Assignee: Unassigned LLVM Bugs
URL:
Keywords: new-feature
Depends on:
Blocks:
 
Reported: 2008-03-01 03:23 PST by Chris Lattner
Modified: 2020-03-03 07:52 PST (History)
7 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Lattner 2008-03-01 03:23:58 PST
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.
Comment 1 Rafael Ávila de Espíndola 2014-03-14 08:07:37 PDT
I got here via the open projects page.

Is this something we still want to do? It looks like we could get most of the benefit by just doing something like IfCvtLimit. That is, add a debug command line option -max-transforms that each pass can check to see how many inlines, if conversions, alloca promotions, etc it should do.

If bugpoint gets down to a single pass, it can try "-max-transforms 0" to see if that pass supports limiting the amount of work it does.