summaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegAllocPBQP.cpp
Commit message (Collapse)AuthorAge
...
* Switch PBQP to VRM's trivial rewriter.Jakob Stoklund Olesen2011-11-13
| | | | | | The very complicated VirtRegRewriter is going away. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144479 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch PBQP to the modern InlineSpiller framework.Jakob Stoklund Olesen2011-11-12
| | | | | | | | | | | 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(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144476 91177308-0d34-0410-b5e6-96231b3b80d8
* Refer to the RegisterCoalescer pass by ID.Jakob Stoklund Olesen2011-08-09
| | | | | | | A public interface is no longer needed since RegisterCoalescer is not an analysis any more. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137082 91177308-0d34-0410-b5e6-96231b3b80d8
* There is only one register coalescer. Merge it into the base class andRafael Espindola2011-06-26
| | | | | | remove the analysis group. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133899 91177308-0d34-0410-b5e6-96231b3b80d8
* Move RegisterCoalescer.h to lib/CodeGen.Rafael Espindola2011-06-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133895 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a hook for PBQP clients to run a custom pre-alloc pass to run prior to ↵Lang Hames2011-06-17
| | | | | | PBQP allocation. Patch by Arnaud Allard de Grandmaison. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133249 91177308-0d34-0410-b5e6-96231b3b80d8
* Move PBQP off allocation_order_begin. No functional change intended.Jakob Stoklund Olesen2011-06-16
| | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133186 91177308-0d34-0410-b5e6-96231b3b80d8
* Make SpillIs an optional pointer. Avoid creating a bunch of temporary ↵Jakob Stoklund Olesen2011-03-10
| | | | | | SmallVectors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127388 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some style issues in PBQP. Patch by David Blaikie.Lang Hames2010-11-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118883 91177308-0d34-0410-b5e6-96231b3b80d8
* Get rid of static constructors for pass registration. Instead, every pass ↵Owen Anderson2010-10-19
| | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116820 91177308-0d34-0410-b5e6-96231b3b80d8
* Removed the older style (in-allocator) problem construction system from the ↵Lang Hames2010-10-04
| | | | | | PBQP allocator. Problem construction is now done exclusively with the new builders. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115502 91177308-0d34-0410-b5e6-96231b3b80d8
* Removed VNInfo::isDefAccurate(). Def "accuracy" can be checked by testing ↵Lang Hames2010-09-25
| | | | | | whether LiveIntervals::getInstructionFromIndex(def) returns NULL. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114791 91177308-0d34-0410-b5e6-96231b3b80d8
* Moved the PBQP allocator class out of the header and back in to the cpp file ↵Lang Hames2010-09-23
| | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114626 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed ambiguous call.Lang Hames2010-09-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114431 91177308-0d34-0410-b5e6-96231b3b80d8
* Added an additional PBQP problem builder which adds coalescing costs (both ↵Lang Hames2010-09-21
| | | | | | between pairs of virtuals, and between virtuals and physicals). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114429 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak msvc build.Benjamin Kramer2010-09-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114284 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed non-const iterator error.Lang Hames2010-09-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114273 91177308-0d34-0410-b5e6-96231b3b80d8
* Added a separate class (PBQPBuilder) for PBQP Problem construction. This ↵Lang Hames2010-09-18
| | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114272 91177308-0d34-0410-b5e6-96231b3b80d8
* Added support for register allocators to record which intervals are spill ↵Lang Hames2010-09-02
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112811 91177308-0d34-0410-b5e6-96231b3b80d8
* The register allocator shouldn't consider allocating reserved registers. ↵Jim Grosbach2010-09-01
| | | | | | PBQP version. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112742 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r110396, with fixes to appease the Linux buildbot gods.Owen Anderson2010-08-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110460 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r110396 to fix buildbots.Owen Anderson2010-08-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110410 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use PassInfo* as a type identifier for passes. Instead, use the ↵Owen Anderson2010-08-05
| | | | | | | | | address of the static ID member as the sole unique type identifier. Clean up APIs related to this change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110396 91177308-0d34-0410-b5e6-96231b3b80d8
* Switched to rendering after allocation (but before rewriting) in PBQP.Lang Hames2010-07-20
| | | | | | | | Updated renderer to use allocation information from VirtRegMap (if available) to render spilled intervals differently. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108815 91177308-0d34-0410-b5e6-96231b3b80d8
* Render MachineFunctions to HTML pages, with options to render registerLang Hames2010-07-19
| | | | | | | | | | pressure estimates and liveness alongside. Still experimental. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108698 91177308-0d34-0410-b5e6-96231b3b80d8
* Added -pbqp-pre-coalescing flag to PBQP. If enabled this will cause PBQP to ↵Lang Hames2010-07-18
| | | | | | | | | | | | require LoopSplitter be run prior to register allocation. Entirely for testing purposes at the moment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108634 91177308-0d34-0410-b5e6-96231b3b80d8
* Iterating over sets of pointers in a heuristic was a bad idea. SwitchingLang Hames2010-07-17
| | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108613 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove many calls to TII::isMoveInstr. Targets should be producing COPY anyway.Jakob Stoklund Olesen2010-07-16
| | | | | | TII::isMoveInstr is going tobe completely removed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108507 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use getPhysicalRegisterRegClass in PBQP. The existing checks that theRafael Espindola2010-07-12
| | | | | | | | | | physical register can be allocated in the class of the virtual are sufficient. I think that the test for virtual registers is more strict than it needs to be, it should be possible to coalesce two virtual registers the class of one is a subclass of the other. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108118 91177308-0d34-0410-b5e6-96231b3b80d8
* improve portability to systems that don't have powf/modf (e.g. solaris 9)Chris Lattner2010-05-15
| | | | | | | | patch by Evzen Muller! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103876 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove terminating dot in description. Inconsistency pointedDuncan Sands2010-02-18
| | | | | | | out by Russell Wallace. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96579 91177308-0d34-0410-b5e6-96231b3b80d8
* Removed an early out which was causing the PBQP allocator to not compute ↵Lang Hames2010-02-17
| | | | | | live-in sets or run the rewriter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96450 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed a bug in the PBQP allocator's findCoalesces method.Lang Hames2010-02-09
| | | | | | | | Previously spill registers, whose def indexes are not defined, would sometimes be improperly marked as coalescable with conflicting registers. The new findCoalesces routine conservatively assumes that any register with at least one undefined def is not coalescable with any register it interferes with. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95636 91177308-0d34-0410-b5e6-96231b3b80d8
* New PBQP solver.Lang Hames2010-01-26
| | | | | | | | | | | * Fixed a reduction bug which occasionally led to infinite-cost (invalid) register allocation solutions despite the existence finite-cost solutions. * Significantly reduced memory usage (>50% reduction). * Simplified a lot of the solver code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94514 91177308-0d34-0410-b5e6-96231b3b80d8
* Change errs() to dbgs().David Greene2010-01-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92586 91177308-0d34-0410-b5e6-96231b3b80d8
* Moved spill weight calculation out of SimpleRegisterCoalescing and into its ↵Lang Hames2009-12-14
| | | | | | own pass: CalculateSpillWeights. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91273 91177308-0d34-0410-b5e6-96231b3b80d8
* Added an assert to the PBQP allocator to catch infinite cost solutions which ↵Lang Hames2009-11-15
| | | | | | might otherwise lead to miscompilations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88829 91177308-0d34-0410-b5e6-96231b3b80d8
* The Indexes Patch.Lang Hames2009-11-03
| | | | | | | | | | | | | | | | | | This introduces a new pass, SlotIndexes, which is responsible for numbering instructions for register allocation (and other clients). SlotIndexes numbering is designed to match the existing scheme, so this patch should not cause any changes in the generated code. For consistency, and to avoid naming confusion, LiveIndex has been renamed SlotIndex. The processImplicitDefs method of the LiveIntervals analysis has been moved into its own pass so that it can be run prior to SlotIndexes. This was necessary to match the existing numbering scheme. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85979 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.Nick Lewycky2009-10-25
| | | | | | | | Chris claims we should never have visibility_hidden inside any .cpp file but that's still not true even after this commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85042 91177308-0d34-0410-b5e6-96231b3b80d8
* Renamed MachineInstrIndex to LiveIndex.Lang Hames2009-10-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83254 91177308-0d34-0410-b5e6-96231b3b80d8
* Tabs -> spaces, and remove trailing whitespace.Daniel Dunbar2009-09-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82355 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove some not-really-used variables, as warnedDuncan Sands2009-09-06
| | | | | | | about by icc (#593, partial). Patch by Erick Tryzelaar. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81115 91177308-0d34-0410-b5e6-96231b3b80d8
* Replaces uses of unsigned for indexes in LiveInterval and VNInfo withLang Hames2009-09-04
| | | | | | | | | a new class, MachineInstrIndex, which hides arithmetic details from most clients. This is a step towards allowing the register allocator to update/insert code during allocation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81040 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed a test that ensures the LocalRewriter does not attempt toLang Hames2009-09-03
| | | | | | | | | | | avoid reloads by reusing clobbered registers. This was causing issues in 256.bzip2 when compiled with PIC for a while (starting at r78217), though the problem has since been masked. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80872 91177308-0d34-0410-b5e6-96231b3b80d8
* Suppress build warning in -AssertsDaniel Dunbar2009-08-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79564 91177308-0d34-0410-b5e6-96231b3b80d8
* Added an option to have the PBQP allocator attempt coalescing during allocation.Lang Hames2009-08-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79397 91177308-0d34-0410-b5e6-96231b3b80d8
* Changes DOUT references in the PBQP allocator to use DEBUG(errs() ...)Lang Hames2009-08-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79378 91177308-0d34-0410-b5e6-96231b3b80d8
* Added RegisterCoalescer to required passes for PBQP.Lang Hames2009-08-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78840 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unnecessary throw() specifications; LLVM doesn't use exceptions.Dan Gohman2009-08-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78667 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unnecessary casts.Dan Gohman2009-08-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78664 91177308-0d34-0410-b5e6-96231b3b80d8