aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/StrongPHIElimination.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use empty() instead of begin() == end().Dan Gohman2008-08-141-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54780 91177308-0d34-0410-b5e6-96231b3b80d8
* Get rid of unused variable.Owen Anderson2008-08-131-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54742 91177308-0d34-0410-b5e6-96231b3b80d8
* 1) Merge entire live intervals instead of parts of them.Owen Anderson2008-08-131-62/+36
| | | | | | | 2) Conditionalize temporary insertion if we don't need it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54741 91177308-0d34-0410-b5e6-96231b3b80d8
* Do a dominator walk when scheduling copies, rather than a DFS on the CFG. ↵Owen Anderson2008-08-071-14/+44
| | | | | | | | | Also, fix a few problems when creating live intervals for temporaries created by phi elimination. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54483 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct handle cases where two phis are coalesced together, and correct ↵Owen Anderson2008-08-061-6/+39
| | | | | | | | | break up the case where two different phis want to coalesce with the same vreg. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54426 91177308-0d34-0410-b5e6-96231b3b80d8
* We don't need to try to coalesce input vregs that are the same as the output ↵Owen Anderson2008-08-061-0/+7
| | | | | | vreg. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54422 91177308-0d34-0410-b5e6-96231b3b80d8
* Only trim a live interval if the register is not used after the PHI node.Owen Anderson2008-08-061-2/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54421 91177308-0d34-0410-b5e6-96231b3b80d8
* Oops, we were already checking for dead phis. Handle this the proper way, then.Owen Anderson2008-08-051-22/+19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54371 91177308-0d34-0410-b5e6-96231b3b80d8
* We don't need to update live intervals for dead PHIs.Owen Anderson2008-08-051-29/+32
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54369 91177308-0d34-0410-b5e6-96231b3b80d8
* Use existing LiveInterval methods to simplify live interval merging. Thanks ↵Owen Anderson2008-07-301-31/+32
| | | | | | to Evan for pointing these out. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54225 91177308-0d34-0410-b5e6-96231b3b80d8
* When merging live intervals, we also need to merge in any live ranges that ↵Owen Anderson2008-07-301-13/+42
| | | | | | | | | are inputs to two-address instructions that themselves define a range we already care about. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54185 91177308-0d34-0410-b5e6-96231b3b80d8
* When merging a PHI operand's live interval into the PHI's live interval, we ↵Owen Anderson2008-07-291-9/+17
| | | | | | | | | need to merge over all liveranges in the operand's interval that share the relevant value number, not just the range that immediately precedes the PHI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54174 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the issues originally addressed in r54070. After thinking about it some ↵Owen Anderson2008-07-251-2/+19
| | | | | | | | | | | more, I realized that the right thing to do is to have StrongPHIElimination use its knowledge of the PHIs before they're erased to update the intervals appropriate. This is both simpler and more accurate than the alternative, which was having LIA figure it out when it renumbered things, plus it's just the right thing to do! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54077 91177308-0d34-0410-b5e6-96231b3b80d8
* In order to avoid reprocessing a register more than once, we need to add itOwen Anderson2008-07-251-1/+1
| | | | | | | to the handled set so it will get filtered out in future iterations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54065 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove live interval entries for an interval if we're eliminating its only VN.Owen Anderson2008-07-251-1/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54062 91177308-0d34-0410-b5e6-96231b3b80d8
* Store the predecessor MBB in the PHIUnion, rather than an index, since the ↵Owen Anderson2008-07-241-26/+28
| | | | | | indices will change after renumbering. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53985 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove debugging code.Owen Anderson2008-06-051-4/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52016 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the newly created helper on LiveIntervals.Owen Anderson2008-06-051-116/+21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52013 91177308-0d34-0410-b5e6-96231b3b80d8
* Correctly construct live intervals for the copies we inserted into the ↵Owen Anderson2008-06-041-1/+38
| | | | | | predecessors of a block containing a PHI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51950 91177308-0d34-0410-b5e6-96231b3b80d8
* We need to subtract one from this index because live ranges are open at the end.Owen Anderson2008-06-041-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51922 91177308-0d34-0410-b5e6-96231b3b80d8
* Preserve the register coallescer, and update live intervals more correctly ↵Owen Anderson2008-05-301-1/+4
| | | | | | by triggering a renumbering after phi elimination. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51780 91177308-0d34-0410-b5e6-96231b3b80d8
* Change class' public PassInfo variables to by initialized with theDan Gohman2008-05-131-1/+1
| | | | | | | | | | | | address of the PassInfo directly instead of calling getPassInfo. This eliminates a bunch of dynamic initializations of static data. Also, fold RegisterPassBase into PassInfo, make a bunch of its data members const, and rearrange some code to initialize data members in constructors instead of using setter member functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51022 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-131-4/+9
| | | | | | | | several things that were neither in an anonymous namespace nor static but not intended to be global. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51017 91177308-0d34-0410-b5e6-96231b3b80d8
* In some situations, we need to check for local interferences between the PHIOwen Anderson2008-04-021-2/+11
| | | | | | | node and its inputs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49070 91177308-0d34-0410-b5e6-96231b3b80d8
* Correctly mark a valno that was previous defined by a PHI node as having anOwen Anderson2008-04-021-4/+7
| | | | | | | unknown defining inst after PHI elimination. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49069 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't dereference MBB->end().Owen Anderson2008-04-011-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49043 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a major bug in the DFS calculation. Thanks for Christopher Lamb for ↵Owen Anderson2008-03-311-1/+1
| | | | | | pointing this out. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48973 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove some unneeded code for LiveInterval joining, and fix a bug in the Phi ↵Owen Anderson2008-03-291-58/+25
| | | | | | | | | elimination algorithm where we were accidentally reasoning about the source rather than the destination. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48936 91177308-0d34-0410-b5e6-96231b3b80d8
* Dead PHI instructions need to be handled specially.Owen Anderson2008-03-261-0/+22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48811 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove some debugging code.Owen Anderson2008-03-251-3/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48803 91177308-0d34-0410-b5e6-96231b3b80d8
* StrongPHIElimination doesn't support swapping live intervals like the ↵Owen Anderson2008-03-251-9/+6
| | | | | | coalescer does. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48802 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove #include<iostream>, which I was using for debugging.Owen Anderson2008-03-241-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48739 91177308-0d34-0410-b5e6-96231b3b80d8
* Be sure to remove intervals after we've joined them. Also, remove some ↵Owen Anderson2008-03-241-46/+18
| | | | | | | | | | duplicated code. With this pass, StrongPHIElim can compile very simple testcases correctly. There's still a ways to go before it's ready for prime time, though. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48719 91177308-0d34-0410-b5e6-96231b3b80d8
* A first attempt at updating live intervals, with code lifted fromOwen Anderson2008-03-171-4/+176
| | | | | | | | the coalescer. This doesn't really work, but gets us farther than before. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48446 91177308-0d34-0410-b5e6-96231b3b80d8
* We also need to collect the VN IDs for the PHI instructions for later updating.Owen Anderson2008-03-121-1/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48278 91177308-0d34-0410-b5e6-96231b3b80d8
* When we're determining what registers to coallesce, track the VNInfo IDs for ↵Owen Anderson2008-03-121-16/+32
| | | | | | | | | the definitions that feed the PHI instructions. We'll need these IDs in order to update LiveIntervals properly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48277 91177308-0d34-0410-b5e6-96231b3b80d8
* Move StrongPHIElimination after live interval analysis. This will make ↵Owen Anderson2008-03-101-36/+27
| | | | | | things happier down the road. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48138 91177308-0d34-0410-b5e6-96231b3b80d8
* some more spelling changesGabor Greif2008-03-061-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47996 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor code. Remove duplicated functions that basically do the same thing asEvan Cheng2008-03-051-4/+4
| | | | | | | findRegisterUseOperandIdx, findRegisterDefOperandIndx. Fix some naming inconsistencies. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47927 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an iterator invalidation issue.Owen Anderson2008-01-221-2/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46263 91177308-0d34-0410-b5e6-96231b3b80d8
* Clarify a deviation from the original algorithm.Owen Anderson2008-01-211-1/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46218 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve a few comments.Owen Anderson2008-01-211-1/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46217 91177308-0d34-0410-b5e6-96231b3b80d8
* Get rid of all uses of LiveVariables::VarInfo::DefInst in favor of the ↵Owen Anderson2008-01-101-58/+66
| | | | | | | | | equivalent API from MachineRegisterInfo. Once all clients are switched over, the former will be going away. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45805 91177308-0d34-0410-b5e6-96231b3b80d8
* Add more comments explaining the basics of how the decision of when to ↵Owen Anderson2008-01-101-7/+37
| | | | | | | | | rename and when to insert copies is made. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45799 91177308-0d34-0410-b5e6-96231b3b80d8
* Get rid of the isKillInst predicate. LiveVariables already provides this ↵Owen Anderson2008-01-101-14/+10
| | | | | | information. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45797 91177308-0d34-0410-b5e6-96231b3b80d8
* Copies need to be inserted before the first terminator, not at the end of ↵Owen Anderson2008-01-101-2/+2
| | | | | | the block. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45791 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up StrongPHIElimination a bit, and add some more comments to the ↵Owen Anderson2008-01-091-6/+46
| | | | | | | | | internal structures. There's still more work to do on this front. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45783 91177308-0d34-0410-b5e6-96231b3b80d8
* StrongPHIElim: Now with even fewer trivial bugs!Owen Anderson2008-01-091-2/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45775 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an infinite recursion bug in InsertCopies.Owen Anderson2008-01-091-4/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45774 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some simple bugs. StrongPHIElimination now does not crash on 164.gzip.Owen Anderson2008-01-091-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45773 91177308-0d34-0410-b5e6-96231b3b80d8