summaryrefslogtreecommitdiff
path: root/lib/CodeGen/VirtRegMap.cpp
Commit message (Collapse)AuthorAge
...
* remove some uses of llvm/Support/Streams.hChris Lattner2009-08-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79842 91177308-0d34-0410-b5e6-96231b3b80d8
* Move more to raw_ostream, provide support for writing MachineBasicBlock,Daniel Dunbar2009-07-24
| | | | | | | LiveInterval, etc to raw_ostream. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76965 91177308-0d34-0410-b5e6-96231b3b80d8
* Part 1.Evan Cheng2009-06-15
| | | | | | | | | | | | | | | | | | | | | | - Change register allocation hint to a pair of unsigned integers. The hint type is zero (which means prefer the register specified as second part of the pair) or entirely target dependent. - Allow targets to specify alternative register allocation orders based on allocation hint. Part 2. - Use the register allocation hint system to implement more aggressive load / store multiple formation. - Aggressively form LDRD / STRD. These are formed *before* register allocation. It has to be done this way to shorten live interval of base and offset registers. e.g. v1025 = LDR v1024, 0 v1026 = LDR v1024, 0 => v1025,v1026 = LDRD v1024, 0 If this transformation isn't done before allocation, v1024 will overlap v1025 which means it more difficult to allocate a register pair. - Even with the register allocation hint, it may not be possible to get the desired allocation. In that case, the post-allocation load / store multiple pass must fix the ldrd / strd instructions. They can either become ldm / stm instructions or back to a pair of ldr / str instructions. This is work in progress, not yet enabled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73381 91177308-0d34-0410-b5e6-96231b3b80d8
* Move register allocation preference (or hint) from LiveInterval to ↵Evan Cheng2009-06-14
| | | | | | MachineRegisterInfo. This allows more passes to set them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73346 91177308-0d34-0410-b5e6-96231b3b80d8
* Restore minor deletion.Mike Stump2009-05-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70892 91177308-0d34-0410-b5e6-96231b3b80d8
* In some rare cases, the register allocator can spill registers but end up ↵Evan Cheng2009-05-03
| | | | | | | | | | | not utilizing registers at all. The fundamental problem is linearscan's backtracking can end up freeing more than one allocated registers. However, reloads and restores might be folded into uses / defs and freed registers might not be used at all. VirtRegMap keeps track of allocations so it knows what's not used. As a horrible hack, the stack coloring can color spill slots with *free* registers. That is, it replace reload and spills with copies from and to the free register. It unfold instructions that load and store the spill slot and replace them with register using variants. Not yet enabled. This is part 1. More coming. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70787 91177308-0d34-0410-b5e6-96231b3b80d8
* Oy! When reverting r68073, I added in experimental code. Sorry...Bill Wendling2009-03-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68099 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r68073. It's causing a failure in the Apple-style builds.Bill Wendling2009-03-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68092 91177308-0d34-0410-b5e6-96231b3b80d8
* Add newlines at end of file (this can annoy gcov)Daniel Dunbar2009-03-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67000 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert VirtRegMap to a MachineFunctionPass.Owen Anderson2009-03-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66870 91177308-0d34-0410-b5e6-96231b3b80d8
* Reorganization: Move the Spiller out of VirtRegMap.cpp into its own files. ↵Owen Anderson2009-03-11
| | | | | | No (intended) functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66720 91177308-0d34-0410-b5e6-96231b3b80d8
* Yet another case where the spiller marked two uses of the same register on ↵Evan Cheng2009-03-09
| | | | | | the same instruction as kill. This fixes PR3706. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66428 91177308-0d34-0410-b5e6-96231b3b80d8
* If a MI uses the same register more than once, only mark one of them as 'kill'.Evan Cheng2009-03-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66363 91177308-0d34-0410-b5e6-96231b3b80d8
* Last commit accidentially deleted this code.Evan Cheng2009-02-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65679 91177308-0d34-0410-b5e6-96231b3b80d8
* The last commit was overly conservative. It's ok to reuse value that's ↵Evan Cheng2009-02-26
| | | | | | already marked livein. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65498 91177308-0d34-0410-b5e6-96231b3b80d8
* If an available register falls through to a succ block, unset the last kill. ↵Evan Cheng2009-02-26
| | | | | | Sorry, it's impossible to reduce a sensible test case. It basically requires the moon and stars to align in order to cause a failure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65497 91177308-0d34-0410-b5e6-96231b3b80d8
* A couple of places where reused use operands should be marked kill. This is ↵Evan Cheng2009-02-17
| | | | | | exposed by recent availability fallthrough changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64745 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert this. It was breaking stuff.Bill Wendling2009-02-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64428 91177308-0d34-0410-b5e6-96231b3b80d8
* Turn off the old way of handling debug information in the code generator. UseBill Wendling2009-02-13
| | | | | | | | the new way, where all of the information is passed on SDNodes and machine instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64427 91177308-0d34-0410-b5e6-96231b3b80d8
* Adjust the sizes for a few SmallVectors to reflect their usage.Dan Gohman2009-02-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64381 91177308-0d34-0410-b5e6-96231b3b80d8
* It's (currently) not safe to keep certain physical registers live across ↵Evan Cheng2009-02-12
| | | | | | basic blocks, e.g. x86 fp stack registers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64374 91177308-0d34-0410-b5e6-96231b3b80d8
* If availability info is kept when fallthrough into a bb, add the available ↵Evan Cheng2009-02-12
| | | | | | registers to live-in set. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64372 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a bogus assertion. It's possible a live-in available value is used by ↵Evan Cheng2009-02-11
| | | | | | a previous instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64339 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement PR3495: local spiller optimization. The local spiller can now keep ↵Evan Cheng2009-02-11
| | | | | | availability information over BB boundaries. It visits BB's in depth first order. After visiting a BB if it find a successor which has a single predecessor it visits the successor next without clearing the availability information. This allows the successor to omit reloads or change them into copies. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64298 91177308-0d34-0410-b5e6-96231b3b80d8
* Explicitly pass in debug location information to BuildMI.Bill Wendling2009-02-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63599 91177308-0d34-0410-b5e6-96231b3b80d8
* Change TargetInstrInfo::isMoveInstr to return source and destination ↵Evan Cheng2009-01-20
| | | | | | sub-register indices as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62600 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR3124: overly strict assert.Evan Cheng2008-12-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60392 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR2898. Spiller delete a store for reuse before it knows for sure the ↵Evan Cheng2008-10-17
| | | | | | | | | reuse happened. Patch by Lang Hames! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57720 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a very subtle spiller bug: UpdateKills should not forget to track defs ↵Evan Cheng2008-10-17
| | | | | | of aliases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57673 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix command-line option printing to print two spaces where needed,Dan Gohman2008-10-14
| | | | | | | | | | instead of requiring all "short description" strings to begin with two spaces. This makes these strings less mysterious, and it fixes some cases where short description strings mistakenly did not begin with two spaces. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57521 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't dereference the end() iterator. Thanks toDan Gohman2008-10-06
| | | | | | | ENABLE_EXPENSIVE_CHECKS for finding this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57181 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch the MachineOperand accessors back to the short names likeDan Gohman2008-10-03
| | | | | | | isReg, etc., from isRegister, etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57006 91177308-0d34-0410-b5e6-96231b3b80d8
* Propagate subreg index when promoting a load to a copy.Evan Cheng2008-09-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56085 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR2664 - spiller GetRegForReload wasn't respecting sub-register indices ↵Evan Cheng2008-09-10
| | | | | | on machine operands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56065 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an overly strict assertion. Source register of a copy may not be killed, ↵Evan Cheng2008-09-04
| | | | | | it may be killed by an implicit super-register use. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55762 91177308-0d34-0410-b5e6-96231b3b80d8
* Make SimpleSpiller respect subregister indices.Owen Anderson2008-08-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54968 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR2596: out of bound reference.Evan Cheng2008-08-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54375 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a LocalSpiller leak. This fixes tramp3d-v4.Dan Gohman2008-07-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53766 91177308-0d34-0410-b5e6-96231b3b80d8
* Pool-allocation for MachineInstrs, MachineBasicBlocks, andDan Gohman2008-07-07
| | | | | | | | | | | | MachineMemOperands. The pools are owned by MachineFunctions. This drastically reduces the number of calls to malloc/free made during the "Emit" phase of scheduling, as well as later phases in CodeGen. Combined with other changes, this speeds up the "instruction selection" phase of CodeGen by 10% in some cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53212 91177308-0d34-0410-b5e6-96231b3b80d8
* Cosmetic.Evan Cheng2008-06-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52450 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix read after free found by valgrind.Evan Cheng2008-06-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52309 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach the spiller to commute instructions in order to fold a reload. This ↵Evan Cheng2008-06-13
| | | | | | hits 410 times on 444.namd and 122 times on 252.eon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52266 91177308-0d34-0410-b5e6-96231b3b80d8
* Move #include to right place.Evan Cheng2008-06-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51932 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove warnings about comparison between signed and unsigned expressions.Bill Wendling2008-05-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51465 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't attempt to update SpillSlotToUsesMap for stack slots that aren'tDavid Greene2008-05-22
| | | | | | | generated by the spiller. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51439 91177308-0d34-0410-b5e6-96231b3b80d8
* More local spiller complexity!Evan Cheng2008-05-20
| | | | | | | If local spiller optimization turns some instruction into an identity copy, it will be removed. If the output register happens to be dead (and source is obviously killed), transfer the kill / dead information to last use / def in the same MBB. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51306 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-13
| | | | | | | | 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
* Yet another nasty spiller bug.Evan Cheng2008-05-07
| | | | | | | | | | | %ecx = op store %cl<kill>, (addr) (addr) = op %al It's not safe to unfold the last operand and eliminate store even though %cl is marked kill. It's a sub-register use which means one of its super-register(s) may be used below. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50794 91177308-0d34-0410-b5e6-96231b3b80d8
* Use of implicit_def is not part of live interval. Create empty intervals for ↵Evan Cheng2008-04-11
| | | | | | the uses when the live interval is being spilled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49542 91177308-0d34-0410-b5e6-96231b3b80d8
* Move reMaterialize() from TargetRegisterInfo to TargetInstrInfo.Evan Cheng2008-03-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48995 91177308-0d34-0410-b5e6-96231b3b80d8