aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineBasicBlock.cpp
AgeCommit message (Collapse)AuthorFilesLines
2010-08-19Properly update MachineDominators when splitting critical edge.Evan Cheng1-2/+25
llvm-svn: 111574
2010-08-17Move the decision logic whether it's a good idea to split a critical edge to ↵Evan Cheng1-9/+1
clients. Also fixed an erroneous check. An edge is only a back edge when the from and to blocks are in the same loop. llvm-svn: 111256
2010-08-17Fix debug message.Evan Cheng1-1/+1
llvm-svn: 111250
2010-08-17PHI elimination should not break back edge. It can cause some significant ↵Evan Cheng1-2/+9
code placement issues. rdar://8263994 good: LBB0_2: mov r2, r0 . . . mov r1, r2 bne LBB0_2 bad: LBB0_2: mov r2, r0 . . . @ BB#3: mov r1, r2 b LBB0_2 llvm-svn: 111221
2010-07-07Add a getFirstNonPHI utility function.Dan Gohman1-0/+7
llvm-svn: 107778
2010-07-06Reapply r107655 with fixes; insert the pseudo instruction intoDan Gohman1-5/+25
the block before calling the expansion hook. And don't put EFLAGS in a mbb's live-in list twice. llvm-svn: 107691
2010-07-06Revert r107655.Dan Gohman1-25/+5
llvm-svn: 107668
2010-07-06Fix a bunch of custom-inserter functions to handle the case whereDan Gohman1-5/+25
the pseudo instruction is not at the end of the block. llvm-svn: 107655
2010-06-22Move PHIElimination's SplitCriticalEdge for MachineBasicBlocks outDan Gohman1-0/+79
into a utility routine, teach it how to update MachineLoopInfo, and make use of it in MachineLICM to split critical edges on demand. llvm-svn: 106555
2010-06-17Add a DebugLoc parameter to TargetInstrInfo::InsertBranch(). ThisStuart Hastings1-6/+7
addresses a longstanding deficiency noted in many FIXMEs scattered across all the targets. This effectively moves the problem up one level, replacing eleven FIXMEs in the targets with eight FIXMEs in CodeGen, plus one path through FastISel where we actually supply a DebugLoc, fixing Radar 7421831. llvm-svn: 106243
2010-04-13Eliminate MachineBasicBlock::const_livein_iterator and makeDan Gohman1-4/+5
MachineBasicBlock::livein_iterator a const_iterator, because clients shouldn't ever be using the iterator interface to mutate the livein set. llvm-svn: 101147
2010-04-01Reapply r100056. It doesn't look like it's the one that's causing a failure.Bill Wendling1-35/+23
llvm-svn: 100065
2010-03-31Revert r100056. It was causing a failure on MSVC.Bill Wendling1-23/+35
llvm-svn: 100062
2010-03-31Rewrite CorrectExtraCFGEdges() to make it more understandable.Bill Wendling1-35/+23
* Set the "DestA" and "DestB" according to how they're understood by the method. I.e., if one or both of them should point to the "fall through" block, then point to the fall through block. * Improve the loop that removes superfluous edges to be more understandable. llvm-svn: 100056
2010-03-30Rip out the 'is temporary' nonsense from the MCContext interface toChris Lattner1-3/+3
create symbols. It is extremely error prone and a source of a lot of the remaining integrated assembler bugs on x86-64. This fixes rdar://7807601. llvm-svn: 99902
2010-03-13eliminate the now-unneeded context argument of MBB::getSymbol()Chris Lattner1-2/+3
llvm-svn: 98451
2010-03-10set the temporary bit on MCSymbols correctly.Chris Lattner1-5/+4
llvm-svn: 98124
2010-02-17move isOnlyReachableByFallthrough out of MachineBasicBlock into AsmPrinter,Chris Lattner1-30/+0
and add a sparc implementation that knows about delay slots. Patch by Nathan Keynes! llvm-svn: 96492
2010-02-10Fix comments to reflect renaming elsewhere.Dale Johannesen1-1/+1
llvm-svn: 95730
2010-02-09move target-independent opcodes out of TargetInstrInfoChris Lattner1-2/+1
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-01-26add a new MachineBasicBlock::getSymbol method, replacingChris Lattner1-1/+16
the AsmPrinter::GetMBBSymbol. llvm-svn: 94515
2010-01-20make findDebugLoc a class methodDale Johannesen1-9/+11
llvm-svn: 94032
2010-01-20Move findDebugLoc somewhere more central. FixDale Johannesen1-0/+17
more cases where debug declarations affect debug line info. llvm-svn: 93953
2010-01-15Don't make changes to the MBB in MachineBasicBlock::canFallThrough().Jakob Stoklund Olesen1-1/+1
This fixes the regression for -pre-regalloc-taildup in MultiSource/Applications/lambda-0.1.3. llvm-svn: 93541
2010-01-04Change errs() to dbgs().David Greene1-1/+2
llvm-svn: 92542
2009-12-16Helpful comment added. Some code cleanup. No functional change.Bill Wendling1-11/+27
llvm-svn: 91479
2009-12-15Revert these. They may have been causing 483_xalancbmk to fail:Bill Wendling1-29/+7
$ svn merge -c -91161 https://llvm.org/svn/llvm-project/llvm/trunk --- Reverse-merging r91161 into '.': U lib/CodeGen/BranchFolding.cpp U lib/CodeGen/MachineBasicBlock.cpp $ svn merge -c -91113 https://llvm.org/svn/llvm-project/llvm/trunk --- Reverse-merging r91113 into '.': G lib/CodeGen/MachineBasicBlock.cpp $ svn merge -c -91101 https://llvm.org/svn/llvm-project/llvm/trunk --- Reverse-merging r91101 into '.': U include/llvm/CodeGen/MachineBasicBlock.h G lib/CodeGen/MachineBasicBlock.cpp $ svn merge -c -91092 https://llvm.org/svn/llvm-project/llvm/trunk --- Reverse-merging r91092 into '.': G include/llvm/CodeGen/MachineBasicBlock.h G lib/CodeGen/MachineBasicBlock.cpp llvm-svn: 91376
2009-12-14Whitespace changes, comment clarification. No functional changes.Bill Wendling1-3/+3
llvm-svn: 91274
2009-12-11Don't try to move a MBB into the fall-through position if it's a landing pad orBill Wendling1-10/+3
branches only to a landing pad. Without this check, the compiler would go into an infinite loop because the branch to a landing pad is an "abnormal" edge which wasn't being taken into account. This is the meat of that fix: if (!PrevBB.canFallThrough() && !MBB->BranchesToLandingPad(MBB)) { The other stuff is simplification of the "branches to a landing pad" code. llvm-svn: 91161
2009-12-11Revert part of r91101 which was causing an infinite loop in the self-hostingBill Wendling1-3/+8
build bots. llvm-svn: 91113
2009-12-11Address comments on last patch:Bill Wendling1-13/+8
- Loosen the restrictions when checking of it branches to a landing pad. - Make the loop more efficient by checking the '.insert' return value. - Do cheaper checks first. llvm-svn: 91101
2009-12-11A machine basic block may end in an unconditional branch, however it may haveBill Wendling1-7/+36
more than one successor. Normally, these extra successors are dead. However, some of them may branch to exception handling landing pads. If we remove those successors, then the landing pads could go away if all predecessors to it are removed. Before, it was checking if the direct successor was the landing pad. But it could be the result of jumping through multiple basic blocks to get to it. If we were to only check for the existence of an EH_LABEL in the basic block and not remove successors if it's in there, then it could stop actually dead basic blocks from being removed. llvm-svn: 91092
2009-12-05Simplify this code: don't call AnalyzeBranch before doing simpler checks.Dan Gohman1-13/+13
llvm-svn: 90633
2009-12-03improve portability to avoid conflicting with std::next in c++'0x.Chris Lattner1-3/+4
Patch by Howard Hinnant! llvm-svn: 90365
2009-11-26Split tail duplication into a separate pass. This is needed to avoidBob Wilson1-0/+45
running tail duplication when doing branch folding for if-conversion, and we also want to be able to run tail duplication earlier to fix some reg alloc problems. Move the CanFallThrough function from BranchFolding to MachineBasicBlock so that it can be shared by TailDuplication. llvm-svn: 89904
2009-11-22Teach MachineBasicBlock::updateTerminator() to handle a failing ↵Jakob Stoklund Olesen1-2/+8
TII->ReverseBranchCondition(Cond) call. This fixes the MallocBench/cfrac test case regression. llvm-svn: 89608
2009-11-20Add MachineBasicBlock::getName, and use it in place of getBasicBlock()->getName.Jakob Stoklund Olesen1-0/+7
Fix debug code that assumes getBasicBlock never returns NULL. llvm-svn: 89428
2009-11-17Add a WriteAsOperand for MachineBasicBlock so MachineLoopInfo dump looks sane.Evan Cheng1-0/+5
llvm-svn: 89130
2009-11-12Move the utility function UpdateTerminator() from CodePlacementOpt() intoJim Grosbach1-0/+53
MachineBasicBlock so other passes can utilize it. llvm-svn: 86947
2009-11-11Add support for tail duplication to BranchFolding, and extendDan Gohman1-4/+1
tail merging support to handle more cases. - Recognize several cases where tail merging is beneficial even when the tail size is smaller than the generic threshold. - Make use of MachineInstrDesc::isBarrier to help detect non-fallthrough blocks. - Check for and avoid disrupting fall-through edges in more cases. llvm-svn: 86871
2009-10-31Make -print-machineinstrs more readable.Dan Gohman1-13/+18
- Be consistent when referring to MachineBasicBlocks: BB#0. - Be consistent when referring to virtual registers: %reg1024. - Be consistent when referring to unknown physical registers: %physreg10. - Be consistent when referring to known physical registers: %RAX - Be consistent when referring to register 0: %reg0 - Be consistent when printing alignments: align=16 - Print jump table contents. - Don't print host addresses, in general. - and various other cleanups. llvm-svn: 85682
2009-10-30Mention if a block has its address taken in debug output.Dan Gohman1-0/+1
llvm-svn: 85571
2009-10-30Initial target-independent CodeGen support for BlockAddresses.Dan Gohman1-1/+2
llvm-svn: 85556
2009-08-23remove std::ostream versions of printing stuff for MBB and MF,Chris Lattner1-10/+1
upgrading a few things to use raw_ostream llvm-svn: 79811
2009-08-23remove dead PrefixPrinter class.Chris Lattner1-6/+4
llvm-svn: 79796
2009-08-23random cleanups.Chris Lattner1-25/+24
llvm-svn: 79794
2009-08-18fix another bozo bugChris Lattner1-2/+2
llvm-svn: 79313
2009-08-18fix accidentally inverted conditional and add comment.Chris Lattner1-1/+4
llvm-svn: 79312
2009-08-18turn this conditional into something humans might actuallyChris Lattner1-8/+25
be able to understand ;-) llvm-svn: 79311
2009-08-03Re-apply LiveInterval index dumping patch, with fixes suggested by BillDavid Greene1-4/+6
and others. llvm-svn: 78003