Commit Graph

115 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen 7c699f92cd Don't do illegal cross-class coalescing.
llvm-svn: 98044
2010-03-09 03:56:06 +00:00
Evan Cheng 19e44b4510 - Make the machine cse dumb coalescer (as opposed to the more awesome simple
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
2010-03-09 03:21:12 +00:00
Evan Cheng c9e8621268 Don't waste time trying to CSE labels, phis, inline asm. Definitely avoid cse implicit-def for obvious performance reason.
llvm-svn: 98009
2010-03-08 23:49:12 +00:00
Evan Cheng 6ec41ee33c Restrict machine cse to really trivial coalescing. Leave the heavy lifting to a real coalescer.
llvm-svn: 98007
2010-03-08 23:28:08 +00:00
Evan Cheng 0f5f54784a Don't update physical register def.
llvm-svn: 97861
2010-03-06 01:14:19 +00:00
Evan Cheng 1abd1a9f4b Avoid cse load instructions unless they are known to be invariant loads.
llvm-svn: 97747
2010-03-04 21:18:08 +00:00
Evan Cheng 36f8aabb2c Look ahead a bit to determine if a physical register def that is not marked dead is really alive. This is necessary to catch a lot of common cse opportunities for targets like x86.
llvm-svn: 97706
2010-03-04 01:33:55 +00:00
Evan Cheng 2922641a7e Fix a logic error. An instruction that has a live physical register def cannot be CSE'ed, but it *can* be used to replace a common subexpression.
llvm-svn: 97688
2010-03-03 23:59:08 +00:00
Evan Cheng 0abbb399c9 Re-apply r97667 but with a little bit of thought put into the patch. This 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
2010-03-03 23:27:36 +00:00
Dan Gohman a791914e2c Revert 97667. It broke a bunch of tests.
llvm-svn: 97673
2010-03-03 22:40:03 +00:00
Evan Cheng 0dd0c47b7e Move DenseMapInfo for MachineInstr* to MachineInstr.h
llvm-svn: 97667
2010-03-03 21:47:16 +00:00
Evan Cheng b386cd3871 Machine CSE work in progress. It's doing some CSE now. But implicit def of physical registers are getting in the way.
llvm-svn: 97664
2010-03-03 21:20:05 +00:00
Evan Cheng 4eab008b5a Work in progress. Finding some cse now.
llvm-svn: 97635
2010-03-03 02:48:20 +00:00
Evan Cheng 10194a425c Fix typo.
llvm-svn: 97577
2010-03-02 19:02:27 +00:00
Evan Cheng 036aa49d2e Add skeleton of a machine level cse pass.
llvm-svn: 97543
2010-03-02 02:38:24 +00:00