aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* Delete leftover data members.Jakob Stoklund Olesen2011-04-041-4/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128820 91177308-0d34-0410-b5e6-96231b3b80d8
* Use InterferenceCache in RegAllocGreedy.Jakob Stoklund Olesen2011-04-021-94/+46
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128765 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an InterferenceCache class for caching per-block interference ranges.Jakob Stoklund Olesen2011-04-024-1/+300
| | | | | | | | When the greedy register allocator is splitting multiple global live ranges, it tends to look at the same interference data many times. The InterferenceCache class caches queries for unaltered LiveIntervalUnions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128764 91177308-0d34-0410-b5e6-96231b3b80d8
* Use basic block numbers as indexes when mapping slot index ranges.Jakob Stoklund Olesen2011-04-021-11/+9
| | | | | | This is more compact and faster than using DenseMap. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128763 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a RemoveFromWorklist method to DCI. This is needed to do some complicatedCameron Zwarich2011-04-021-0/+4
| | | | | | | | transformations in target-specific DAG combines without causing DAGCombiner to delete the same node twice. If you know of a better way to avoid this (see my next patch for an example), please let me know. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128758 91177308-0d34-0410-b5e6-96231b3b80d8
* Add comments.Evan Cheng2011-04-011-2/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128730 91177308-0d34-0410-b5e6-96231b3b80d8
* Assign node order numbers to results of call instruction lowering. This ↵Evan Cheng2011-04-011-4/+8
| | | | | | should improve src line debug info when sdisel is used. rdar://9199118 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128728 91177308-0d34-0410-b5e6-96231b3b80d8
* Issue libcalls __udivmod*i4 / __divmod*i4 for div / rem pairs.Evan Cheng2011-04-012-19/+154
| | | | | | | rdar://8911343 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128696 91177308-0d34-0410-b5e6-96231b3b80d8
* The basic register allocator must also use the inline spiller.Jakob Stoklund Olesen2011-03-311-1/+1
| | | | | | | It is using a trivial rewriter that doesn't know how to insert spill code requested by the standard spiller. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128688 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't completely eliminate identity copies that also modify super register ↵Jakob Stoklund Olesen2011-03-311-6/+12
| | | | | | | | | liveness. Turn them into noop KILL instructions instead. This lets the scavenger know when super-registers are killed and defined. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128645 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow kill flags on two-address instructions. They are harmless.Jakob Stoklund Olesen2011-03-311-6/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128643 91177308-0d34-0410-b5e6-96231b3b80d8
* Mark all uses as <undef> when joining a copy.Jakob Stoklund Olesen2011-03-313-8/+20
| | | | | | | | | | | | This way, shrinkToUses() will ignore the instruction that is about to be deleted, and we avoid leaving invalid live ranges that SplitKit doesn't like. Fix a misunderstanding in MachineVerifier about <def,undef> operands. The <undef> flag is valid on def operands where it has the same meaning as <undef> on a use operand. It only applies to sub-register defines which also read the full register. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128642 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dead code.Devang Patel2011-03-311-5/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128639 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bug found by valgrind.Jakob Stoklund Olesen2011-03-311-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128634 91177308-0d34-0410-b5e6-96231b3b80d8
* lib/CodeGen/LiveIntervalAnalysis.cpp: [PR9590] Don't use ↵NAKAMURA Takumi2011-03-311-1/+3
| | | | | | | | | | std::pow(float,float) here. We don't expect the real "powf()" on some hosts (and powf() would be available on other hosts). For consistency, std::pow(double,double) may be called instead. Or, precision issue might attack us, to see unstable regalloc and stack coloring. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128629 91177308-0d34-0410-b5e6-96231b3b80d8
* Pick a conservative register class when creating a small live range for remat.Jakob Stoklund Olesen2011-03-311-1/+1
| | | | | | | | | | | | The rematerialized instruction may require a more constrained register class than the register being spilled. In the test case, the spilled register has been inflated to the DPR register class, but we are rematerializing a load of the ssub_0 sub-register which only exists for DPR_VFP2 registers. The register class is reinflated after spilling, so the conservative choice is only temporary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128610 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix evil VirtRegRewriter bug.Jakob Stoklund Olesen2011-03-301-0/+28
| | | | | | | | | | | | | | | The rewriter can keep track of multiple stack slots in the same register if they happen to have the same value. When an instruction modifies a stack slot by defining a register that is mapped to a stack slot, other stack slots in that register are no longer valid. This is a very rare problem, and I don't have a simple test case. I get the impression that VirtRegRewriter knows it is about to be deleted, inventing a last opaque problem. <rdar://problem/9204040> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128562 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach VirtRegRewriter about the new virtual register numbers. No functional ↵Jakob Stoklund Olesen2011-03-301-10/+11
| | | | | | change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128561 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove PHINode::reserveOperandSpace(). Instead, add a parameter toJay Foad2011-03-301-3/+3
| | | | | | PHINode::Create() giving the (known or expected) number of operands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128537 91177308-0d34-0410-b5e6-96231b3b80d8
* (Almost) always call reserveOperandSpace() on newly created PHINodes.Jay Foad2011-03-301-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128535 91177308-0d34-0410-b5e6-96231b3b80d8
* Treat clones the same as their origin.Jakob Stoklund Olesen2011-03-303-6/+29
| | | | | | | | | | | | When DCE clones a live range because it separates into connected components, make sure that the clones enter the same register allocator stage as the register they were cloned from. For instance, clones may be split even when they where created during spilling. Other registers created during spilling are not candidates for splitting or even (re-)spilling. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128524 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy up. 80 columns and trailing whitespace.Jim Grosbach2011-03-291-145/+146
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128504 91177308-0d34-0410-b5e6-96231b3b80d8
* Recompute register class and hint for registers created during spilling.Jakob Stoklund Olesen2011-03-296-60/+87
| | | | | | The spill weight is not recomputed for an unspillable register - it stays infinite. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128490 91177308-0d34-0410-b5e6-96231b3b80d8
* Remember to use the correct register when rematerializing for snippets.Jakob Stoklund Olesen2011-03-292-6/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128469 91177308-0d34-0410-b5e6-96231b3b80d8
* Run dead code elimination immediately after rematerialization.Jakob Stoklund Olesen2011-03-291-9/+24
| | | | | | | This may eliminate some uses of the spilled registers, and we don't want to insert reloads for that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128468 91177308-0d34-0410-b5e6-96231b3b80d8
* Inline check that's used only once.Bill Wendling2011-03-291-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128465 91177308-0d34-0410-b5e6-96231b3b80d8
* Rework the logic (and removing the bad check for an unreachable block) so thatBill Wendling2011-03-291-8/+5
| | | | | | | | the FailBB dominator is correctly calculated. Believe it or not, there isn't a functionality change here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128455 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't try to add stack protector logic to a dead basic block. It messes upBill Wendling2011-03-291-1/+2
| | | | | | | dominator information. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128452 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle the special case when all uses follow the last split point.Jakob Stoklund Olesen2011-03-291-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128450 91177308-0d34-0410-b5e6-96231b3b80d8
* Properly enable rematerialization when spilling after live range splitting.Jakob Stoklund Olesen2011-03-293-71/+129
| | | | | | | | The instruction to be rematerialized may not be the one defining the register that is being spilled. The traceSiblingValue() function sees through sibling copies to find the remat candidate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128449 91177308-0d34-0410-b5e6-96231b3b80d8
* In some cases, the "fail BB dominator" may be null after the BB was split (andBill Wendling2011-03-281-1/+2
| | | | | | | | becomes reachable when before it wasn't). Check to make sure that it's not null before trying to use it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128434 91177308-0d34-0410-b5e6-96231b3b80d8
* Integrated-As: Add support for setting the AllowTemporaryLabels flag viaDaniel Dunbar2011-03-281-0/+6
| | | | | | integrated-as. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128431 91177308-0d34-0410-b5e6-96231b3b80d8
* Amend debug output.Jakob Stoklund Olesen2011-03-271-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128398 91177308-0d34-0410-b5e6-96231b3b80d8
* Drop interference reassignment in favor of eviction.Jakob Stoklund Olesen2011-03-271-132/+15
| | | | | | | | | The reassignment phase was able to move interference with a higher spill weight, but it didn't happen very often and it was fairly expensive. The existing interference eviction picks up the slack. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128397 91177308-0d34-0410-b5e6-96231b3b80d8
* Use individual register classes when spilling snippets.Jakob Stoklund Olesen2011-03-262-24/+28
| | | | | | | | | The main register class may have been inflated by live range splitting, so that register class is not necessarily valid for the snippet instructions. Use the original register class for the stack slot interval. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128351 91177308-0d34-0410-b5e6-96231b3b80d8
* Turn SelectionDAGBuilder::GetRegistersForValue into a local function.Benjamin Kramer2011-03-262-19/+16
| | | | | | | | It couldn't be used outside of the file because SDISelAsmOperandInfo is local to SelectionDAGBuilder.cpp. Making it a static function avoids a weird linkage dance. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128342 91177308-0d34-0410-b5e6-96231b3b80d8
* Collect and coalesce DBG_VALUE instructions before emitting the function.Jakob Stoklund Olesen2011-03-262-110/+187
| | | | | | | | | | | Correctly terminate the range of register DBG_VALUEs when the register is clobbered or when the basic block ends. The code is now ready to deal with variables that are sometimes in a register and sometimes on the stack. We just need to teach emitDebugLoc to say 'stack slot'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128327 91177308-0d34-0410-b5e6-96231b3b80d8
* Emit less labels for debug info and stop emitting .loc directives for ↵Jakob Stoklund Olesen2011-03-252-49/+32
| | | | | | | | | | | | DBG_VALUEs. The .dot directives don't need labels, that is a leftover from when we created line number info manually. Instructions following a DBG_VALUE can share its label since the DBG_VALUE doesn't produce any code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128284 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix for -pre-RA-sched=source.Andrew Trick2011-03-251-0/+2
| | | | | | | | Yet another case of unchecked NULL node (for physreg copy). May fix PR9509. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128266 91177308-0d34-0410-b5e6-96231b3b80d8
* No functionality change. Fix up some whitespace and switch out "" for '' whenNick Lewycky2011-03-251-3/+3
| | | | | | | printing a single character. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128256 91177308-0d34-0410-b5e6-96231b3b80d8
* Ignore special ARM allocation hints for unexpected register classes.Jakob Stoklund Olesen2011-03-251-0/+1
| | | | | | | | | Add an assertion to linear scan to prevent it from allocating registers outside the register class. <rdar://problem/9183021> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128254 91177308-0d34-0410-b5e6-96231b3b80d8
* Keep track of directory namd and fIx regression caused by Rafael's patch ↵Devang Patel2011-03-242-12/+29
| | | | | | | | | r119613. A better approach would be to move source id handling inside MC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128233 91177308-0d34-0410-b5e6-96231b3b80d8
* PR9535: add support for splitting and scalarizing vector ISD::FP_ROUND.Eli Friedman2011-03-232-60/+30
| | | | | | | | Also cleaning up some duplicated code while I'm here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128176 91177308-0d34-0410-b5e6-96231b3b80d8
* Ensure that def-side physreg copies are scheduled above any other usesAndrew Trick2011-03-231-0/+9
| | | | | | | | | | so the scheduler can't create new interferences on the copies themselves. Prior to this fix the scheduler could get stuck in a loop creating copies. Fixes PR9509. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128164 91177308-0d34-0410-b5e6-96231b3b80d8
* whitespaceAndrew Trick2011-03-231-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128163 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't coalesce identical DBG_VALUE instructions prematurely.Jakob Stoklund Olesen2011-03-231-3/+1
| | | | | | | | Each of these instructions may have a RegsClobberInsn entry that can't be ignored. Consecutive ranges are coalesced later when DwarfDebug::emitDebugLoc merges entries. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128155 91177308-0d34-0410-b5e6-96231b3b80d8
* Notify the delegate before removing dead values from a live interval.Jakob Stoklund Olesen2011-03-231-0/+2
| | | | | | The register allocator needs to know when the range shrinks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128145 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow the allocation of empty live ranges that have uses.Jakob Stoklund Olesen2011-03-231-1/+8
| | | | | | Empty ranges may represent undef values. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128144 91177308-0d34-0410-b5e6-96231b3b80d8
* Dump the register map before rewriting.Jakob Stoklund Olesen2011-03-231-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128143 91177308-0d34-0410-b5e6-96231b3b80d8
* Added block number and name to isel debug output.Andrew Trick2011-03-231-12/+25
| | | | | | | | | I'm tired of doing this manually for each checkout. If anyone knows a better way debug isel for non-trivial tests feel free to revert and let me know how to do it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128132 91177308-0d34-0410-b5e6-96231b3b80d8