summaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegAllocLocal.cpp
Commit message (Collapse)AuthorAge
* Move some methods out of MachineInstr into MachineOperandChris Lattner2006-05-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28102 91177308-0d34-0410-b5e6-96231b3b80d8
* Add explicit #includes of <iostream>Chris Lattner2006-01-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25515 91177308-0d34-0410-b5e6-96231b3b80d8
* Nuke noop copies.Chris Lattner2005-11-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24258 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable some overly-aggressive checking code. This speeds up the localChris Lattner2005-11-09
| | | | | | | allocator from 23s to 11s on kc++ in debug mode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24255 91177308-0d34-0410-b5e6-96231b3b80d8
* Change this code ot pass register classes into the stack slot spiller/reloaderChris Lattner2005-09-30
| | | | | | | | code. PrologEpilogInserter hasn't been updated yet though, so targets cannot use this info. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23536 91177308-0d34-0410-b5e6-96231b3b80d8
* adjust to new live variables interfaceChris Lattner2005-08-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22992 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing whitespaceMisha Brukman2005-04-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21420 91177308-0d34-0410-b5e6-96231b3b80d8
* Update this pass to set PhysRegsUsed info in MachineFunction.Chris Lattner2005-01-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19792 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up the MachineBasicBlock.h file, percolating #includes into this file.Chris Lattner2004-10-26
| | | | | | | Patch contributed by Morten Ofstad git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17251 91177308-0d34-0410-b5e6-96231b3b80d8
* Changes For Bug 352Reid Spencer2004-09-01
| | | | | | | | | Move include/Config and include/Support into include/llvm/Config, include/llvm/ADT and include/llvm/Support. From here on out, all LLVM public header files must be under include/llvm/. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16137 91177308-0d34-0410-b5e6-96231b3b80d8
* Reduce usage of MRegisterInfo::getRegClassChris Lattner2004-08-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15784 91177308-0d34-0410-b5e6-96231b3b80d8
* Nuke ifdef'd out codeChris Lattner2004-08-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15777 91177308-0d34-0410-b5e6-96231b3b80d8
* Stop using CreateStackObject(RegClass*)Chris Lattner2004-08-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15775 91177308-0d34-0410-b5e6-96231b3b80d8
* These methods no longer take a TargetRegisterClass* operand.Chris Lattner2004-08-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15774 91177308-0d34-0410-b5e6-96231b3b80d8
* These files don't need to include <iostream> since they include ↵Brian Gaeke2004-07-21
| | | | | | "Support/Debug.h". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15089 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a recent regression in Applications/sgefa that Alkis pointed out to me.Chris Lattner2004-06-16
| | | | | | | | | The vector may actually be empty if the register that we are marking as recently used is not actually allocatable. This happens for physical registers that are not allocatable, like the ST(x) registers on X86. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14195 91177308-0d34-0410-b5e6-96231b3b80d8
* Adjust to new TargetMachine interfaceChris Lattner2004-06-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13956 91177308-0d34-0410-b5e6-96231b3b80d8
* Change MRegisterInfo::foldMemoryOperand to return the foldedAlkis Evlogimenos2004-03-14
| | | | | | | instruction to make the API more flexible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12386 91177308-0d34-0410-b5e6-96231b3b80d8
* Uncomment assertions that register# != 0 on calls toAlkis Evlogimenos2004-02-26
| | | | | | | | MRegisterInfo::is{Physical,Virtual}Register. Apply appropriate fixes to relevant files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11882 91177308-0d34-0410-b5e6-96231b3b80d8
* No need to clear the map here, it will always be emptyChris Lattner2004-02-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11868 91177308-0d34-0410-b5e6-96231b3b80d8
* Add DenseMap template and actually use it for for mapping virtual regsAlkis Evlogimenos2004-02-25
| | | | | | | to objects. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11840 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor rewinding code for finding the first terminator of a basicAlkis Evlogimenos2004-02-23
| | | | | | | | | | | | | block into MachineBasicBlock::getFirstTerminator(). This also fixes a bug in the implementation of the above in both RegAllocLocal and InstrSched, where instructions where added after the terminator if the basic block's only instruction was a terminator (it shouldn't matter for RegAllocLocal since this case never occurs in practice). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11748 91177308-0d34-0410-b5e6-96231b3b80d8
* Another bug fix for empty MBB'sChris Lattner2004-02-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11716 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug where we were implicitly assuming that there would be at leastChris Lattner2004-02-22
| | | | | | | one terminator instruction in each basic block. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11714 91177308-0d34-0410-b5e6-96231b3b80d8
* Make 'fold' statistic's description the same in both allocators.Alkis Evlogimenos2004-02-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11687 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix problem fusing spill code into instructions: we didn't update the liveChris Lattner2004-02-19
| | | | | | | | variable information to take into account the change of instruction address. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11628 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename reloads/spills to loads/stores.Alkis Evlogimenos2004-02-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11619 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the -disable-kill option. The register allocator is buggy with it,Chris Lattner2004-02-17
| | | | | | | and it was only for debugging in the first place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11557 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support to the local allocator for fusing spill code into the instructionsChris Lattner2004-02-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that need them. This is very useful on CISCy targets like the X86 because it reduces the total spill pressure, and makes better use of it's (large) instruction set. Though the X86 backend doesn't know how to rewrite many instructions yet, this already makes a substantial difference on 176.gcc for example: Before: Time: 8.0099 ( 31.2%) 0.0100 ( 12.5%) 8.0199 ( 31.2%) 7.7186 ( 30.0%) Local Register Allocator Code quality: 734559 asm-printer - Number of machine instrs printed 111395 ra-local - Number of registers reloaded 79902 ra-local - Number of registers spilled 231554 x86-peephole - Number of peephole optimization performed After: Time: 7.8700 ( 30.6%) 0.0099 ( 19.9%) 7.8800 ( 30.6%) 7.7892 ( 30.2%) Local Register Allocator Code quality: 733083 asm-printer - Number of machine instrs printed 2379 ra-local - Number of reloads fused into instructions 109046 ra-local - Number of registers reloaded 79881 ra-local - Number of registers spilled 230658 x86-peephole - Number of peephole optimization performed So by fusing 2300 instructions, we reduced the static number of instructions by 1500, and reduces the number of peepholes (and thus the work) by about 900. This also clearly reduces the number of reload/spill instructions that are emitted. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11542 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug in my previous refactoring change... arg!Chris Lattner2004-02-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11535 91177308-0d34-0410-b5e6-96231b3b80d8
* Once we have a way to fold spill code reloads into instructions, we have a ↵Chris Lattner2004-02-17
| | | | | | way to use it. :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11517 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor code a bit. No functionality changes, though the comment hints at ↵Chris Lattner2004-02-17
| | | | | | things to come. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11515 91177308-0d34-0410-b5e6-96231b3b80d8
* Make dense maps keyed on physical registers smallerusingAlkis Evlogimenos2004-02-15
| | | | | | | | | | | MRegisterInfo::getNumRegs() instead of MRegisterInfo::FirstVirtualRegister. Also use MRegisterInfo::is{Physical,Virtual}Register where appropriate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11477 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove getAllocatedRegNum(). Use getReg() instead.Alkis Evlogimenos2004-02-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11393 91177308-0d34-0410-b5e6-96231b3b80d8
* Use getNumVirtualRegs().Alkis Evlogimenos2004-02-13
| | | | | | | Whitespace cleanups. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11389 91177308-0d34-0410-b5e6-96231b3b80d8
* Change MachineBasicBlock's vector of MachineInstr pointers into anAlkis Evlogimenos2004-02-12
| | | | | | | | | | ilist of MachineInstr objects. This allows constant time removal and insertion of MachineInstr instances from anywhere in each MachineBasicBlock. It also allows for constant time splicing of MachineInstrs into or out of MachineBasicBlocks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11340 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not use MachineOperand::isVirtualRegister either!Chris Lattner2004-02-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11283 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate users of MachineOperand::isPhysicalRegisterChris Lattner2004-02-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11278 91177308-0d34-0410-b5e6-96231b3b80d8
* Another nice speedup for the register allocator. This time, we replaceChris Lattner2004-02-09
| | | | | | | | | the Virt2PhysRegMap std::map with an std::vector. This speeds up the register allocator another (almost) 40%, from .72->.45s in a release build of LLC on 253.perlbmk. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11219 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the PhysRegsUsed map into a dense array. Seeing that this is a mappingChris Lattner2004-02-09
| | | | | | | | | | | | | | from physical registers, and they are always dense, it makes sense to not have a ton of RBtree overhead. This change speeds up regalloclocal about ~30% on 253.perlbmk, from .35s -> .27s in the JIT (in LLC, it goes from .74 -> .55). Now live variable analysis is the slowest codegen pass. Of course it doesn't help that we have to run it twice, because regalloclocal doesn't update it, but even if it did it would be the slowest pass (now it's just the 2x slowest pass :( git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11215 91177308-0d34-0410-b5e6-96231b3b80d8
* Finegrainify namespacification, use new MRegisterInfo::isVirtualRegisterChris Lattner2004-01-31
| | | | | | | method git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11037 91177308-0d34-0410-b5e6-96231b3b80d8
* Correctly compute live variable information for physical registersAlkis Evlogimenos2004-01-13
| | | | | | | | | | | | | | | when an implicitely defined register is later used by an alias. For example: call foo %reg1024 = mov %AL The call implicitely defines EAX but only AL is used. Before this fix no information was available on AL. Now EAX and all its aliases except AL get defined and die at the call instruction whereas AL lives to be killed by the assignment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10813 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove TwoAddressInstruction from the public headers and add an IDAlkis Evlogimenos2003-12-18
| | | | | | | instead, since this pass doesn't expose any state to its users. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10520 91177308-0d34-0410-b5e6-96231b3b80d8
* Modify local register allocator to use the two-address instruction pass.Alkis Evlogimenos2003-12-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10513 91177308-0d34-0410-b5e6-96231b3b80d8
* Change interface of MachineOperand as follows:Alkis Evlogimenos2003-12-14
| | | | | | | | | | | | | | | | a) remove opIsUse(), opIsDefOnly(), opIsDefAndUse() b) add isUse(), isDef() c) rename opHiBits32() to isHiBits32(), opLoBits32() to isLoBits32(), opHiBits64() to isHiBits64(), opLoBits64() to isLoBits64(). This results to much more readable code, for example compare "op.opIsDef() || op.opIsDefAndUse()" to "op.isDef()" a pattern used very often in the code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10461 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unecessary if statements when looping on ImplicitDefs.Alkis Evlogimenos2003-12-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10444 91177308-0d34-0410-b5e6-96231b3b80d8
* Make assertion stricter. Since the source operands are allocated atAlkis Evlogimenos2003-12-05
| | | | | | | | this point, the second operand must be a physical register (it cannot be a virtual one). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10292 91177308-0d34-0410-b5e6-96231b3b80d8
* Put all LLVM code into the llvm namespace, as per bug 109.Brian Gaeke2003-11-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
* standardize command line option namesChris Lattner2003-10-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9496 91177308-0d34-0410-b5e6-96231b3b80d8
* Added LLVM project notice to the top of every C++ source file.John Criswell2003-10-20
| | | | | | | Header files will be on the way. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9298 91177308-0d34-0410-b5e6-96231b3b80d8