34 Commits

Author SHA1 Message Date
Owen Anderson
436db42a3c Clean up StrongPHIElimination a bit, and add some more comments to the internal structures. There's
still more work to do on this front.

llvm-svn: 45783
2008-01-09 22:40:54 +00:00
Owen Anderson
4de0c3978d StrongPHIElim: Now with even fewer trivial bugs!
llvm-svn: 45775
2008-01-09 10:41:39 +00:00
Owen Anderson
77c3fe441b Fix an infinite recursion bug in InsertCopies.
llvm-svn: 45774
2008-01-09 10:32:30 +00:00
Owen Anderson
e0fd9bd35a Fix some simple bugs. StrongPHIElimination now does not crash on 164.gzip.
llvm-svn: 45773
2008-01-09 06:19:05 +00:00
Owen Anderson
1b0d5c747e Rename registers that do not need copies.
llvm-svn: 45759
2008-01-08 21:54:52 +00:00
Owen Anderson
812e1ea7cf Actually insert copies now!
llvm-svn: 45738
2008-01-08 05:16:15 +00:00
Owen Anderson
47299489ec Oops, missed one.
llvm-svn: 45719
2008-01-07 21:32:09 +00:00
Owen Anderson
bbc6352d1f Make some predicates static.
llvm-svn: 45718
2008-01-07 21:30:40 +00:00
Chris Lattner
a10fff51d9 Rename SSARegMap -> MachineRegisterInfo in keeping with the idea
that "machine" classes are used to represent the current state of
the code being compiled.  Given this expanded name, we can start 
moving other stuff into it.  For now, move the UsedPhysRegs and
LiveIn/LoveOuts vectors from MachineFunction into it.

Update all the clients to match.

This also reduces some needless #includes, such as MachineModuleInfo
from MachineFunction.

llvm-svn: 45467
2007-12-31 04:13:23 +00:00
Chris Lattner
a5bb370aa4 Add new shorter predicates for testing machine operands for various types:
e.g. MO.isMBB() instead of MO.isMachineBasicBlock().  I don't plan on 
switching everything over, so new clients should just start using the 
shorter names.

Remove old long accessors, switching everything over to use the short
accessor: getMachineBasicBlock() -> getMBB(), 
getConstantPoolIndex() -> getIndex(), setMachineBasicBlock -> setMBB(), etc.

llvm-svn: 45464
2007-12-30 23:10:15 +00:00
Chris Lattner
f3ebc3f3d2 Remove attribution from file headers, per discussion on llvmdev.
llvm-svn: 45418
2007-12-29 20:36:04 +00:00
Owen Anderson
bccb8c432d Flesh out the Briggs implementation a little bit more, fix a few FIXMEs.
llvm-svn: 45347
2007-12-24 22:12:23 +00:00
Owen Anderson
e110199916 Sketch out an implementation of Briggs' copy placement algorithm.
llvm-svn: 45334
2007-12-23 15:37:26 +00:00
Owen Anderson
5a4c05d047 Note what still needs doing.
llvm-svn: 45310
2007-12-22 04:59:10 +00:00
Owen Anderson
4534100765 Remove critical edge breaking. It won't be necessary as long as we are very careful when inserting copies.
llvm-svn: 45309
2007-12-22 04:50:11 +00:00
Owen Anderson
7b8a741189 Break local interferences in StrongPHIElimination. One step closer...
llvm-svn: 45070
2007-12-16 05:44:27 +00:00
Owen Anderson
ccb3981256 A few more comments.
llvm-svn: 45069
2007-12-16 04:07:23 +00:00
Owen Anderson
53b677e4e8 Add register pairs to the list to check for local interferences.
llvm-svn: 44987
2007-12-13 05:53:03 +00:00
Owen Anderson
1f93edd08a Remove ugly and horrible code. It's not necessary for correctness, and can be added back later if it causes code quality issues.
llvm-svn: 44986
2007-12-13 05:43:37 +00:00
Owen Anderson
499e5bffcf Forgot to remove a register from the PHI-union after I'd determined that it
interfered with other registers.  Seems like that might be a good thing to do. :-)

llvm-svn: 44902
2007-12-12 01:25:08 +00:00
Owen Anderson
f24dd1c1eb More progress on StrongPHIElimination. Now we actually USE the DomForest!
llvm-svn: 44877
2007-12-11 20:12:11 +00:00
Owen Anderson
ba61806ef1 A little more progress on StrongPHIElimination, now that I have a better sense of
how the CodeGen machinery works.

llvm-svn: 44786
2007-12-10 08:07:09 +00:00
Owen Anderson
d8167ab332 Run computeDomForest() on the set of registers that need to be tested for
interference.

llvm-svn: 44064
2007-11-13 20:13:24 +00:00
Owen Anderson
569ef71e44 Preserve LiveVariables when doing critical edge splitting.
llvm-svn: 44063
2007-11-13 20:04:45 +00:00
Owen Anderson
c520c4b325 Break critical edges coming into blocks with PHI nodes.
llvm-svn: 44019
2007-11-12 17:27:27 +00:00
Owen Anderson
a1cd45213d As Chris and Evan pointed out, BreakCriticalMachineEdges doesn't really need
to be a pass of its own.  Instead, move it out into a helper method.

llvm-svn: 44002
2007-11-12 01:05:09 +00:00
Owen Anderson
bfbc12973d Take another stab at getting isLiveIn() and isLiveOut() right.
llvm-svn: 43869
2007-11-08 01:32:45 +00:00
Owen Anderson
c6a5387d09 Add some more of StrongPHIElim.
llvm-svn: 43805
2007-11-07 05:17:15 +00:00
Owen Anderson
d378cea030 Add a few comments.
llvm-svn: 43755
2007-11-06 05:26:02 +00:00
Owen Anderson
eb964eb2c8 DomForest is a forest of registers, not instructions.
llvm-svn: 43754
2007-11-06 05:22:43 +00:00
Owen Anderson
a9057f0b97 StrongPHIElimination requires LiveVariables.
llvm-svn: 43751
2007-11-06 04:49:43 +00:00
Owen Anderson
eea82746b3 Another step of stronger PHI elimination down.
llvm-svn: 43684
2007-11-04 22:33:26 +00:00
Duncan Sands
21ca939683 Add a newline at the end of the file.
llvm-svn: 43550
2007-10-31 08:49:24 +00:00
Owen Anderson
0b59fa0605 Add the skeleton of a better PHI elimination pass.
llvm-svn: 43542
2007-10-31 03:37:57 +00:00