aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/TwoAddressInstructionPass.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix a memory bug: increment an iterator of a deleted machine instr.Evan Cheng2008-03-271-2/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48853 91177308-0d34-0410-b5e6-96231b3b80d8
* Typo.Evan Cheng2008-03-131-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48337 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't try to sink 3-address instruction if convertToThreeAddress created ↵Evan Cheng2008-03-131-1/+6
| | | | | | more than one instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48336 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove an unused command line option.Evan Cheng2008-03-131-9/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48334 91177308-0d34-0410-b5e6-96231b3b80d8
* TwoAddressInstructionPass enhancement. After it converts a two address ↵Evan Cheng2008-03-131-13/+131
| | | | | | instruction into a 3-address one, sink it past the instruction that kills the read-mod-write register if its definition is used past the kill. This reduces the number of live register by one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48333 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor code. Remove duplicated functions that basically do the same thing asEvan Cheng2008-03-051-2/+2
| | | | | | | findRegisterUseOperandIdx, findRegisterDefOperandIndx. Fix some naming inconsistencies. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47927 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename MRegisterInfo to TargetRegisterInfo.Dan Gohman2008-02-101-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46930 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove DefInst from LiveVariables::VarInfo. Use the facilities on ↵Owen Anderson2008-01-151-4/+0
| | | | | | MachineRegisterInfo instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46016 91177308-0d34-0410-b5e6-96231b3b80d8
* rename TargetInstrDescriptor -> TargetInstrDesc.Chris Lattner2008-01-071-7/+7
| | | | | | | | Make MachineInstr::getDesc return a reference instead of a pointer, since it can never be null. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45695 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename all the M_* flags to be namespace qualified enums, and switch Chris Lattner2008-01-071-1/+1
| | | | | | | | | all clients over to using predicates instead of these flags directly. These are now private values which are only to be used to statically initialize the tables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45692 91177308-0d34-0410-b5e6-96231b3b80d8
* add more and significantly better comments to the rest of the machineinstrChris Lattner2008-01-071-1/+1
| | | | | | | | flags that can be set. Add predicates for the ones lacking it, and switch some clients over to using the predicates instead of Flags directly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45690 91177308-0d34-0410-b5e6-96231b3b80d8
* Move a bunch more accessors from TargetInstrInfo to TargetInstrDescriptorChris Lattner2008-01-071-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45680 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename MachineInstr::getInstrDescriptor -> getDesc(), which reflectsChris Lattner2008-01-071-1/+1
| | | | | | | | | | | | | | | | | | that it is cheap and efficient to get. Move a variety of predicates from TargetInstrInfo into TargetInstrDescriptor, which makes it much easier to query a predicate when you don't have TII around. Now you can use MI->getDesc()->isBranch() instead of going through TII, and this is much more efficient anyway. Not all of the predicates have been moved over yet. Update old code that used MI->getInstrDescriptor()->Flags to use the new predicates in many places. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45674 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't recalculate the loop info and loop dominators analyses if they'reBill Wendling2008-01-041-0/+2
| | | | | | | preserved. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45596 91177308-0d34-0410-b5e6-96231b3b80d8
* Move copyRegToReg from MRegisterInfo to TargetInstrInfo. This is part of theOwen Anderson2007-12-311-2/+1
| | | | | | | Machine-level API cleanup instigated by Chris. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45470 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename SSARegMap -> MachineRegisterInfo in keeping with the idea Chris Lattner2007-12-311-2/+2
| | | | | | | | | | | | | | | | that "machine" classes are used to represent the current state of the code being compiled. Given this expanded name, we can start moving other stuff into it. For now, move the UsedPhysRegs and LiveIn/LoveOuts vectors from MachineFunction into it. Update all the clients to match. This also reduces some needless #includes, such as MachineModuleInfo from MachineFunction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45467 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
* As Chris and Evan pointed out, BreakCriticalMachineEdges doesn't really needOwen Anderson2007-11-121-1/+0
| | | | | | | to be a pass of its own. Instead, move it out into a helper method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44002 91177308-0d34-0410-b5e6-96231b3b80d8
* This preserves critical edge breaking.Owen Anderson2007-11-081-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43911 91177308-0d34-0410-b5e6-96231b3b80d8
* Bring UsedBlocks back. StrongPHIElimination needs this information.Owen Anderson2007-11-081-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43866 91177308-0d34-0410-b5e6-96231b3b80d8
* It's possible to commute instrctions with more than 3 operands.Evan Cheng2007-10-231-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43256 91177308-0d34-0410-b5e6-96231b3b80d8
* Added missing curly braces which renders the if clause useless in debug build.Evan Cheng2007-10-201-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43196 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow copyRegToReg to emit cross register classes copies.Evan Cheng2007-09-261-1/+1
| | | | | | | Tested with "make check"! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42346 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typo in comment.Nick Lewycky2007-05-061-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36873 91177308-0d34-0410-b5e6-96231b3b80d8
* Drop 'const'Devang Patel2007-05-031-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36662 91177308-0d34-0410-b5e6-96231b3b80d8
* Use 'static const char' instead of 'static const int'.Devang Patel2007-05-021-2/+2
| | | | | | | | Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36652 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not use typeinfo to identify pass in pass manager.Devang Patel2007-05-011-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36632 91177308-0d34-0410-b5e6-96231b3b80d8
* VarInfo::UsedBlocks is no longer used. Remove.Evan Cheng2007-04-181-4/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36250 91177308-0d34-0410-b5e6-96231b3b80d8
* Keep UsedBlocks info accurate.Evan Cheng2007-03-181-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35140 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate static ctors from StatisticsChris Lattner2006-12-191-7/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32698 91177308-0d34-0410-b5e6-96231b3b80d8
* Removed more <iostream> includesBill Wendling2006-12-071-4/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32321 91177308-0d34-0410-b5e6-96231b3b80d8
* Detemplatize the Statistic class. The only type it is instantiated withChris Lattner2006-12-061-3/+3
| | | | | | | is 'unsigned'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32279 91177308-0d34-0410-b5e6-96231b3b80d8
* Match TargetInstrInfo changes.Evan Cheng2006-12-011-14/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32098 91177308-0d34-0410-b5e6-96231b3b80d8
* Use llvm streams instead of <iostream>Bill Wendling2006-11-281-12/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31985 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove M_2_ADDR_FLAG.Evan Cheng2006-11-091-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31583 91177308-0d34-0410-b5e6-96231b3b80d8
* Two-address instructions no longer have to be A := A op C. Now any pair of ↵Evan Cheng2006-11-011-100/+119
| | | | | | dest / src operands can be tied together. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31363 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a long-standing wart in the code generator: two-address instruction loweringChris Lattner2006-09-051-3/+2
| | | | | | | | | | | | | | | | actually *removes* one of the operands, instead of just assigning both operands the same register. This make reasoning about instructions unnecessarily complex, because you need to know if you are before or after register allocation to match up operand #'s with the target description file. Changing this also gets rid of a bunch of hacky code in various places. This patch also includes changes to fold loads into cmp/test instructions in the X86 backend, along with a significant simplification to the X86 spill folding code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30108 91177308-0d34-0410-b5e6-96231b3b80d8
* s|llvm/Support/Visibility.h|llvm/Support/Compiler.h|Chris Lattner2006-08-271-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29911 91177308-0d34-0410-b5e6-96231b3b80d8
* Reduce number of exported symbolsAndrew Lenharth2006-07-201-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29220 91177308-0d34-0410-b5e6-96231b3b80d8
* Shave another 27K off libllvmgcc.dylib with visibility hiddenChris Lattner2006-06-281-1/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28973 91177308-0d34-0410-b5e6-96231b3b80d8
* Patches to make the LLVM sources more -pedantic clean. Patch providedChris Lattner2006-05-241-1/+1
| | | | | | | 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-041-1/+1
| | | | 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-221-0/+1
| | | | 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-261-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24019 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing whitespaceMisha Brukman2005-04-211-4/+4
| | | | 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-191-6/+17
| | | | | | | 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-021-17/+61
| | | | | | | | | | | | | | | | | | 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-011-3/+3
| | | | | | | | | 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-151-5/+1
| | | | 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-221-110/+100
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15107 91177308-0d34-0410-b5e6-96231b3b80d8