summaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineCSE.cpp
Commit message (Collapse)AuthorAge
...
* Remove many calls to TII::isMoveInstr. Targets should be producing COPY anyway.Jakob Stoklund Olesen2010-07-16
| | | | | | TII::isMoveInstr is going tobe completely removed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108507 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert EXTRACT_SUBREG to COPY when emitting machine instrs.Jakob Stoklund Olesen2010-07-08
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107879 91177308-0d34-0410-b5e6-96231b3b80d8
* Detect and handle COPY in many places.Jakob Stoklund Olesen2010-07-03
| | | | | | | This code is transitional, it will soon be possible to eliminate isExtractSubreg, isInsertSubreg, and isMoveInstr in most places. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107547 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-apply 105308 with fix.Evan Cheng2010-06-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105502 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 105308.Bob Wilson2010-06-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105399 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable machine cse of instructions which define physical registers.Evan Cheng2010-06-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105308 91177308-0d34-0410-b5e6-96231b3b80d8
* Make this LookAheadLimit, not the uninitialized LookAheadLeft.Eric Christopher2010-05-21
| | | | | | | Evan please verify! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104408 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow machine cse to cse instructions which define physical registers. ↵Evan Cheng2010-05-21
| | | | | | Controlled by option -machine-cse-phys-defs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104385 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a utility function for conservatively clearing kill flags, and makeDan Gohman2010-05-13
| | | | | | | use of it in MachineCSE. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103726 91177308-0d34-0410-b5e6-96231b3b80d8
* Rewrite machine cse to avoid recursion.Evan Cheng2010-04-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101964 91177308-0d34-0410-b5e6-96231b3b80d8
* Typo.Evan Cheng2010-04-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101914 91177308-0d34-0410-b5e6-96231b3b80d8
* After trivial coalescing, the MI being visited may have become a copy. Avoid ↵Evan Cheng2010-04-02
| | | | | | | | | adding it to CSE hash table since copies aren't being considered for CSE and they may be deleted. rdar://7819990 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100170 91177308-0d34-0410-b5e6-96231b3b80d8
* dbg_value may end a block.Evan Cheng2010-03-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99378 91177308-0d34-0410-b5e6-96231b3b80d8
* Code clean up.Evan Cheng2010-03-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99319 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix debug_value handling.Dale Johannesen2010-03-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98224 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a couple more heuristics to neuter machine cse some more.Evan Cheng2010-03-10
| | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98121 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow more cross-rc coalescing.Evan Cheng2010-03-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98048 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't do illegal cross-class coalescing.Jakob Stoklund Olesen2010-03-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98044 91177308-0d34-0410-b5e6-96231b3b80d8
* - Make the machine cse dumb coalescer (as opposed to the more awesome simpleEvan Cheng2010-03-09
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98043 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't waste time trying to CSE labels, phis, inline asm. Definitely avoid ↵Evan Cheng2010-03-08
| | | | | | cse implicit-def for obvious performance reason. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98009 91177308-0d34-0410-b5e6-96231b3b80d8
* Restrict machine cse to really trivial coalescing. Leave the heavy lifting ↵Evan Cheng2010-03-08
| | | | | | to a real coalescer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98007 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't update physical register def.Evan Cheng2010-03-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97861 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid cse load instructions unless they are known to be invariant loads.Evan Cheng2010-03-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97747 91177308-0d34-0410-b5e6-96231b3b80d8
* Look ahead a bit to determine if a physical register def that is not marked ↵Evan Cheng2010-03-04
| | | | | | dead is really alive. This is necessary to catch a lot of common cse opportunities for targets like x86. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97706 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a logic error. An instruction that has a live physical register def ↵Evan Cheng2010-03-03
| | | | | | cannot be CSE'ed, but it *can* be used to replace a common subexpression. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97688 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-apply r97667 but with a little bit of thought put into the patch. This ↵Evan Cheng2010-03-03
| | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97678 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 97667. It broke a bunch of tests.Dan Gohman2010-03-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97673 91177308-0d34-0410-b5e6-96231b3b80d8
* Move DenseMapInfo for MachineInstr* to MachineInstr.hEvan Cheng2010-03-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97667 91177308-0d34-0410-b5e6-96231b3b80d8
* Machine CSE work in progress. It's doing some CSE now. But implicit def of ↵Evan Cheng2010-03-03
| | | | | | physical registers are getting in the way. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97664 91177308-0d34-0410-b5e6-96231b3b80d8
* Work in progress. Finding some cse now.Evan Cheng2010-03-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97635 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typo.Evan Cheng2010-03-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97577 91177308-0d34-0410-b5e6-96231b3b80d8
* Add skeleton of a machine level cse pass.Evan Cheng2010-03-02
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97543 91177308-0d34-0410-b5e6-96231b3b80d8