summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/PHIElimination.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Avoid being influenced by dbg_value instructions.Evan Cheng2010-03-251-1/+1
| | | | llvm-svn: 99465
* Remove PHINodeTraits and use MachineInstrExpressionTrait instead.Evan Cheng2010-03-031-31/+0
| | | | llvm-svn: 97687
* Keep track of phi join registers explicitly in LiveVariables.Jakob Stoklund Olesen2010-02-231-0/+1
| | | | | | | | Previously, LiveIntervalAnalysis would infer phi joins by looking for multiply defined registers. That doesn't work if the phi join is implicitly defined in all but one of the predecessors. llvm-svn: 96994
* Dead code eliminationJakob Stoklund Olesen2010-02-231-5/+0
| | | | llvm-svn: 96837
* Dead code elimination.Jakob Stoklund Olesen2010-02-171-4/+0
| | | | llvm-svn: 96496
* move target-independent opcodes out of TargetInstrInfoChris Lattner2010-02-091-10/+10
| | | | | | | | | 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-3/+3
| | | | llvm-svn: 92566
* Turn off critical edge splitting for landing pads. The introduction of aBill Wendling2009-12-171-3/+4
| | | | | | | | | | non-landing pad basic block as the successor to a block that ends in an unconditional jump will cause block folding to remove the added block as a successor. Thus eventually removing it AND the landing pad entirely. Critical edge splitting is an optimization, so we can safely turn it off when dealing with landing pads. llvm-svn: 91634
* Reuse lowered phi nodes.Jakob Stoklund Olesen2009-12-161-13/+86
| | | | | | | | | | | | | | 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
* improve portability to avoid conflicting with std::next in c++'0x.Chris Lattner2009-12-031-3/+3
| | | | | | Patch by Howard Hinnant! llvm-svn: 90365
* Move PHIElimination::isLiveOut method to LiveVariables.Jakob Stoklund Olesen2009-12-011-48/+2
| | | | | | | | 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
* Be more clever about calculating live variables through new basic blocks.Jakob Stoklund Olesen2009-11-211-18/+2
| | | | | | | | | | | | 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
* Place new basic blocks immediately after their predecessor when splittingJakob Stoklund Olesen2009-11-191-7/+7
| | | | | | | | | critical edges in PHIElimination. This has a huge impact on regalloc performance, and we recover almost all of the 10% compile time regression that edge splitting introduced. llvm-svn: 89381
* Don't require LiveVariables for PHIElimination. Enable critical edge splittingJakob Stoklund Olesen2009-11-181-27/+7
| | | | | | | | | | | | 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
* Fix inverted test and add testcase from failing self-host.Jakob Stoklund Olesen2009-11-181-9/+7
| | | | llvm-svn: 89167
* Disable -split-phi-edges to unbreak the buildbotsJakob Stoklund Olesen2009-11-171-1/+1
| | | | llvm-svn: 89142
* Never call UpdateTerminator() when AnalyzeBranch would fail.Jakob Stoklund Olesen2009-11-171-1/+13
| | | | llvm-svn: 89139
* Enable -split-phi-edges by default, except when -regalloc=local.Jakob Stoklund Olesen2009-11-171-3/+15
| | | | | | | The local register allocator doesn't like it when LiveVariables is run. We should also disable edge splitting under -O0, but that has to wait a bit. llvm-svn: 89125
* Revert 89021. It's miscompiling llvm-gcc driver driver at -O0.Evan Cheng2009-11-171-1/+1
| | | | llvm-svn: 89082
* Enable -split-phi-edges by defaultJakob Stoklund Olesen2009-11-171-1/+1
| | | | llvm-svn: 89021
* Fix for the original bug in PR5495 - Look at uses as well as defs when ↵Lang Hames2009-11-161-5/+5
| | | | | | | | determining the PHI-copy insert point. - Patch by Andrew Canis! llvm-svn: 88880
* Fix bug in -split-phi-edges.Jakob Stoklund Olesen2009-11-141-3/+14
| | | | | | | | | | When splitting an edge after a machine basic block with fall-through, we forgot to insert a jump instruction. Fix this by calling updateTerminator() on the fall-through block when relevant. Also be more precise in PHIElimination::isLiveIn. llvm-svn: 88728
* Update MachineDominator informationJakob Stoklund Olesen2009-11-141-6/+9
| | | | llvm-svn: 88727
* Fix PHIElimination optimization that uses MBB->getBasicBlock.Jakob Stoklund Olesen2009-11-131-30/+18
| | | | | | | | | | | 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
* Fix -Asserts warning.Daniel Dunbar2009-11-121-2/+1
| | | | llvm-svn: 87024
* Fix liveness calculation when splitting critical edges during PHI elimination.Jakob Stoklund Olesen2009-11-111-31/+50
| | | | | | | | | | | | | | - 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
* Teach PHIElimination to split critical edges when -split-phi-edges is enabled.Jakob Stoklund Olesen2009-11-101-4/+76
| | | | | | | | 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
* Refactoring: Extract method PHIElimination::isLiveOut().Jakob Stoklund Olesen2009-11-101-69/+59
| | | | | | | Clean up some whitespace. No functional changes. llvm-svn: 86724
* Use setPreservesAll and setPreservesCFG in CodeGen passes.Dan Gohman2009-07-311-5/+6
| | | | llvm-svn: 77754
* For real this time: PHI Def & Kill tracking added to PHIElimination.Lang Hames2009-07-231-3/+5
| | | | llvm-svn: 76865
* Added PHI Def & Kill tracking to PHIElimination pass.Lang Hames2009-07-231-4/+11
| | | | llvm-svn: 76849
* Exposed PHIElimination pass within CodeGen.Lang Hames2009-07-211-74/+21
| | | | llvm-svn: 76688
* Revert 74898. It broke several tests.Evan Cheng2009-07-071-9/+3
| | | | llvm-svn: 74925
* if the terminator is a branch depending upon the side effects of aSanjiv Gupta2009-07-071-3/+9
| | | | | | | | previous cmp; a copy can not be inserted here if the copy insn also has side effects. We don't have access to the attributes of copy insn here; so just play safe by finding a safe locations for branch terminators. llvm-svn: 74898
* LiveVariables::VarInfo contains an AliveBlocks BitVector, which has as manyJeffrey Yasskin2009-05-261-4/+2
| | | | | | | | | | entries as there are basic blocks in the function. LiveVariables::getVarInfo creates a VarInfo struct for every register in the function, leading to quadratic space use. This patch changes the BitVector to a SparseBitVector, which doesn't help the worst-case memory use but does reduce the actual use in very long functions with short-lived variables. llvm-svn: 72426
* Eliminate VarInfo::UsedBlocks.Evan Cheng2009-05-261-3/+0
| | | | llvm-svn: 72411
* Reapply r67049, with the test adjusted for darwinDuncan Sands2009-03-171-39/+61
| | | | | | (which produces "call L_f$stub" rather than "call f"). llvm-svn: 67079
* --- Reverse-merging (from foreign repository) r67049 into '.':Bill Wendling2009-03-161-61/+39
| | | | | | | | | | | | | | | | U test/CodeGen/X86/2009-03-13-PHIElimBug.ll D test/CodeGen/X86/2009-03-16-PHIElimInLPad.ll U lib/CodeGen/PHIElimination.cpp r67049 was causing this failure: Running /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/test/CodeGen/X86/dg.exp ... FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/test/CodeGen/X86/2009-03-13-PHIElimBug.ll for PR3784 Failed with exit(1) at line 1 while running: llvm-as < /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/test/CodeGen/X86/2009-03-13-PHIElimBug.ll | llc -march=x86 | /usr/bin/grep -A 2 {call f} | /usr/bin/grep movl child process exited abnormally llvm-svn: 67051
* Tweak the fix for PR3784: be less sensitive about justDuncan Sands2009-03-161-39/+61
| | | | | | | | | | | | | | | | | | how invokes are set up. The fix could be disturbed by register copies coming after the EH_LABEL, and also didn't behave quite right when it was the invoke result that was used in a phi node. Also (see new testcase) fix another phi elimination bug while there: register copies in the landing pad need to come after the EH_LABEL, because that's where execution branches to when unwinding. If they come before the EH_LABEL then they will never be executed... Also tweak the original testcase so it doesn't use a no-longer existing counter. The accumulated phi elimination changes fix two of seven Ada testsuite failures that turned up after landing pad critical edge splitting was turned off. So there's probably more to come. llvm-svn: 67049
* Fix PR3784: If the source of a phi comes from a bb ended with an invoke, ↵Evan Cheng2009-03-131-0/+40
| | | | | | | | make sure the copy is inserted before the try range (unless it's used as an input to the invoke, then insert it after the last use), not at the end of the bb. Also re-apply r66140 which was disabled as a workaround. llvm-svn: 66976
* Explicitly pass in debug location information to BuildMI.Bill Wendling2009-02-031-1/+1
| | | | llvm-svn: 63599
* Rename getAnalysisToUpdate to getAnalysisIfAvailable.Duncan Sands2009-01-281-1/+1
| | | | llvm-svn: 63198
* Tidy up several unbeseeming casts from pointer to intptr_t.Dan Gohman2008-09-041-1/+1
| | | | llvm-svn: 55779
* Pool-allocation for MachineInstrs, MachineBasicBlocks, andDan Gohman2008-07-071-1/+1
| | | | | | | | | | | MachineMemOperands. The pools are owned by MachineFunctions. This drastically reduces the number of calls to malloc/free made during the "Emit" phase of scheduling, as well as later phases in CodeGen. Combined with other changes, this speeds up the "instruction selection" phase of CodeGen by 10% in some cases. llvm-svn: 53212
* - Remove calls to copyKillDeadInfo which is an N^2 function. Instead, ↵Evan Cheng2008-07-031-17/+23
| | | | | | | | propagate kill / dead markers as new instructions are constructed in foldMemoryOperand, convertToThressAddress, etc. - Also remove LiveVariables::instructionChanged, etc. Replace all calls with cheaper calls which update VarInfo kill list. llvm-svn: 53097
* Cosmetic changes.Evan Cheng2008-06-191-3/+5
| | | | llvm-svn: 52479
* Change class' public PassInfo variables to by initialized with theDan Gohman2008-05-131-1/+1
| | | | | | | | | | | address of the PassInfo directly instead of calling getPassInfo. This eliminates a bunch of dynamic initializations of static data. Also, fold RegisterPassBase into PassInfo, make a bunch of its data members const, and rearrange some code to initialize data members in constructors instead of using setter member functions. llvm-svn: 51022
* 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
* Constify isSourceDefinedByImplicitDef function. Otherwise, just formattingBill Wendling2008-05-121-45/+38
| | | | | | changes that don't change functionality. llvm-svn: 51004
* If all sources of a PHI node are defined by an implicit_def, just emit an ↵Evan Cheng2008-05-101-7/+11
| | | | | | implicit_def instead of a copy. llvm-svn: 50927
OpenPOWER on IntegriCloud