summaryrefslogtreecommitdiff
path: root/lib/CodeGen
Commit message (Collapse)AuthorAge
* 80-col fixups.Eric Christopher2010-12-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121356 91177308-0d34-0410-b5e6-96231b3b80d8
* IntervalMap iterators are heavyweight, so avoid copying them around and useJakob Stoklund Olesen2010-12-09
| | | | | | | | | | | references instead. Similarly, IntervalMap::begin() is almost as expensive as find(), so use find(x) instead of begin().advanceTo(x); This makes RegAllocBasic run another 5% faster. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121344 91177308-0d34-0410-b5e6-96231b3b80d8
* DW_FORM_data1 may not provide sufficient room for vtable index, use _udata ↵Devang Patel2010-12-09
| | | | | | | | | instead. This fixes radar 8730409. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121323 91177308-0d34-0410-b5e6-96231b3b80d8
* Properly deal with empty intervals when checking for interference.Jakob Stoklund Olesen2010-12-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121319 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement very primitive hinting support in RegAllocGreedy.Jakob Stoklund Olesen2010-12-08
| | | | | | | The hint is simply tried first and then forgotten if it couldn't be allocated immediately. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121306 91177308-0d34-0410-b5e6-96231b3b80d8
* Store (priority,regnum) pairs in the priority queue instead of providing anJakob Stoklund Olesen2010-12-08
| | | | | | | | | | | | | | | | | | | | | | | abstract priority queue interface in subclasses that want to override the priority calculations. Subclasses must provide a getPriority() implementation instead. This approach requires less code as long as priorities are expressable as simple floats, and it avoids the dangers of defining potentially expensive priority comparison functions. It also should speed up priority_queue operations since they no longer have to chase pointers when comparing registers. This is not measurable, though. Preferably, we shouldn't use floats to guide code generation. The use of floats here is derived from the use of floats for spill weights. Spill weights have a dynamic range that doesn't lend itself easily to a fixpoint implementation. When someone invents a stable spill weight representation, it can be reused for allocation priorities. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121294 91177308-0d34-0410-b5e6-96231b3b80d8
* Reword comment slightly.Eric Christopher2010-12-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121293 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix comment.Eric Christopher2010-12-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121285 91177308-0d34-0410-b5e6-96231b3b80d8
* Trim includes.Jakob Stoklund Olesen2010-12-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121283 91177308-0d34-0410-b5e6-96231b3b80d8
* Generalize PostRAHazardRecognizer so it can be used in any pass forAndrew Trick2010-12-08
| | | | | | | | | both forward and backward scheduling. Rename it to ScoreboardHazardRecognizer (Scoreboard is one word). Remove integer division from the scoreboard's critical path. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121274 91177308-0d34-0410-b5e6-96231b3b80d8
* Stub out RegAllocGreedy.Jakob Stoklund Olesen2010-12-08
| | | | | | | | | This new register allocator is initially identical to RegAllocBasic, but it will receive all of the tricks that RegAllocBasic won't get. RegAllocGreedy will eventually replace linear scan. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121234 91177308-0d34-0410-b5e6-96231b3b80d8
* Move RABasic::addMBBLiveIns to the base class, it is generally useful.Jakob Stoklund Olesen2010-12-08
| | | | | | | Minor optimization to the use of IntervalMap iterators. They are fairly heavyweight, so prefer SI.valid() over SI != end(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121217 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch LiveIntervalUnion from std::set to IntervalMap.Jakob Stoklund Olesen2010-12-07
| | | | | | | This speeds up RegAllocBasic by 20%, not counting releaseMemory which becomes way faster. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121201 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify assertion.Jakob Stoklund Olesen2010-12-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121162 91177308-0d34-0410-b5e6-96231b3b80d8
* PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() andJay Foad2010-12-07
| | | | | | | | zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method trunc(), to be const and to return a new value instead of modifying the object in place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121120 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused member.Jakob Stoklund Olesen2010-12-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121098 91177308-0d34-0410-b5e6-96231b3b80d8
* Undefined value in reg 0 may need a marker to identify end of source range.Devang Patel2010-12-06
| | | | | | | This will be used to truncate live range of DBG_VALUE instruction by register allocator and friends. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121061 91177308-0d34-0410-b5e6-96231b3b80d8
* If dbg_declare() or dbg_value() is not lowered by isel then emit DEBUG ↵Devang Patel2010-12-06
| | | | | | message instead of creating DBG_VALUE for undefined value in reg0. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121059 91177308-0d34-0410-b5e6-96231b3b80d8
* Second try at making direct object emission produce the same resultsRafael Espindola2010-12-06
| | | | | | | as llc + llvm-mc. This time ELF is not changed and I tested that llvm-gcc bootstrap on darwin10 using darwin9's assembler and linker. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121006 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert previous two patches while I try to find out how to make bothRafael Espindola2010-12-06
| | | | | | linux and darwin assemblers happy :-( git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121004 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an EmitAbsValue helper method and use it in cases where we want to be sureRafael Espindola2010-12-06
| | | | | | | that no relocations are used (on MochO). Fixes llc producing different output from llc + llvm-mc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121000 91177308-0d34-0410-b5e6-96231b3b80d8
* Some cleanup before I start committing some incremental progress onCameron Zwarich2010-12-05
| | | | | | | StrongPHIElimination. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120961 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the PHIElimination.h header, as it is no longer needed.Cameron Zwarich2010-12-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120959 91177308-0d34-0410-b5e6-96231b3b80d8
* I forgot to actually remove the FindCopyInsertPoint() declaration fromCameron Zwarich2010-12-05
| | | | | | | PHIElimination.h. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120953 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the SplitCriticalEdge() method declaration from PHIElimination.h. At oneCameron Zwarich2010-12-05
| | | | | | | | time, this method existed, but now PHIElimination uses the method of the same name on MachineBasicBlock. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120952 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the FindCopyInsertPoint method of PHIElimination to a new standaloneCameron Zwarich2010-12-05
| | | | | | | function so that it can be shared with StrongPHIElimination. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120951 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove PHIElimination's private copy of SkipPHIsAndLabels.Cameron Zwarich2010-12-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120918 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unneeded zero arrays.Benjamin Kramer2010-12-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120910 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename virtRegMap to avoid confusion with the VirtRegMap that it isn't.Jakob Stoklund Olesen2010-12-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120846 91177308-0d34-0410-b5e6-96231b3b80d8
* Coalesce debug locations when possible, causing less DBG_VALUE instructions toJakob Stoklund Olesen2010-12-03
| | | | | | be emitted. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120845 91177308-0d34-0410-b5e6-96231b3b80d8
* Emit DBG_VALUE instructions from LiveDebugVariables.Jakob Stoklund Olesen2010-12-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120842 91177308-0d34-0410-b5e6-96231b3b80d8
* Also update virtRegMap when renaming virtual registers.Jakob Stoklund Olesen2010-12-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120841 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete the StrongPHIElimination pass, leaving only a shell.Jakob Stoklund Olesen2010-12-03
| | | | | | | | | | The StrongPHIElimination pass did not work, and nobody has worked on it for two years. A rewrite is underway, so I am leaving this shell pass instead of deleting it completely. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120830 91177308-0d34-0410-b5e6-96231b3b80d8
* Update LiveDebugVariables during coalescing.Jakob Stoklund Olesen2010-12-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120720 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement the first half of LiveDebugVariables.Jakob Stoklund Olesen2010-12-02
| | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120636 91177308-0d34-0410-b5e6-96231b3b80d8
* PR5207: Rename overloaded APInt methods set(), clear(), flip() toJay Foad2010-12-01
| | | | | | setAllBits(), setBit(unsigned), etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120564 91177308-0d34-0410-b5e6-96231b3b80d8
* Comment typo.Andrew Trick2010-11-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120504 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable sibling call optimization of libcalls which are expanded duringEvan Cheng2010-11-30
| | | | | | | | | | | | legalization time. Since at legalization time there is no mapping from SDNode back to the corresponding LLVM instruction and the return SDNode is target specific, this requires a target hook to check for eligibility. Only x86 and ARM support this form of sibcall optimization right now. rdar://8707777 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120501 91177308-0d34-0410-b5e6-96231b3b80d8
* Coding style. No significant functionality. Abandon linear scan styleAndrew Trick2010-11-30
| | | | | | | | | in favor of the widespread llvm style. Capitalize variables and add newlines for visual parsing. Rename variables for readability. And other cleanup. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120490 91177308-0d34-0410-b5e6-96231b3b80d8
* add TLI support indicating that jumps are more expensive than logical operationsChris Lattner2010-11-30
| | | | | | | and use this to disable a specific optimization. Patch by Micah Villmow! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120435 91177308-0d34-0410-b5e6-96231b3b80d8
* PR5207: Make APInt::set(), APInt::clear() and APInt::flip() return void.Jay Foad2010-11-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120413 91177308-0d34-0410-b5e6-96231b3b80d8
* Stub out a new LiveDebugVariables pass.Jakob Stoklund Olesen2010-11-30
| | | | | | | | | | | | | This analysis is going to run immediately after LiveIntervals. It will stay alive during register allocation and keep track of user variables mentioned in DBG_VALUE instructions. When the register allocator is moving values between registers and the stack, it is very hard to keep track of DBG_VALUE instructions. We usually get it wrong. This analysis maintains a data structure that makes it easy to update DBG_VALUE instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120385 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge System into Support.Michael J. Spencer2010-11-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120298 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a comment typo.Bob Wilson2010-11-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120235 91177308-0d34-0410-b5e6-96231b3b80d8
* Move more PEI-related hooks to TFIAnton Korobeynikov2010-11-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120229 91177308-0d34-0410-b5e6-96231b3b80d8
* Move callee-saved regs spills / reloads to TFIAnton Korobeynikov2010-11-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120228 91177308-0d34-0410-b5e6-96231b3b80d8
* Namespacify.Benjamin Kramer2010-11-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120146 91177308-0d34-0410-b5e6-96231b3b80d8
* Renaming ISD::BIT_CONVERT to ISD::BITCAST to better reflect the LLVM IR concept.Wesley Peck2010-11-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119990 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement the "if (X == 6 || X == 4)" -> "if ((X|2) == 6)" optimization.Benjamin Kramer2010-11-22
| | | | | | | | This currently only catches the most basic case, a two-case switch, but can be extended later. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119964 91177308-0d34-0410-b5e6-96231b3b80d8
* Move some more hooks to TargetFrameInfoAnton Korobeynikov2010-11-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119904 91177308-0d34-0410-b5e6-96231b3b80d8