Commit Graph

16 Commits

Author SHA1 Message Date
Evan Cheng 2d23779e7d Remove PHINodeTraits and use MachineInstrExpressionTrait instead.
llvm-svn: 97687
2010-03-03 23:55:49 +00:00
Jakob Stoklund Olesen 012d4369f6 Dead code elimination
llvm-svn: 96837
2010-02-23 00:28:53 +00:00
Jakob Stoklund Olesen 5d583da601 Dead code elimination.
llvm-svn: 96496
2010-02-17 19:13:56 +00:00
Dale Johannesen d7eb693643 Handle DBG_VALUE mixed with labels when doing PHI
elimination.  Before a DBG_VALUE could affect codegen.
The solution here is imperfect and not final.

llvm-svn: 96318
2010-02-16 01:57:28 +00:00
Chris Lattner b06015aa69 move target-independent opcodes out of TargetInstrInfo
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
2010-02-09 19:54:29 +00:00
Jakob Stoklund Olesen ec20a88a57 Reuse lowered phi nodes.
Tail duplication produces lots of identical phi nodes in different basic
blocks. Teach PHIElimination to reuse the join registers when lowering a phi
node that is identical to an already lowered node. This saves virtual
registers, and more importantly it avoids creating copies the the coalescer
doesn't know how to eliminate.

Teach LiveIntervalAnalysis about the phi joins with multiple uses.

This patch significantly reduces code size produced by -pre-regalloc-taildup.

llvm-svn: 91549
2009-12-16 18:55:53 +00:00
Jakob Stoklund Olesen defc47088a Move PHIElimination::isLiveOut method to LiveVariables.
We want LiveVariables clients to use methods rather than accessing the
getVarInfo data structure directly. That way it will be possible to change the
LiveVariables representation.

llvm-svn: 90240
2009-12-01 17:13:31 +00:00
Jakob Stoklund Olesen bc630aca39 Be more clever about calculating live variables through new basic blocks.
When splitting a critical edge, the registers live through the edge are:

- Used in a PHI instruction, or
- Live out from the predecessor, and
- Live in to the successor.

This allows the coalescer to eliminate even more phi joins.

llvm-svn: 89530
2009-11-21 02:05:21 +00:00
Jakob Stoklund Olesen 736888f7fa Don't require LiveVariables for PHIElimination. Enable critical edge splitting
when LiveVariables is available.

The -split-phi-edges is now gone, and so is the hack to disable it when using
the local register allocator. The PHIElimination pass no longer has
LiveVariables as a prerequisite - that is what broke the local allocator.
Instead we do critical edge splitting when possible - that is when
LiveVariables is available.

llvm-svn: 89213
2009-11-18 18:01:35 +00:00
Jakob Stoklund Olesen ad205d6102 Fix PHIElimination optimization that uses MBB->getBasicBlock.
The BasicBlock associated with a MachineBasicBlock does not necessarily
correspond to the code in the MBB.

Don't insert a new IR BasicBlock when splitting critical edges. We are not
supposed to modify the IR during codegen, and we should be able to do just
fine with a NULL BB.

llvm-svn: 88707
2009-11-13 21:56:15 +00:00
Jakob Stoklund Olesen 4f7fd3baeb Fix liveness calculation when splitting critical edges during PHI elimination.
- Edges are split before any phis are eliminated, so the code is SSA.

- Create a proper IR BasicBlock for the split edges.

- LiveVariables::addNewBlock now has same syntax as
  MachineDominatorTree::addNewBlock. Algorithm calculates predecessor live-out
  set rather than successor live-in set.

This feature still causes some miscompilations.

llvm-svn: 86867
2009-11-11 19:31:31 +00:00
Jakob Stoklund Olesen 4453dc976b Teach PHIElimination to split critical edges when -split-phi-edges is enabled.
Critical edges leading to a PHI node are split when the PHI source variable is
live out from the predecessor block. This help the coalescer eliminate more
PHI joins.

llvm-svn: 86725
2009-11-10 22:01:05 +00:00
Jakob Stoklund Olesen 19f235e455 Refactoring: Extract method PHIElimination::isLiveOut().
Clean up some whitespace.
No functional changes.

llvm-svn: 86724
2009-11-10 22:00:56 +00:00
Evan Cheng fc4eef183b Fix comment for consistency sake.
llvm-svn: 80993
2009-09-04 07:46:30 +00:00
Lang Hames a77a3c3782 Added PHI Def & Kill tracking to PHIElimination pass.
llvm-svn: 76849
2009-07-23 04:34:03 +00:00
Lang Hames aa037759b2 Exposed PHIElimination pass within CodeGen.
llvm-svn: 76688
2009-07-21 23:47:33 +00:00