summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegAllocPBQP.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove spurious typedefs.Jakob Stoklund Olesen2012-06-201-3/+0
| | | | llvm-svn: 158878
* Remove the RenderMachineFunction HTML output pass.Jakob Stoklund Olesen2012-06-201-8/+0
| | | | | | | I don't think anyone has been using this functionality for a while, and it is getting in the way of refactoring now. llvm-svn: 158876
* Teach PBQPBuilder::build() about regunit interference.Jakob Stoklund Olesen2012-06-201-33/+31
| | | | | | | Filter out physreg candidates with regunit interferrence. Also compute regmask interference more efficiently. llvm-svn: 158864
* Avoid iterating with LiveIntervals::iterator.Jakob Stoklund Olesen2012-06-201-13/+9
| | | | | | | | | | That is a DenseMap iterator keyed by pointers, so the iteration order is nondeterministic. I would like to replace the DenseMap with an IndexedMap which doesn't allow iteration. llvm-svn: 158856
* Also compute MBB live-in lists in the new rewriter pass.Jakob Stoklund Olesen2012-06-091-45/+0
| | | | | | | | | This deduplicates some code from the optimizing register allocators, and it means that it is now possible to change the register allocators' solutions simply by editing the VirtRegMap between the register allocator pass and the rewriter. llvm-svn: 158249
* Reintroduce VirtRegRewriter.Jakob Stoklund Olesen2012-06-081-8/+0
| | | | | | | | | | | | | | | | | | OK, not really. We don't want to reintroduce the old rewriter hacks. This patch extracts virtual register rewriting as a separate pass that runs after the register allocator. This is possible now that CodeGen/Passes.cpp can configure the full optimizing register allocator pipeline. The rewriter pass uses register assignments in VirtRegMap to rewrite virtual registers to physical registers, and it inserts kill flags based on live intervals. These finalization steps are the same for the optimizing register allocators: RABasic, RAGreedy, and PBQP. llvm-svn: 158244
* Remove unused private fields found by clang's new -Wunused-private-field.Benjamin Kramer2012-06-061-1/+1
| | | | | | | | There are some that I didn't remove this round because they looked like obvious stubs. There are dead variables in gtest too, they should be fixed upstream. llvm-svn: 158090
* Switch all register list clients to the new MC*Iterator interface.Jakob Stoklund Olesen2012-06-011-9/+5
| | | | | | | | | | | | | No functional change intended. Sorry for the churn. The iterator classes are supposed to help avoid giant commits like this one in the future. The TableGen-produced register lists are getting quite large, and it may be necessary to change the table representation. This makes it possible to do so without changing all clients (again). llvm-svn: 157854
* Small fix for the debug output from PBQP (PR12822).Patrik Hägglund2012-05-231-3/+4
| | | | llvm-svn: 157319
* Allow LiveRangeEdit to be created with a NULL parent.Jakob Stoklund Olesen2012-05-191-1/+1
| | | | | | The dead code elimination with callbacks is still useful. llvm-svn: 157100
* Moved LiveRangeEdit.h so that it can be called from other parts of the ↵Pete Cooper2012-04-021-1/+1
| | | | | | backend, not just libCodeGen llvm-svn: 153906
* Refactored the LiveRangeEdit interface so that MachineFunction, ↵Pete Cooper2012-04-021-1/+1
| | | | | | TargetInstrInfo, MachineRegisterInfo, LiveIntervals, and VirtRegMap are all passed into the constructor and stored as members instead of passed in to each method. llvm-svn: 153903
* Add a debug option to dump PBQP graphs during register allocation.Lang Hames2012-03-261-0/+29
| | | | llvm-svn: 153483
* Add support for register masks to PBQP.Lang Hames2012-03-231-4/+38
| | | | llvm-svn: 153341
* Use uint16_t to store register overlaps to reduce static data.Craig Topper2012-03-041-1/+1
| | | | llvm-svn: 152001
* Use uint16_t instead of unsigned to store registers in reg classes. Reduces ↵Craig Topper2012-03-041-1/+1
| | | | | | static data size. llvm-svn: 151998
* Clear virtual registers after they are no longer referenced.Andrew Trick2012-02-211-0/+5
| | | | | | | | | | | | | Passes after RegAlloc should be able to rely on MRI->getNumVirtRegs() == 0. This makes sharing code for pre/postRA passes more robust. Now, to check if a pass is running before the RA pipeline begins, use MRI->isSSA(). To check if a pass is running after the RA pipeline ends, use !MRI->getNumVirtRegs(). PEI resets virtual regs when it's done scavenging. PTX will either have to provide its own PEI pass or assign physregs. llvm-svn: 151032
* RegAlloc superpass: includes phi elimination, coalescing, and scheduling.Andrew Trick2012-02-101-2/+0
| | | | | | | | | | | | | | | | Creates a configurable regalloc pipeline. Ensure specific llc options do what they say and nothing more: -reglloc=... has no effect other than selecting the allocator pass itself. This patch introduces a new umbrella flag, "-optimize-regalloc", to enable/disable the optimizing regalloc "superpass". This allows for example testing coalscing and scheduling under -O0 or vice-versa. When a CodeGen pass requires the MachineFunction to have a particular property, we need to explicitly define that property so it can be directly queried rather than naming a specific Pass. For example, to check for SSA, use MRI->isSSA, not addRequired<PHIElimination>. CodeGen transformation passes are never "required" as an analysis ProcessImplicitDefs does not require LiveVariables. We have a plan to massively simplify some of the early passes within the regalloc superpass. llvm-svn: 150226
* whitespaceAndrew Trick2012-02-101-11/+11
| | | | llvm-svn: 150225
* Convert assert(0) to llvm_unreachableCraig Topper2012-02-051-1/+1
| | | | llvm-svn: 149816
* Freeze reserved registers before starting register allocation.Jakob Stoklund Olesen2012-01-051-0/+1
| | | | | | | | | | | The register allocators don't currently support adding reserved registers while they are running. Extend the MRI API to keep track of the set of reserved registers when register allocation started. Target hooks like hasFP() and needsStackRealignment() can look at this set to avoid reserving more registers during register allocation. llvm-svn: 147577
* Kill off the LoopSplitter. It's not being used or maintained.Lang Hames2011-12-061-9/+0
| | | | llvm-svn: 145897
* Update PBQP's analysis usage to reflect the requirements of the inline spiller.Lang Hames2011-12-061-0/+7
| | | | llvm-svn: 145893
* Switch PBQP to VRM's trivial rewriter.Jakob Stoklund Olesen2011-11-131-4/+1
| | | | | | The very complicated VirtRegRewriter is going away. llvm-svn: 144479
* Switch PBQP to the modern InlineSpiller framework.Jakob Stoklund Olesen2011-11-121-40/+11
| | | | | | | | | | | It is worth noting that the old spiller would split live ranges around basic blocks. The new spiller doesn't do that. PBQP should do its own live range splitting with SplitEditor::splitSingleBlock() if desired. See RAGreedy::tryBlockSplit(). llvm-svn: 144476
* Refer to the RegisterCoalescer pass by ID.Jakob Stoklund Olesen2011-08-091-1/+1
| | | | | | | A public interface is no longer needed since RegisterCoalescer is not an analysis any more. llvm-svn: 137082
* There is only one register coalescer. Merge it into the base class andRafael Espindola2011-06-261-1/+1
| | | | | | remove the analysis group. llvm-svn: 133899
* Move RegisterCoalescer.h to lib/CodeGen.Rafael Espindola2011-06-261-1/+1
| | | | llvm-svn: 133895
* Add a hook for PBQP clients to run a custom pre-alloc pass to run prior to ↵Lang Hames2011-06-171-4/+9
| | | | | | PBQP allocation. Patch by Arnaud Allard de Grandmaison. llvm-svn: 133249
* Move PBQP off allocation_order_begin. No functional change intended.Jakob Stoklund Olesen2011-06-161-5/+4
| | | | | | | I think PBQP could use RegisterClassInfo, but it didn't fit neatly with the external interfaces that PBQP uses, so I'll leave that to Lang. llvm-svn: 133186
* Make SpillIs an optional pointer. Avoid creating a bunch of temporary ↵Jakob Stoklund Olesen2011-03-101-2/+1
| | | | | | SmallVectors. llvm-svn: 127388
* Fix some style issues in PBQP. Patch by David Blaikie.Lang Hames2010-11-121-20/+25
| | | | llvm-svn: 118883
* Get rid of static constructors for pass registration. Instead, every pass ↵Owen Anderson2010-10-191-1/+12
| | | | | | | | | | | | | | | | | exposes an initializeMyPassFunction(), which must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize the pass's dependencies. Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h before parsing commandline arguments. I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass registration/creation, please send the testcase to me directly. llvm-svn: 116820
* Removed the older style (in-allocator) problem construction system from the ↵Lang Hames2010-10-041-628/+9
| | | | | | PBQP allocator. Problem construction is now done exclusively with the new builders. llvm-svn: 115502
* Removed VNInfo::isDefAccurate(). Def "accuracy" can be checked by testing ↵Lang Hames2010-09-251-1/+1
| | | | | | whether LiveIntervals::getInstructionFromIndex(def) returns NULL. llvm-svn: 114791
* Moved the PBQP allocator class out of the header and back in to the cpp file ↵Lang Hames2010-09-231-60/+190
| | | | | | | | | | | | | | to hide the gory details. Allocator instances can now be created by calling createPBQPRegisterAllocator. Tidied up use of CoalescerPair as per Jakob's suggestions. Made the new PBQPBuilder based construction process the default. The internal construction process remains in-place and available via -pbqp-builder=false for now. It will be removed shortly if the new process doesn't cause any regressions. llvm-svn: 114626
* Fixed ambiguous call.Lang Hames2010-09-211-1/+2
| | | | llvm-svn: 114431
* Added an additional PBQP problem builder which adds coalescing costs (both ↵Lang Hames2010-09-211-14/+127
| | | | | | between pairs of virtuals, and between virtuals and physicals). llvm-svn: 114429
* Unbreak msvc build.Benjamin Kramer2010-09-181-1/+1
| | | | llvm-svn: 114284
* Fixed non-const iterator error.Lang Hames2010-09-181-1/+1
| | | | llvm-svn: 114273
* Added a separate class (PBQPBuilder) for PBQP Problem construction. This ↵Lang Hames2010-09-181-172/+309
| | | | | | | | | | | | class can be extended to support custom constraints. For now the allocator still uses the old (internal) construction mechanism by default. This will be phased out soon assuming no issues with the builder system come up. To invoke the new construction mechanism just pass '-regalloc=pbqp -pbqp-builder' to llc. To provide custom constraints a Target just needs to extend PBQPBuilder and pass an instance of their derived builder to the RegAllocPBQP constructor. llvm-svn: 114272
* Added support for register allocators to record which intervals are spill ↵Lang Hames2010-09-021-1/+4
| | | | | | | | intervals, and where the uses and defs of the original intervals were in the original code. Spill intervals can be hidden using the "-rmf-intervals=virt-nospills*" option. llvm-svn: 112811
* The register allocator shouldn't consider allocating reserved registers. ↵Jim Grosbach2010-09-011-2/+8
| | | | | | PBQP version. llvm-svn: 112742
* Reapply r110396, with fixes to appease the Linux buildbot gods.Owen Anderson2010-08-061-1/+1
| | | | llvm-svn: 110460
* Revert r110396 to fix buildbots.Owen Anderson2010-08-061-1/+1
| | | | llvm-svn: 110410
* Don't use PassInfo* as a type identifier for passes. Instead, use the ↵Owen Anderson2010-08-051-1/+1
| | | | | | | | address of the static ID member as the sole unique type identifier. Clean up APIs related to this change. llvm-svn: 110396
* Switched to rendering after allocation (but before rewriting) in PBQP.Lang Hames2010-07-201-2/+3
| | | | | | | Updated renderer to use allocation information from VirtRegMap (if available) to render spilled intervals differently. llvm-svn: 108815
* Render MachineFunctions to HTML pages, with options to render registerLang Hames2010-07-191-0/+5
| | | | | | | | pressure estimates and liveness alongside. Still experimental. llvm-svn: 108698
* Added -pbqp-pre-coalescing flag to PBQP. If enabled this will cause PBQP to ↵Lang Hames2010-07-181-0/+8
| | | | | | | | | | require LoopSplitter be run prior to register allocation. Entirely for testing purposes at the moment. llvm-svn: 108634
* Iterating over sets of pointers in a heuristic was a bad idea. SwitchingLang Hames2010-07-171-2/+10
| | | | | | | | | | | any command line paramater changed the register allocation produced by PBQP. Turns out variety is not the spice of life. Fixed some comparators, added others. All good now. llvm-svn: 108613
OpenPOWER on IntegriCloud