summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Use the LiveBLocks array for SplitEditor::splitSingleBlocks() as well.Jakob Stoklund Olesen2011-02-092-44/+47
| | | | | | | This fixes a bug where splitSingleBlocks() could split a live range after a terminator instruction. llvm-svn: 125237
* Typo.Mikhail Glushenkov2011-02-091-1/+1
| | | | llvm-svn: 125232
* Move calcLiveBlockInfo() and the BlockInfo struct into SplitAnalysis.Jakob Stoklund Olesen2011-02-094-144/+142
| | | | | | No functional changes intended. llvm-svn: 125231
* Ignore <undef> uses when analyzing and rewriting.Jakob Stoklund Olesen2011-02-091-2/+14
| | | | llvm-svn: 125226
* Assert on bad jump tables.Jakob Stoklund Olesen2011-02-091-0/+1
| | | | llvm-svn: 125225
* Add tags to live interval unions to avoid using stale queries.Jakob Stoklund Olesen2011-02-092-2/+15
| | | | | | | The tag is updated whenever the live interval union is changed, and it is tested before using cached information. llvm-svn: 125224
* Evict a lighter single interference before attempting to split a live range.Jakob Stoklund Olesen2011-02-093-36/+64
| | | | | | | | | | | | | | Registers are not allocated strictly in spill weight order when live range splitting and spilling has created new shorter intervals with higher spill weights. When one of the new heavy intervals conflicts with a single lighter interval, simply evict the old interval instead of trying to split the heavy one. The lighter interval is a better candidate for splitting, it has a smaller use density. llvm-svn: 125151
* Set an allocation hint when rematting before a COPY.Jakob Stoklund Olesen2011-02-091-0/+4
| | | | | | This almost guarantees that the COPY will be coalesced. llvm-svn: 125140
* Fix one more case of splitting after the last split point.Jakob Stoklund Olesen2011-02-081-8/+10
| | | | llvm-svn: 125137
* Reorganize interference code to check LastSplitPoint first.Jakob Stoklund Olesen2011-02-081-29/+43
| | | | | | | The last split point can be anywhere in the block, so it interferes with the strictly monotonic requirements of advanceTo(). llvm-svn: 125132
* Also handle the situation where an indirect branch is the first (and last)Jakob Stoklund Olesen2011-02-081-6/+8
| | | | | | instruction in a basic block. llvm-svn: 125116
* Add LiveIntervals::addKillFlags() to recompute kill flags after register ↵Jakob Stoklund Olesen2011-02-082-0/+24
| | | | | | | | | allocation. This is a lot easier than trying to get kill flags right during live range splitting and rematerialization. llvm-svn: 125113
* Trim debug spewJakob Stoklund Olesen2011-02-081-1/+0
| | | | llvm-svn: 125109
* Avoid folding a load instruction into an instruction that redefines the ↵Jakob Stoklund Olesen2011-02-081-1/+5
| | | | | | | | register. The target hook doesn't know how to do that. (Neither do I). llvm-svn: 125108
* Add SplitEditor::overlapIntv() to create small ranges where both registers ↵Jakob Stoklund Olesen2011-02-083-2/+53
| | | | | | | | | | | | | | | | | | | | | | are live. If a live range is used by a terminator instruction, and that live range needs to leave the block on the stack or in a different register, it can be necessary to have both sides of the split live at the terminator instruction. Example: %vreg2 = COPY %vreg1 JMP %vreg1 Becomes after spilling %vreg2: SPILL %vreg1 JMP %vreg1 The spill doesn't kill the register as is normally the case. llvm-svn: 125102
* Add assertion.Jakob Stoklund Olesen2011-02-081-3/+4
| | | | llvm-svn: 125101
* Fix PostRA antidependence breaker.Andrew Trick2011-02-082-11/+49
| | | | | | | | Avoid using the same register for two def operands or and earlyclobber def and use operand. This fixes PR8986 and improves on the prior fix for rdar://problem/8959122. llvm-svn: 125089
* Add LiveIntervals::shrinkToUses().Jakob Stoklund Olesen2011-02-083-23/+135
| | | | | | | | After uses of a live range are removed, recompute the live range to only cover the remaining uses. This is necessary after rematerializing the value before some (but not all) uses. llvm-svn: 125058
* Remove comment about an argument that was removed couple of years ago.Devang Patel2011-02-071-1/+0
| | | | llvm-svn: 125054
* Fix an anti-dep breaker corner case.Andrew Trick2011-02-051-1/+0
| | | | | | | | | | | | | <rdar://problem/8959122> illegal register operands for UMULL instruction in cfrac nightly test I'm stil working on a unit test, but the case is: rx = movcc rx, r3 r2 = ldr r2, r3 = umull r2, r2 The anti-dep breaker should not convert this into an illegal instruction: r2, r2 = umull llvm-svn: 124932
* Be more strict about the first/last interference-free use.Jakob Stoklund Olesen2011-02-051-4/+25
| | | | | | If the interference overlaps the instruction, we cannot separate it. llvm-svn: 124918
* Add assertions to verify that the new interval is clear of the interference.Jakob Stoklund Olesen2011-02-051-7/+14
| | | | | | | If these inequalities don't hold, we are creating a live range split that won't allocate. llvm-svn: 124917
* Apparently, it is possible for a block with a landing pad successor to have ↵Jakob Stoklund Olesen2011-02-041-1/+1
| | | | | | | | | no calls. In that case we simply ignore the landing pad and split live ranges before the first terminator. llvm-svn: 124907
* Merge .debug_loc entries whenever possible to reduce debug_loc size.Devang Patel2011-02-042-15/+32
| | | | llvm-svn: 124904
* Mark that the return is using EAX so that we don't use it for some otherNick Lewycky2011-02-041-0/+21
| | | | | | purpose. Fixes PR9080! llvm-svn: 124903
* Be more accurate about live range splitting at the end of blocks.Jakob Stoklund Olesen2011-02-041-4/+17
| | | | | | | | | | | If interference reaches the last split point, it is effectively live out and should be marked as 'MustSpill'. This can make a difference when the terminator uses a register. There is no way that register can be reused in the outgoing CFG bundle, even if it isn't live out. llvm-svn: 124900
* Add LiveIntervals::getLastSplitPoint().Jakob Stoklund Olesen2011-02-043-1/+33
| | | | | | | | A live range cannot be split everywhere in a basic block. A split must go before the first terminator, and if the variable is live into a landing pad, the split must happen before the call that can throw. llvm-svn: 124894
* Verify that one of the ranges produced by region splitting is allocatable.Jakob Stoklund Olesen2011-02-041-1/+15
| | | | | | | We should not be attempting a region split if it won't lead to at least one directly allocatable interval. That could cause infinite splitting loops. llvm-svn: 124893
* Introducing a new method of tracking register pressure. We can'tAndrew Trick2011-02-044-116/+169
| | | | | | | | | | | | | | | precisely track pressure on a selection DAG, but we can at least keep it balanced. This design accounts for various interesting aspects of selection DAGS: register and subregister copies, glued nodes, dead nodes, unused registers, etc. Added SUnit::NumRegDefsLeft and ScheduleDAGSDNodes::RegDefIter. Note: I disabled PrescheduleNodesWithMultipleUses when register pressure is enabled, based on no evidence other than I don't think it makes sense to have both enabled. llvm-svn: 124853
* DebugLoc associated with a machine instruction is used to emit location ↵Devang Patel2011-02-041-20/+29
| | | | | | entries. DebugLoc associated with a DBG_VALUE is used to identify lexical scope of the variable. After register allocation, while inserting DBG_VALUE remember original debug location for the first instruction and reuse it, otherwise dwarf writer may be mislead in identifying the variable's scope. llvm-svn: 124845
* Update comments.Evan Cheng2011-02-041-2/+3
| | | | llvm-svn: 124843
* Skip unused values.Jakob Stoklund Olesen2011-02-041-1/+3
| | | | llvm-svn: 124842
* Also compute interference intervals for blocks with no uses.Jakob Stoklund Olesen2011-02-041-3/+1
| | | | | | | | When the live range is live through a block that doesn't use the register, but that has interference, region splitting wants to split at the top and bottom of the basic block. llvm-svn: 124839
* Verify kill flags conservatively.Jakob Stoklund Olesen2011-02-041-18/+5
| | | | | | | | | | Allow a live range to end with a kill flag, but don't allow a kill flag that doesn't end the live range. This makes the machine code verifier more useful during register allocation when kill flag computation is deferred. llvm-svn: 124838
* whitespaceAndrew Trick2011-02-031-18/+18
| | | | llvm-svn: 124827
* Ensure that the computed interference intervals actually overlap their basic ↵Jakob Stoklund Olesen2011-02-031-3/+12
| | | | | | blocks. llvm-svn: 124815
* Tweak debug output from SlotIndexes.Jakob Stoklund Olesen2011-02-031-1/+5
| | | | llvm-svn: 124814
* Add debug output and asserts to the phi-connecting code.Jakob Stoklund Olesen2011-02-031-2/+13
| | | | llvm-svn: 124813
* Fix coloring bug when mapping values in the middle of a live-through block.Jakob Stoklund Olesen2011-02-031-7/+7
| | | | | | | | | | If the found value is not live-through the block, we should only add liveness up to the requested slot index. When the value is live-through, the whole block should be colored. Bug found by SSA verification in the machine code verifier. llvm-svn: 124812
* Return live range end points from SplitEditor::enter*/leave*.Jakob Stoklund Olesen2011-02-033-62/+48
| | | | | | | These end points come from the inserted copies, and can be passed directly to useIntv. This simplifies the coloring code. llvm-svn: 124799
* Silence an MSVC warningJakob Stoklund Olesen2011-02-031-1/+1
| | | | llvm-svn: 124798
* Reapply this.Eric Christopher2011-02-034-224/+181
| | | | llvm-svn: 124779
* Temporarily revert 124765 in an attempt to find the cycle breaking bootstrap.Eric Christopher2011-02-034-181/+224
| | | | llvm-svn: 124778
* Defer SplitKit value mapping until all defs are available.Jakob Stoklund Olesen2011-02-034-224/+181
| | | | | | | | | | | | | | | | | | | The greedy register allocator revealed some problems with the value mapping in SplitKit. We would sometimes start mapping values before all defs were known, and that could change a value from a simple 1-1 mapping to a multi-def mapping that requires ssa update. The new approach collects all defs and register assignments first without filling in any live intervals. Only when finish() is called, do we compute liveness and mapped values. At this time we know with certainty which values map to multiple values in a split range. This also has the advantage that we can compute live ranges based on the remaining uses after rematerializing at split points. The current implementation has many opportunities for compile time optimization. llvm-svn: 124765
* Add support to describe template value parameter in debug info.Devang Patel2011-02-022-0/+25
| | | | llvm-svn: 124755
* Add support to describe template parameter type in debug info.Devang Patel2011-02-022-0/+32
| | | | llvm-svn: 124752
* Given a pair of floating point load and store, if there are no other uses ofEvan Cheng2011-02-021-0/+65
| | | | | | | | | | | | | | | | | | | the load, then it may be legal to transform the load and store to integer load and store of the same width. This is done if the target specified the transformation as profitable. e.g. On arm, this can transform: vldr.32 s0, [] vstr.32 s0, [] to ldr r12, [] str r12, [] rdar://8944252 llvm-svn: 124708
* Take Bill Wendling's suggestion for structuring a couple of asserts.Matt Beaumont-Gay2011-02-011-6/+6
| | | | llvm-svn: 124688
* Keep track of incoming argument's location while emitting LiveIns.Devang Patel2011-01-314-4/+22
| | | | llvm-svn: 124611
* Fix bug where ReduceLoadWidth was creating illegal ZEXTLOAD instructions.Richard Osborne2011-01-311-2/+2
| | | | llvm-svn: 124587
OpenPOWER on IntegriCloud