summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineLICM.cpp
Commit message (Collapse)AuthorAgeFilesLines
* - Change MachineInstr::isIdenticalTo to take a new option that determines ↵Evan Cheng2010-03-031-1/+1
| | | | | | | | whether it should skip checking defs or at least virtual register defs. This subsumes part of the TargetInstrInfo::isIdentical functionality. - Eliminate TargetInstrInfo::isIdentical and replace it with produceSameValue. In the default case, produceSameValue just checks whether two machine instructions are identical (except for virtual register defs). But targets may override it to check for unusual cases (e.g. ARM pic loads from constant pools). llvm-svn: 97628
* Don't try to replace physical registers when doing CSE.Dan Gohman2010-02-281-1/+12
| | | | llvm-svn: 97360
* Don't unconditionally suppress hoisting of instructions with implicitDan Gohman2010-02-281-26/+4
| | | | | | | | defs or uses. The regular def and use checking below covers them, and can be more precise. It's safe to hoist an instruction with a dead implicit def if the register isn't live into the loop header. llvm-svn: 97352
* move target-independent opcodes out of TargetInstrInfoChris Lattner2010-02-091-2/+2
| | | | | | | | | into TargetOpcodes.h. #include the new TargetOpcodes.h into MachineInstr. Add new inline accessors (like isPHI()) to MachineInstr, and start using them throughout the codebase. llvm-svn: 95687
* Change errs() to dbgs().David Greene2010-01-051-12/+12
| | | | llvm-svn: 92547
* Add Loop contains utility methods for testing whether a loopDan Gohman2009-12-181-1/+1
| | | | | | | | contains another loop, or an instruction. The loop form is substantially more efficient on large loops than the typical code it replaces. llvm-svn: 91654
* Enable hoisting load from constant memories.Evan Cheng2009-11-201-21/+6
| | | | llvm-svn: 89510
* Add option -licm-const-load to hoist all loads from constant memory.Evan Cheng2009-11-201-19/+56
| | | | llvm-svn: 89477
* Add MachineBasicBlock::getName, and use it in place of getBasicBlock()->getName.Jakob Stoklund Olesen2009-11-201-2/+2
| | | | | | Fix debug code that assumes getBasicBlock never returns NULL. llvm-svn: 89428
* Fix comment.Evan Cheng2009-11-171-3/+3
| | | | llvm-svn: 89129
* - Add TargetInstrInfo::isIdentical(). It's similar to MachineInstr::isIdenticalEvan Cheng2009-11-071-35/+24
| | | | | | | | | | except it doesn't care if the definitions' virtual registers differ. This is used by machine LICM and other MI passes to perform CSE. - Teach Thumb2InstrInfo::isIdentical() to check two t2LDRpci_pic are identical. Since pc relative constantpool entries are always different, this requires it it check if the values can actually the same. llvm-svn: 86328
* Code refactoring.Evan Cheng2009-11-051-49/+58
| | | | llvm-svn: 86085
* Re-apply 85799. It turns out my code isn't buggy.Evan Cheng2009-11-031-17/+46
| | | | llvm-svn: 85947
* Revert 85799 for now. It might be breaking llvm-gcc driver.Evan Cheng2009-11-021-46/+17
| | | | llvm-svn: 85827
* Initilize the machine LICM CSE map upon the first time an instruction is ↵Evan Cheng2009-11-021-17/+46
| | | | | | | | | | hoisted to the loop preheader. Add instructions which are already in the preheader block that may be common expressions of those that are hoisted out. These does get a few more instructions CSE'ed. llvm-svn: 85799
* Fix MachineLICM to use the correct virtual register class whenDan Gohman2009-10-301-2/+4
| | | | | | | | | | unfolding loads for hoisting. getOpcodeAfterMemoryUnfold returns the opcode of the original operation without the load, not the load itself, MachineLICM needs to know the operand index in order to get the correct register class. Extend getOpcodeAfterMemoryUnfold to return this information. llvm-svn: 85622
* Refactor the code for unfolding a load into a separate function.Dan Gohman2009-10-291-50/+62
| | | | llvm-svn: 85515
* Simplify this code: if the unfolded load can't be hoisted, just deleteDan Gohman2009-10-281-16/+3
| | | | | | the new instructions and leave the old one in place. llvm-svn: 85393
* Teach MachineLICM to unfold loads from constant memory fromDan Gohman2009-10-281-17/+83
| | | | | | | otherwise unhoistable instructions in order to allow the loads to be hoisted. llvm-svn: 85364
* Remove includes of Support/Compiler.h that are no longer needed after theNick Lewycky2009-10-251-1/+0
| | | | | | VISIBILITY_HIDDEN removal. llvm-svn: 85043
* Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.Nick Lewycky2009-10-251-1/+1
| | | | | | | Chris claims we should never have visibility_hidden inside any .cpp file but that's still not true even after this commit. llvm-svn: 85042
* Factor out LiveIntervalAnalysis' code to determine whether an instructionDan Gohman2009-10-091-3/+1
| | | | | | | | | | | | | | is trivially rematerializable and integrate it into TargetInstrInfo::isTriviallyReMaterializable. This way, all places that need to know whether an instruction is rematerializable will get the same answer. This enables the useful parts of the aggressive-remat option by default -- using AliasAnalysis to determine whether a memory location is invariant, and removes the questionable parts -- rematting operations with virtual register inputs that may not be live everywhere. llvm-svn: 83687
* isTriviallyReMaterializable checks theDan Gohman2009-10-091-1/+1
| | | | | | | TargetInstrDesc::isRematerializable flag, so it isn't necessary to do this check in its callers. llvm-svn: 83671
* Give Dan and my recent changes, machine LICM is now code size neutral.Evan Cheng2009-10-091-4/+0
| | | | llvm-svn: 83624
* Fix a logic error that caused non-rematable loop invariants loads to be ↵Evan Cheng2009-10-091-2/+1
| | | | | | licm'ed out of loop. llvm-svn: 83622
* Replace TargetInstrInfo::isInvariantLoad and its target-specificDan Gohman2009-10-071-3/+5
| | | | | | | | | implementations with a new MachineInstr::isInvariantLoad, which uses MachineMemOperands and is target-independent. This brings MachineLICM and other functionality to targets which previously lacked an isInvariantLoad implementation. llvm-svn: 83475
* Don't hoist or sink instructions with physreg uses if the physreg isDan Gohman2009-09-261-3/+12
| | | | | | | allocatable. Even if it doesn't appear to have any defs, it may latter on after register allocation. llvm-svn: 82834
* Unbreak MachineLICM for instructions that reference RIP on x86-64 too.Dan Gohman2009-09-251-2/+21
| | | | llvm-svn: 82825
* Convert DOUT to DEBUG(errs()...).Bill Wendling2009-08-221-9/+8
| | | | llvm-svn: 79754
* Tidy #includes.Dan Gohman2009-08-111-1/+0
| | | | llvm-svn: 78677
* More migration to raw_ostream, the water has dried up around the iostream hole.Daniel Dunbar2009-07-251-6/+7
| | | | | | | | | | - Some clients which used DOUT have moved to DEBUG. We are deprecating the "magic" DOUT behavior which avoided calling printing functions when the statement was disabled. In addition to being unnecessary magic, it had the downside of leaving code in -Asserts builds, and of hiding potentially unnecessary computations. llvm-svn: 77019
* MachineLICM CSE should match destination register classes; avoid hoisting ↵Evan Cheng2009-02-271-3/+13
| | | | | | implicit_def's. llvm-svn: 65592
* Machine LICM increases register pressure and it almost always increase code ↵Evan Cheng2009-02-051-0/+4
| | | | | | size. For now, disable it for optimizing for size. llvm-svn: 63856
* Teach machine licm to CSE hoisted instructions.Evan Cheng2009-02-051-23/+88
| | | | llvm-svn: 63854
* Don't call isInvariantLoad twice.Evan Cheng2009-02-041-9/+2
| | | | llvm-svn: 63729
* 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. llvm-svn: 63728
* 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. llvm-svn: 63725
* 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. llvm-svn: 62283
* Tidy up #includes, deleting a bunch of unnecessary #includes.Dan Gohman2009-01-051-1/+0
| | | | llvm-svn: 61715
* 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. llvm-svn: 61373
* Give MachineLICM a name, for -time-passes etc.Dan Gohman2008-12-181-0/+2
| | | | llvm-svn: 61184
* Switch the MachineOperand accessors back to the short names likeDan Gohman2008-10-031-1/+1
| | | | | | isReg, etc., from isRegister, etc. llvm-svn: 57006
* Tidy up several unbeseeming casts from pointer to intptr_t.Dan Gohman2008-09-041-1/+1
| | | | llvm-svn: 55779
* Cosmetic changes to Machine LICM. No functionality change.Bill Wendling2008-08-311-31/+36
| | | | llvm-svn: 55578
* Don't hoist instructions that define a physical register.Bill Wendling2008-08-201-1/+8
| | | | llvm-svn: 55074
* 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. llvm-svn: 54908
* Prevent option name conflict.Bill Wendling2008-07-071-1/+1
| | | | llvm-svn: 53166
* 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. llvm-svn: 51017
* Revert the previous commit. Go ahead and hoist rematerializable instructions.Bill Wendling2008-05-121-4/+0
| | | | llvm-svn: 50990
* 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. llvm-svn: 50987
OpenPOWER on IntegriCloud