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

32 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen
54b6cd6d38 Implement the first half of LiveDebugVariables.
Scan the MachineFunction for DBG_VALUE instructions, and replace them with a
data structure similar to LiveIntervals. The live range of a DBG_VALUE is
determined by propagating it down the dominator tree until a new DBG_VALUE is
found. When a DBG_VALUE lives in a register, its live range is confined to the
live range of the register's value.

LiveDebugVariables runs before coalescing, so DBG_VALUEs are not artificially
extended when registers are joined.

The missing half will recreate DBG_VALUE instructions from the intervals when
register allocation is complete.

The pass is disabled by default. It can be enabled with the temporary command
line option -live-debug-variables.

llvm-svn: 120636
2010-12-02 00:37:37 +00:00
Jakob Stoklund Olesen
313b78d28e Insert two blank SlotIndexes between basic blocks instead of just one.
This is the first small step towards using closed intervals for liveness instead
of the half-open intervals we're using now.

We want to be able to distinguish between a SlotIndex that represents a variable
being live-out of a basic block, and an index representing a variable live-in to
its successor.

That requires two separate indexes between blocks. One for live-outs and one for
live-ins.

With this change, getMBBEndIdx(MBB).getPrevSlot() becomes stable so it stays
greater than any instructions inserted at the end of MBB.

llvm-svn: 118747
2010-11-11 00:19:20 +00:00
Jakob Stoklund Olesen
3eb4a7b12d Delete unused function.
llvm-svn: 118743
2010-11-10 23:56:02 +00:00
Chris Lattner
ee8dea6453 Rename alignof -> alignOf to avoid irritating C++'0x compilers,
PR8423, patch by nobled.

llvm-svn: 117774
2010-10-30 05:14:01 +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
Jakob Stoklund Olesen
af7994784c Remove SlotIndex::PHI_BIT. It is no longer used by anything.
llvm-svn: 114779
2010-09-25 00:45:18 +00:00
Jakob Stoklund Olesen
794b5e00d7 Terminator gaps were unused. Might as well delete them.
llvm-svn: 114776
2010-09-24 23:58:56 +00:00
Jakob Stoklund Olesen
ccf528b792 Fix a FIXME. The SlotIndex::Slot enum should be private.
llvm-svn: 110826
2010-08-11 16:50:17 +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
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
67f0ebc5c6 Added a support for inserting new MBBs into the numbering.
Unlike insertMachineInstrInMaps this does not guarantee live intervals will
remain correct. The caller will need to manually update intervals to account
for the changes made to the CFG.

llvm-svn: 107958
2010-07-09 09:19:23 +00:00
Jakob Stoklund Olesen
ab1145ea8e Handle unindexed instructions in SlotIndices.
SlotIndexes::insertMachineInstrInMaps would crash when trying to insert an
instruction imediately after an unmapped debug value.

llvm-svn: 107504
2010-07-02 19:54:45 +00:00
Chris Lattner
0768c834fe remove some unneeded errorhandling stuff.
llvm-svn: 100703
2010-04-07 22:44:07 +00:00
Chris Lattner
844634a807 include densemap.h explicitly and rearrange #includes.
llvm-svn: 100216
2010-04-02 20:20:04 +00:00
Lang Hames
91b4cae53c Changed the definition of an "invalid" slot to include the empty & tombstone values, but not zero.
llvm-svn: 95631
2010-02-09 00:41:23 +00:00
Lang Hames
64d9eb0c06 Changed slot index ranges for MachineBasicBlocks to be exclusive of endpoint.
This fixes an in-place update bug where code inserted at the end of basic blocks may not be covered by existing intervals which were live across the entire block. It is also consistent with the way ranges are specified for live intervals.

llvm-svn: 91859
2009-12-22 00:11:50 +00:00
Lang Hames
cd218ab335 Fixed use of phi param in SlotIndex constructors.
llvm-svn: 91790
2009-12-19 23:32:32 +00:00
Chris Lattner
521f59a9f5 Lang verified that SlotIndex is "pod like" even though it isn't a pod.
llvm-svn: 91423
2009-12-15 07:27:58 +00:00
Chris Lattner
587962c667 Remove isPod() from DenseMapInfo, splitting it out to its own
isPodLike type trait.  This is a generally useful type trait for
more than just DenseMap, and we really care about whether something
acts like a pod, not whether it really is a pod.

llvm-svn: 91421
2009-12-15 07:26:43 +00:00
Lang Hames
2e0183a8a6 Fixed call to wrong constructor.
llvm-svn: 89059
2009-11-17 07:19:50 +00:00
Lang Hames
8b2d2c7537 Added an API to the SlotIndexes pass to allow new instructions to be inserted into the numbering.
PreAllocSplitting is now using this API to insert code.

llvm-svn: 88725
2009-11-14 00:02:51 +00:00
Lang Hames
3126c532b2 Moved some ManagedStatics out of the SlotIndexes header.
llvm-svn: 86446
2009-11-08 08:49:59 +00:00
Daniel Dunbar
14465c444c Fix class -> struct tag.
llvm-svn: 86416
2009-11-07 23:21:30 +00:00
Lang Hames
b5bff25ba7 Update some globals to use ManagedStatic.
llvm-svn: 86342
2009-11-07 05:50:28 +00:00
Lang Hames
aa433cb422 Tidied some ugliness in the SlotIndex default constructor.
llvm-svn: 86097
2009-11-05 01:18:31 +00:00
Lang Hames
f53fc0aa85 Removed an assert which was causing significant slowdowns in debug builds.
This assert was very conservative to begin with (the error condition is well
covered by tests elsewhere in the code) so we won't miss much by removing it.

llvm-svn: 86088
2009-11-05 00:52:28 +00:00
Lang Hames
2b16464904 Handle empty/tombstone keys for LiveIndex more cleanly. Check for index sanity when constructing index list entries.
llvm-svn: 86049
2009-11-04 21:24:15 +00:00
Lang Hames
c42888e42a Another spurious friend declaration removed.
llvm-svn: 85997
2009-11-04 01:52:40 +00:00
Lang Hames
b63bef3da7 Removed an unnecessary friend declaration and some crufty comments from IndexListEntry.
llvm-svn: 85995
2009-11-04 01:34:22 +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