1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 12:02:58 +02:00
Commit Graph

69 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen
70541686bf Make SpillIs an optional pointer. Avoid creating a bunch of temporary SmallVectors.
llvm-svn: 127388
2011-03-10 01:21:58 +00:00
Lang Hames
b10e4b99e3 Fix some style issues in PBQP. Patch by David Blaikie.
llvm-svn: 118883
2010-11-12 05:47:21 +00:00
Owen Anderson
46990c17f7 Get rid of static constructors for pass registration. Instead, every pass 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
2010-10-19 17:21:58 +00:00
Lang Hames
50cc10e9a7 Removed the older style (in-allocator) problem construction system from the PBQP allocator. Problem construction is now done exclusively with the new builders.
llvm-svn: 115502
2010-10-04 12:13:07 +00:00
Lang Hames
fb22f00975 Removed VNInfo::isDefAccurate(). Def "accuracy" can be checked by testing whether LiveIntervals::getInstructionFromIndex(def) returns NULL.
llvm-svn: 114791
2010-09-25 12:04:16 +00:00
Lang Hames
f670bff621 Moved the PBQP allocator class out of the header and back in to the cpp file 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
2010-09-23 04:28:54 +00:00
Lang Hames
f2e621dcb8 Fixed ambiguous call.
llvm-svn: 114431
2010-09-21 13:47:10 +00:00
Lang Hames
eae68e1117 Added an additional PBQP problem builder which adds coalescing costs (both between pairs of virtuals, and between virtuals and physicals).
llvm-svn: 114429
2010-09-21 13:19:36 +00:00
Benjamin Kramer
89a330c4b9 Unbreak msvc build.
llvm-svn: 114284
2010-09-18 14:41:26 +00:00
Lang Hames
2d87a43549 Fixed non-const iterator error.
llvm-svn: 114273
2010-09-18 09:49:08 +00:00
Lang Hames
4a8c999803 Added a separate class (PBQPBuilder) for PBQP Problem construction. This 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
2010-09-18 09:07:10 +00:00
Lang Hames
e80abebead Added support for register allocators to record which intervals are spill 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
2010-09-02 08:27:00 +00:00
Jim Grosbach
6de7c3ef19 The register allocator shouldn't consider allocating reserved registers. PBQP version.
llvm-svn: 112742
2010-09-01 21:23:03 +00:00
Owen Anderson
f2fea95f2f Reapply r110396, with fixes to appease the Linux buildbot gods.
llvm-svn: 110460
2010-08-06 18:33:48 +00:00
Owen Anderson
aadd8a89ca Revert r110396 to fix buildbots.
llvm-svn: 110410
2010-08-06 00:23:35 +00:00
Owen Anderson
b9762c07cb Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static
ID member as the sole unique type identifier.  Clean up APIs related to this change.

llvm-svn: 110396
2010-08-05 23:42:04 +00:00
Lang Hames
7be6158391 Switched to rendering after allocation (but before rewriting) in PBQP.
Updated renderer to use allocation information from VirtRegMap (if
available) to render spilled intervals differently.

llvm-svn: 108815
2010-07-20 07:41:44 +00:00
Lang Hames
304ecc0487 Render MachineFunctions to HTML pages, with options to render register
pressure estimates and liveness alongside.

Still experimental.

llvm-svn: 108698
2010-07-19 15:22:28 +00:00
Lang Hames
9b05163138 Added -pbqp-pre-coalescing flag to PBQP. If enabled this will cause PBQP to require
LoopSplitter be run prior to register allocation.

Entirely for testing purposes at the moment.

llvm-svn: 108634
2010-07-18 00:57:59 +00:00
Lang Hames
d229cc3cf3 Iterating over sets of pointers in a heuristic was a bad idea. Switching
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
2010-07-17 06:31:41 +00:00
Jakob Stoklund Olesen
bcee53a2b8 Remove many calls to TII::isMoveInstr. Targets should be producing COPY anyway.
TII::isMoveInstr is going tobe completely removed.

llvm-svn: 108507
2010-07-16 04:45:42 +00:00
Rafael Espindola
b29463e006 Don't use getPhysicalRegisterRegClass in PBQP. The existing checks that the
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.

llvm-svn: 108118
2010-07-12 01:45:38 +00:00
Chris Lattner
6e63336eb4 improve portability to systems that don't have powf/modf (e.g. solaris 9)
patch by Evzen Muller!

llvm-svn: 103876
2010-05-15 17:10:24 +00:00
Duncan Sands
80083e741f Remove terminating dot in description. Inconsistency pointed
out by Russell Wallace.

llvm-svn: 96579
2010-02-18 14:10:41 +00:00
Lang Hames
b477072a21 Removed an early out which was causing the PBQP allocator to not compute live-in sets or run the rewriter.
llvm-svn: 96450
2010-02-17 03:42:51 +00:00
Lang Hames
796e4c2b4a Fixed a bug in the PBQP allocator's findCoalesces method.
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.

llvm-svn: 95636
2010-02-09 00:50:27 +00:00
Lang Hames
91856859d6 New PBQP solver.
* 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.

llvm-svn: 94514
2010-01-26 04:49:58 +00:00
David Greene
ecb5255809 Change errs() to dbgs().
llvm-svn: 92586
2010-01-05 01:25:43 +00:00
Lang Hames
9b6e6492ad Moved spill weight calculation out of SimpleRegisterCoalescing and into its own pass: CalculateSpillWeights.
llvm-svn: 91273
2009-12-14 06:49:42 +00:00
Lang Hames
4d30650e61 Added an assert to the PBQP allocator to catch infinite cost solutions which might otherwise lead to miscompilations.
llvm-svn: 88829
2009-11-15 04:39:51 +00:00
Lang Hames
deed780bc6 The Indexes Patch.
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.

llvm-svn: 85979
2009-11-03 23:52:08 +00:00
Nick Lewycky
711c726c97 Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.
Chris claims we should never have visibility_hidden inside any .cpp file but
that's still not true even after this commit.

llvm-svn: 85042
2009-10-25 06:33:48 +00:00
Lang Hames
f6903a7043 Renamed MachineInstrIndex to LiveIndex.
llvm-svn: 83254
2009-10-03 04:21:37 +00:00
Daniel Dunbar
378331a13d Tabs -> spaces, and remove trailing whitespace.
llvm-svn: 82355
2009-09-20 02:20:51 +00:00
Duncan Sands
598fe699d0 Remove some not-really-used variables, as warned
about by icc (#593, partial).  Patch by Erick Tryzelaar.

llvm-svn: 81115
2009-09-06 12:41:19 +00:00
Lang Hames
e504e61ab5 Replaces uses of unsigned for indexes in LiveInterval and VNInfo with
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.

llvm-svn: 81040
2009-09-04 20:41:11 +00:00
Lang Hames
3c7f6b706c Fixed a test that ensures the LocalRewriter does not attempt to
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. 

llvm-svn: 80872
2009-09-03 02:52:02 +00:00
Daniel Dunbar
638e57db6e Suppress build warning in -Asserts
llvm-svn: 79564
2009-08-20 20:01:34 +00:00
Lang Hames
c26fb5727a Added an option to have the PBQP allocator attempt coalescing during allocation.
llvm-svn: 79397
2009-08-19 01:36:14 +00:00
Lang Hames
0e2ecec9f9 Changes DOUT references in the PBQP allocator to use DEBUG(errs() ...)
llvm-svn: 79378
2009-08-18 23:34:50 +00:00
Lang Hames
72bbdbaf85 Added RegisterCoalescer to required passes for PBQP.
llvm-svn: 78840
2009-08-12 21:04:53 +00:00
Dan Gohman
cea903237c Remove unnecessary throw() specifications; LLVM doesn't use exceptions.
llvm-svn: 78667
2009-08-11 15:35:57 +00:00
Dan Gohman
e3fa540e7a Remove unnecessary casts.
llvm-svn: 78664
2009-08-11 15:15:10 +00:00
Lang Hames
1503988bb5 Modified VNInfo. The "copy" member is now a union which holds the copy for a register interval, or the defining register for a stack interval. Access is via getCopy/setCopy and getReg/setReg.
llvm-svn: 78620
2009-08-10 23:43:28 +00:00
Owen Anderson
a15195d3c1 Remove a bunch of debugging code that was slowing PBQP down by 25% or so.
llvm-svn: 78601
2009-08-10 21:49:45 +00:00
Daniel Dunbar
109851c14f Fix some -Asserts unused variable warnings.
llvm-svn: 78447
2009-08-08 00:40:46 +00:00
Lang Hames
66ecec971d New C++ PBQP solver. Currently about as fast (read _slow_) as the old C based solver, but I'll be working to improve that. The PBQP allocator has been updated to use the new solver.
llvm-svn: 78354
2009-08-06 23:32:48 +00:00
Dan Gohman
4529d71681 Use setPreservesAll and setPreservesCFG in CodeGen passes.
llvm-svn: 77754
2009-07-31 23:37:33 +00:00
Daniel Dunbar
8496064116 More migration to raw_ostream, the water has dried up around the iostream hole.
- Some clients which used DOUT have moved to DEBUG. We are deprecating the
   "magic" DOUT behavior which avoided calling printing functions when the
   statement was disabled. In addition to being unnecessary magic, it had the
   downside of leaving code in -Asserts builds, and of hiding potentially
   unnecessary computations.

llvm-svn: 77019
2009-07-25 00:23:56 +00:00
Lang Hames
5c64015a56 VNInfo cleanup.
llvm-svn: 73634
2009-06-17 21:01:20 +00:00