summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/PHIElimination.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* If a PHI node has a single implicit_def source, replace it with an ↵Evan Cheng2008-04-111-5/+19
| | | | | | implicit_def instead of a copy. llvm-svn: 49543
* Undo PHI elimination copy placement patch. This causes coalescing ↵Evan Cheng2008-04-041-30/+1
| | | | | | (performace) issues. llvm-svn: 49198
* - PHI elimination also eliminates implicit_def that fits into a PHI node ↵Evan Cheng2008-04-031-42/+84
| | | | | | | | rather than copying it. - Be (slightly) smarter about where to place the copies. llvm-svn: 49165
* Remove #include<map> from LiveVariables.h. Not referenced.Evan Cheng2008-04-021-1/+2
| | | | llvm-svn: 49099
* Refactor code. Remove duplicated functions that basically do the same thing asEvan Cheng2008-03-051-1/+1
| | | | | | findRegisterUseOperandIdx, findRegisterDefOperandIndx. Fix some naming inconsistencies. llvm-svn: 47927
* Rename MRegisterInfo to TargetRegisterInfo.Dan Gohman2008-02-101-1/+1
| | | | llvm-svn: 46930
* Remove DefInst from LiveVariables::VarInfo. Use the facilities on ↵Owen Anderson2008-01-151-4/+0
| | | | | | MachineRegisterInfo instead. llvm-svn: 46016
* Don't recalculate the loop info and loop dominators analyses if they'reBill Wendling2008-01-041-0/+2
| | | | | | preserved. llvm-svn: 45596
* Move copyRegToReg from MRegisterInfo to TargetInstrInfo. This is part of theOwen Anderson2007-12-311-3/+3
| | | | | | Machine-level API cleanup instigated by Chris. llvm-svn: 45470
* Rename SSARegMap -> MachineRegisterInfo in keeping with the idea Chris Lattner2007-12-311-3/+3
| | | | | | | | | | | | | | that "machine" classes are used to represent the current state of the code being compiled. Given this expanded name, we can start moving other stuff into it. For now, move the UsedPhysRegs and LiveIn/LoveOuts vectors from MachineFunction into it. Update all the clients to match. This also reduces some needless #includes, such as MachineModuleInfo from MachineFunction. llvm-svn: 45467
* Add new shorter predicates for testing machine operands for various types: Chris Lattner2007-12-301-7/+5
| | | | | | | | | | | | e.g. MO.isMBB() instead of MO.isMachineBasicBlock(). I don't plan on switching everything over, so new clients should just start using the shorter names. Remove old long accessors, switching everything over to use the short accessor: getMachineBasicBlock() -> getMBB(), getConstantPoolIndex() -> getIndex(), setMachineBasicBlock -> setMBB(), etc. llvm-svn: 45464
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* Bring UsedBlocks back. StrongPHIElimination needs this information.Owen Anderson2007-11-081-0/+3
| | | | llvm-svn: 43866
* Allow copyRegToReg to emit cross register classes copies.Evan Cheng2007-09-261-2/+2
| | | | | | Tested with "make check"! llvm-svn: 42346
* Fix typo in comment.Nick Lewycky2007-05-061-1/+1
| | | | llvm-svn: 36873
OpenPOWER on IntegriCloud