summaryrefslogtreecommitdiff
path: root/lib/CodeGen/TwoAddressInstructionPass.cpp
Commit message (Collapse)AuthorAge
* Patches to make the LLVM sources more -pedantic clean. Patch providedChris Lattner2006-05-24
| | | | | | | by Anton Korobeynikov! This is a step towards closing PR786. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28447 91177308-0d34-0410-b5e6-96231b3b80d8
* 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
* Fix some spello's pointed out by Gabor GreifChris Lattner2005-10-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24019 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
* Use the TargetInstrInfo::commuteInstruction method to commute instructionsChris Lattner2005-01-19
| | | | | | | instead of doing it manually. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19685 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the 2-address instruction lowering pass smarter in two ways:Chris Lattner2005-01-02
| | | | | | | | | | | | | | | | | | 1. If we are two-addressing a commutable instruction and the LHS is not the last use of the variable, see if the instruction is the last use of the RHS. If so, commute the instruction, allowing us to avoid a register-register copy in many cases for common instructions like ADD, OR, AND, etc on X86. 2. If #1 doesn't hold, and if this is an instruction that also existing in 3-address form, promote the instruction to a 3-address instruction to avoid the register-register copy. We can do this for several common instructions in X86, including ADDrr, INC, DEC, etc. This patch implements test/Regression/CodeGen/X86/commute-two-addr.ll, overlap-add.ll, and overlap-shift.ll when I check in the X86 support for it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19245 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
* The insertion method returns void nowChris Lattner2004-08-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15779 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix indentation and wrap code at 80 colsMisha Brukman2004-07-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15107 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove extraneous punctuationChris Lattner2004-07-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15098 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor cleanupsChris Lattner2004-07-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15091 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
* Simplify the interface to LiveVariables::addVirtualRegister(Killed|Dead)Chris Lattner2004-07-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14997 91177308-0d34-0410-b5e6-96231b3b80d8
* Made a fix so that you can print out MachineInstrs that belong to a ↵Tanya Lattner2004-06-25
| | | | | | MachineBasicBlock that is not yet attached to a MachineFunction. This change includes changing the third operand (TargetMachine) to a pointer for the MachineInstr::print function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14389 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
* Beautify debug output.Alkis Evlogimenos2004-02-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11573 91177308-0d34-0410-b5e6-96231b3b80d8
* This pass should not require phi elimination or live variableAlkis Evlogimenos2004-02-15
| | | | | | | | analysis. It should only preserve them and update LiveVariables if it already ran. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11479 91177308-0d34-0410-b5e6-96231b3b80d8
* Use newly added next() and prior() utility functions.Alkis Evlogimenos2004-02-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11430 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
* 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
* Added missing include.Tanya Lattner2004-02-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11129 91177308-0d34-0410-b5e6-96231b3b80d8
* Modify the two address instruction pass to remove the duplicateAlkis Evlogimenos2004-02-04
| | | | | | | operand of the instruction and thus simplify the register allocation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11124 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert changes. Will implement this using a different set of primitivesAlkis Evlogimenos2004-02-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11091 91177308-0d34-0410-b5e6-96231b3b80d8
* Correctly update def/use information for modified machine operands.Alkis Evlogimenos2004-02-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11087 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix, correctly this time, the computation of the return valueChris Lattner2004-01-31
| | | | | | | | | | Fix a spello Tighten up the assertion checking No functionality changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11036 91177308-0d34-0410-b5e6-96231b3b80d8
* * Fix incorrect computation of the runOnMachineFunction return valueChris Lattner2004-01-31
| | | | | | | * Turn a bunch of instance variables into automatic variables git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11035 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unneeded #includesChris Lattner2004-01-31
| | | | | | | | | Move Passes.h (which defines the interface to this file) to the top. Move statistics to the top of the file. Add a comment git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11034 91177308-0d34-0410-b5e6-96231b3b80d8
* Make LiveVariables::HandlePhysRegUse andAlkis Evlogimenos2004-01-11
| | | | | | | | | | LiveVariables::HandlePhysRegDef private they use information that is not in memory when LiveVariables finishes the analysis. Also update the TwoAddressInstructionPass to not use this interface. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10755 91177308-0d34-0410-b5e6-96231b3b80d8
* fix warningChris Lattner2004-01-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10692 91177308-0d34-0410-b5e6-96231b3b80d8
* Currently we cannot handle two-address instructions of the form:Alkis Evlogimenos2004-01-05
| | | | | | | | A = B op C where A == C, but this cannot really occur in practice because of SSA form. Add an assert to check that just to be safe. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10682 91177308-0d34-0410-b5e6-96231b3b80d8
* Update description.Alkis Evlogimenos2004-01-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10681 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
* Add TwoAddressInstructionPass to handle instructions that have two orAlkis Evlogimenos2003-12-18
more operands and the two first operands are constrained to be the same. The pass takes an instruction of the form: a = b op c and transforms it into: a = b a = a op c and also preserves live variables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10512 91177308-0d34-0410-b5e6-96231b3b80d8