aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/MachineLICM.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Don't call isInvariantLoad twice.Evan Cheng2009-02-041-9/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63729 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't bother hoisting out a "cheap" instruction if all of its uses are PHIs. ↵Evan Cheng2009-02-041-10/+55
| | | | | | LICM "cheap" instructions are not particularly beneficial to start with. This will just end up making the copies harder to coalesce. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63728 91177308-0d34-0410-b5e6-96231b3b80d8
* For now, only hoist re-materilizable instructions. LICM will increase ↵Evan Cheng2009-02-041-2/+11
| | | | | | register pressure. We want to avoid spilling more instructions if it's possible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63725 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify the MachineLICM pass by having it only traverse outerDan Gohman2009-01-151-122/+60
| | | | | | | | | | loops, hoisting instructions all the way out in one step rather than hoisting them one nest level at a time. Also, make a few other code simplifications. This speeds up MachineLICM by several fold. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62283 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy up #includes, deleting a bunch of unnecessary #includes.Dan Gohman2009-01-051-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61715 91177308-0d34-0410-b5e6-96231b3b80d8
* Use isTerminator() instead of isBranch()||isReturn() inDan Gohman2008-12-231-1/+1
| | | | | | | | | several places. isTerminator() returns true for a superset of cases, and includes things like FP_REG_KILL, which are nither return or branch but aren't safe to move/remat/etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61373 91177308-0d34-0410-b5e6-96231b3b80d8
* Give MachineLICM a name, for -time-passes etc.Dan Gohman2008-12-181-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61184 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch the MachineOperand accessors back to the short names likeDan Gohman2008-10-031-1/+1
| | | | | | | isReg, etc., from isRegister, etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57006 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy up several unbeseeming casts from pointer to intptr_t.Dan Gohman2008-09-041-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55779 91177308-0d34-0410-b5e6-96231b3b80d8
* Cosmetic changes to Machine LICM. No functionality change.Bill Wendling2008-08-311-31/+36
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55578 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't hoist instructions that define a physical register.Bill Wendling2008-08-201-1/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55074 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't hoist instructions that have implicit uses or defines. Before, it wasBill Wendling2008-08-181-0/+5
| | | | | | | hoisting out some "test" and "cmp" instructions. This was obvious badness. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54908 91177308-0d34-0410-b5e6-96231b3b80d8
* Prevent option name conflict.Bill Wendling2008-07-071-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53166 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-131-4/+4
| | | | | | | | 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
* Revert the previous commit. Go ahead and hoist rematerializable instructions.Bill Wendling2008-05-121-4/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50990 91177308-0d34-0410-b5e6-96231b3b80d8
* One real change - don't hoist something that's trivially rematerializable. It'sBill Wendling2008-05-121-18/+19
| | | | | | | | | possible for it to produce worse code than before. The rest of this patch is code cleanup. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50987 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor cleanup. No functionality change.Bill Wendling2008-03-101-6/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48142 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename PrintableName to Name.Bill Wendling2008-02-261-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47629 91177308-0d34-0410-b5e6-96231b3b80d8
* Change "Name" to "AsmName" in the target register info. Gee, a refactoring toolBill Wendling2008-02-261-2/+2
| | | | | | | would have been a Godsend here! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47625 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename MRegisterInfo to TargetRegisterInfo.Dan Gohman2008-02-101-6/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46930 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify the side effect stuff a bit more and make licm/sinkingChris Lattner2008-01-101-5/+22
| | | | | | | | | | | | | | | | | both work right according to the new flags. This removes the TII::isReallySideEffectFree predicate, and adds TII::isInvariantLoad. It removes NeverHasSideEffects+MayHaveSideEffects and adds UnmodeledSideEffects as machine instr flags. Now the clients can decide everything they need. I think isRematerializable can be implemented in terms of the flags we have now, though I will let others tackle that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45843 91177308-0d34-0410-b5e6-96231b3b80d8
* rename TargetInstrDescriptor -> TargetInstrDesc.Chris Lattner2008-01-071-4/+4
| | | | | | | | 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 MachineInstr::getInstrDescriptor -> getDesc(), which reflectsChris Lattner2008-01-071-8/+6
| | | | | | | | | | | | | | | | | | 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
* Add that this preserves some analyses.Bill Wendling2008-01-041-1/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45573 91177308-0d34-0410-b5e6-96231b3b80d8
* Move option to enable machine LICM into LLVMTargetMachine.cpp.Bill Wendling2008-01-041-10/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45572 91177308-0d34-0410-b5e6-96231b3b80d8
* Call the parent's getAnalysisUsage.Bill Wendling2008-01-041-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45571 91177308-0d34-0410-b5e6-96231b3b80d8
* remove dead #includes and reorder the rest.Chris Lattner2008-01-041-10/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45569 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the correct MachineRegisterInfo object.Bill Wendling2008-01-021-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45499 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dead code.Bill Wendling2008-01-021-35/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45496 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the new architecture to get the containing machine basic block for a machineBill Wendling2008-01-021-28/+28
| | | | | | | | instruction. Also, use "splice" to move the new instruction instead of remove/insert (where it was leaking memory anyway). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45492 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
* Updated comments to reflect what "side effects" means in this situation.Bill Wendling2007-12-201-10/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45245 91177308-0d34-0410-b5e6-96231b3b80d8
* Add debugging info. Use the newly created "hasUnmodelledSideEffects" method.Bill Wendling2007-12-181-21/+38
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45178 91177308-0d34-0410-b5e6-96231b3b80d8
* Need to grow the indexed map. Added debug statements.Bill Wendling2007-12-111-21/+27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44892 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify slightly.Bill Wendling2007-12-111-3/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44881 91177308-0d34-0410-b5e6-96231b3b80d8
* Blark! How in the world did this work without this?!Bill Wendling2007-12-111-4/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44874 91177308-0d34-0410-b5e6-96231b3b80d8
* - Update the virtual reg to machine instruction map when hoisting.Bill Wendling2007-12-111-2/+12
| | | | | | | - Fix subtle bug when creating initially creating this map. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44873 91177308-0d34-0410-b5e6-96231b3b80d8
* Checking for "zero operands" during the "CanHoistInst()" method isn't necessaryBill Wendling2007-12-111-11/+4
| | | | | | | | | | because those with side effects will be caught by other checks in here. Also, simplify the check for a BB in a sub loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44871 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverting 44702. It wasn't correct to rename them.Bill Wendling2007-12-081-13/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44727 91177308-0d34-0410-b5e6-96231b3b80d8
* Renaming:Bill Wendling2007-12-081-1/+1
| | | | | | | | isTriviallyReMaterializable -> hasNoSideEffects isReallyTriviallyReMaterializable -> isTriviallyReMaterializable git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44702 91177308-0d34-0410-b5e6-96231b3b80d8
* Incorporated comments from Evan and Chris:Bill Wendling2007-12-081-58/+54
| | | | | | | | | http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20071203/056043.html http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20071203/056048.html git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44696 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial commit of the machine code LICM pass. It successfully hoists this:Bill Wendling2007-12-071-0/+336
_foo: li r2, 0 LBB1_1: ; bb li r5, 0 stw r5, 0(r3) addi r2, r2, 1 addi r3, r3, 4 cmplw cr0, r2, r4 bne cr0, LBB1_1 ; bb LBB1_2: ; return blr to: _foo: li r2, 0 li r5, 0 LBB1_1: ; bb stw r5, 0(r3) addi r2, r2, 1 addi r3, r3, 4 cmplw cr0, r2, r4 bne cr0, LBB1_1 ; bb LBB1_2: ; return blr ZOMG!! :-) Moar to come... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44687 91177308-0d34-0410-b5e6-96231b3b80d8