summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineCSE.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Back out r130862; it appears to be breaking bootstrap.Eli Friedman2011-05-041-43/+27
| | | | llvm-svn: 130867
* Teach MachineCSE how to do simple cross-block CSE involving physregs. This ↵Eli Friedman2011-05-041-27/+43
| | | | | | allows, for example, eliminating duplicate cmpl's on x86. Part of rdar://problem/8259436 . llvm-svn: 130862
* Fix a couple of places where changes are made but not tracked.Evan Cheng2011-04-111-2/+6
| | | | llvm-svn: 129287
* fit in 80 cols and use MBB::isSuccessor instead of a handChris Lattner2011-01-101-5/+4
| | | | | | rolled std::find. llvm-svn: 123164
* Simplify a bunch of isVirtualRegister() and isPhysicalRegister() logic.Jakob Stoklund Olesen2011-01-101-2/+2
| | | | | | | | These functions not longer assert when passed 0, but simply return false instead. No functional change intended. llvm-svn: 123155
* Do not model all INLINEASM instructions as having unmodelled side effects.Evan Cheng2011-01-071-1/+1
| | | | | | | | | | Instead encode llvm IR level property "HasSideEffects" in an operand (shared with IsAlignStack). Added MachineInstrs::hasUnmodeledSideEffects() to check the operand when the instruction is an INLINEASM. This allows memory instructions to be moved around INLINEASM instructions. llvm-svn: 123044
* Use a RecyclingAllocator to allocate values for MachineCSE's ScopedHashTable forCameron Zwarich2011-01-031-3/+7
| | | | | | a 28% speedup of MachineCSE time on 403.gcc. llvm-svn: 122735
* Teach machine cse to commute instructions.Evan Cheng2010-12-151-2/+19
| | | | llvm-svn: 121903
* Teach machine cse to eliminate instructions with multiple physreg uses and ↵Evan Cheng2010-10-291-50/+45
| | | | | | defs. rdar://8610857. llvm-svn: 117745
* Get rid of static constructors for pass registration. Instead, every pass ↵Owen Anderson2010-10-191-1/+3
| | | | | | | | | | | | | | | | | exposes an initializeMyPassFunction(), which must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize the pass's dependencies. Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h before parsing commandline arguments. I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass registration/creation, please send the testcase to me directly. llvm-svn: 116820
* Begin adding static dependence information to passes, which will allow us toOwen Anderson2010-10-121-1/+5
| | | | | | | | | perform initialization without static constructors AND without explicit initialization by the client. For the moment, passes are required to initialize both their (potential) dependencies and any passes they preserve. I hope to be able to relax the latter requirement in the future. llvm-svn: 116334
* Now with fewer extraneous semicolons!Owen Anderson2010-10-071-1/+1
| | | | llvm-svn: 115996
* Add MachineRegisterInfo::constrainRegClass and use it in MachineCSE.Jakob Stoklund Olesen2010-10-061-7/+2
| | | | | | | | This function is intended to be used when inserting a machine instruction that trivially restricts the legal registers, like LEA requiring a GR32_NOSP argument. llvm-svn: 115875
* Machine CSE was forgetting to clear some data structures.Evan Cheng2010-09-171-0/+7
| | | | llvm-svn: 114222
* Fix a potential bug that can cause miscomparison with and without debug info.Evan Cheng2010-09-171-1/+1
| | | | llvm-svn: 114220
* Machine CSE preserves CFG. Pass manager was freeing machineloopinfo after ↵Evan Cheng2010-08-171-0/+1
| | | | | | machine cse before. llvm-svn: 111281
* Reapply r110396, with fixes to appease the Linux buildbot gods.Owen Anderson2010-08-061-1/+1
| | | | llvm-svn: 110460
* Revert r110396 to fix buildbots.Owen Anderson2010-08-061-1/+1
| | | | llvm-svn: 110410
* Don't use PassInfo* as a type identifier for passes. Instead, use the ↵Owen Anderson2010-08-051-1/+1
| | | | | | | | address of the static ID member as the sole unique type identifier. Clean up APIs related to this change. llvm-svn: 110396
* Fix batch of converting RegisterPass<> to INTIALIZE_PASS().Owen Anderson2010-07-211-2/+2
| | | | llvm-svn: 109045
* Remove many calls to TII::isMoveInstr. Targets should be producing COPY anyway.Jakob Stoklund Olesen2010-07-161-30/+4
| | | | | | TII::isMoveInstr is going tobe completely removed. llvm-svn: 108507
* Convert EXTRACT_SUBREG to COPY when emitting machine instrs.Jakob Stoklund Olesen2010-07-081-0/+22
| | | | | | | | | EXTRACT_SUBREG no longer appears as a machine instruction. Use COPY instead. Add isCopy() checks in many places using isMoveInstr() and isExtractSubreg(). The isMoveInstr hook will be removed later. llvm-svn: 107879
* Detect and handle COPY in many places.Jakob Stoklund Olesen2010-07-031-2/+2
| | | | | | | This code is transitional, it will soon be possible to eliminate isExtractSubreg, isInsertSubreg, and isMoveInstr in most places. llvm-svn: 107547
* Re-apply 105308 with fix.Evan Cheng2010-06-041-7/+13
| | | | llvm-svn: 105502
* Revert 105308.Bob Wilson2010-06-031-1/+4
| | | | llvm-svn: 105399
* Enable machine cse of instructions which define physical registers.Evan Cheng2010-06-021-4/+1
| | | | llvm-svn: 105308
* Make this LookAheadLimit, not the uninitialized LookAheadLeft.Eric Christopher2010-05-211-1/+1
| | | | | | Evan please verify! llvm-svn: 104408
* Allow machine cse to cse instructions which define physical registers. ↵Evan Cheng2010-05-211-27/+81
| | | | | | Controlled by option -machine-cse-phys-defs. llvm-svn: 104385
* Add a utility function for conservatively clearing kill flags, and makeDan Gohman2010-05-131-1/+4
| | | | | | use of it in MachineCSE. llvm-svn: 103726
* Rewrite machine cse to avoid recursion.Evan Cheng2010-04-211-11/+85
| | | | llvm-svn: 101964
* Typo.Evan Cheng2010-04-201-1/+1
| | | | llvm-svn: 101914
* After trivial coalescing, the MI being visited may have become a copy. Avoid ↵Evan Cheng2010-04-021-1/+5
| | | | | | | | adding it to CSE hash table since copies aren't being considered for CSE and they may be deleted. rdar://7819990 llvm-svn: 100170
* dbg_value may end a block.Evan Cheng2010-03-241-4/+4
| | | | llvm-svn: 99378
* Code clean up.Evan Cheng2010-03-231-6/+6
| | | | llvm-svn: 99319
* Fix debug_value handling.Dale Johannesen2010-03-111-2/+6
| | | | llvm-svn: 98224
* Add a couple more heuristics to neuter machine cse some more.Evan Cheng2010-03-101-13/+57
| | | | | | | | | | | 1. Be careful with cse "cheap" expressions. e.g. constant materialization. Only cse them when the common expression is local or in a direct predecessor. We don't want cse of cheap instruction causing other expressions to be spilled. 2. Watch out for the case where the expression doesn't itself uses a virtual register. e.g. lea of frame object. If the common expression itself is used by copies (common for passing addresses to function calls), don't perform the cse. Since these expressions do not use a register, it creates a live range but doesn't close any, we want to be very careful with increasing register pressure. Note these are heuristics so machine cse doesn't make register allocator unhappy. Once we have proper live range splitting and re-materialization support in place, these should be evaluated again. Now machine cse is almost always a win on llvm nightly tests on x86 and x86_64. llvm-svn: 98121
* Allow more cross-rc coalescing.Evan Cheng2010-03-091-10/+13
| | | | llvm-svn: 98048
* Don't do illegal cross-class coalescing.Jakob Stoklund Olesen2010-03-091-1/+1
| | | | llvm-svn: 98044
* - Make the machine cse dumb coalescer (as opposed to the more awesome simpleEvan Cheng2010-03-091-13/+57
| | | | | | | | | coalescer) handle sub-register classes. - Add heuristics to avoid non-profitable cse. Given the current lack of live range splitting, avoid cse when an expression has PHI use and the would be new use is in a BB where the expression wasn't already being used. llvm-svn: 98043
* Don't waste time trying to CSE labels, phis, inline asm. Definitely avoid ↵Evan Cheng2010-03-081-0/+4
| | | | | | cse implicit-def for obvious performance reason. llvm-svn: 98009
* Restrict machine cse to really trivial coalescing. Leave the heavy lifting ↵Evan Cheng2010-03-081-0/+3
| | | | | | to a real coalescer. llvm-svn: 98007
* Don't update physical register def.Evan Cheng2010-03-061-2/+3
| | | | llvm-svn: 97861
* Avoid cse load instructions unless they are known to be invariant loads.Evan Cheng2010-03-041-10/+36
| | | | llvm-svn: 97747
* Look ahead a bit to determine if a physical register def that is not marked ↵Evan Cheng2010-03-041-6/+61
| | | | | | dead is really alive. This is necessary to catch a lot of common cse opportunities for targets like x86. llvm-svn: 97706
* Fix a logic error. An instruction that has a live physical register def ↵Evan Cheng2010-03-031-2/+5
| | | | | | cannot be CSE'ed, but it *can* be used to replace a common subexpression. llvm-svn: 97688
* Re-apply r97667 but with a little bit of thought put into the patch. This ↵Evan Cheng2010-03-031-65/+3
| | | | | | implements a special DenseMapInfo trait for DenseMap<MachineInstr*> that compare the value of the MachineInstr rather than the pointer value. Since the hashing and equality test functions ignore defs it's useful for doing CSE kind optimization. llvm-svn: 97678
* Revert 97667. It broke a bunch of tests.Dan Gohman2010-03-031-0/+63
| | | | llvm-svn: 97673
* Move DenseMapInfo for MachineInstr* to MachineInstr.hEvan Cheng2010-03-031-63/+0
| | | | llvm-svn: 97667
* Machine CSE work in progress. It's doing some CSE now. But implicit def of ↵Evan Cheng2010-03-031-24/+61
| | | | | | physical registers are getting in the way. llvm-svn: 97664
* Work in progress. Finding some cse now.Evan Cheng2010-03-031-4/+88
| | | | llvm-svn: 97635
OpenPOWER on IntegriCloud