summaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineBasicBlock.cpp
AgeCommit message (Collapse)Author
2010-04-13Eliminate MachineBasicBlock::const_livein_iterator and makeDan Gohman
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 Wendling
llvm-svn: 100065
2010-03-31Revert r100056. It was causing a failure on MSVC.Bill Wendling
llvm-svn: 100062
2010-03-31Rewrite CorrectExtraCFGEdges() to make it more understandable.Bill Wendling
* 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 Lattner
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 Lattner
llvm-svn: 98451
2010-03-10set the temporary bit on MCSymbols correctly.Chris Lattner
llvm-svn: 98124
2010-02-17move isOnlyReachableByFallthrough out of MachineBasicBlock into AsmPrinter,Chris Lattner
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 Johannesen
llvm-svn: 95730
2010-02-09move target-independent opcodes out of TargetInstrInfoChris Lattner
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 Lattner
the AsmPrinter::GetMBBSymbol. llvm-svn: 94515
2010-01-20make findDebugLoc a class methodDale Johannesen
llvm-svn: 94032
2010-01-20Move findDebugLoc somewhere more central. FixDale Johannesen
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 Olesen
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 Greene
llvm-svn: 92542
2009-12-16Helpful comment added. Some code cleanup. No functional change.Bill Wendling
llvm-svn: 91479
2009-12-15Revert these. They may have been causing 483_xalancbmk to fail:Bill Wendling
$ 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 Wendling
llvm-svn: 91274
2009-12-11Don't try to move a MBB into the fall-through position if it's a landing pad orBill Wendling
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 Wendling
build bots. llvm-svn: 91113
2009-12-11Address comments on last patch:Bill Wendling
- 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 Wendling
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 Gohman
llvm-svn: 90633
2009-12-03improve portability to avoid conflicting with std::next in c++'0x.Chris Lattner
Patch by Howard Hinnant! llvm-svn: 90365
2009-11-26Split tail duplication into a separate pass. This is needed to avoidBob Wilson
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 Olesen
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 Olesen
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 Cheng
llvm-svn: 89130
2009-11-12Move the utility function UpdateTerminator() from CodePlacementOpt() intoJim Grosbach
MachineBasicBlock so other passes can utilize it. llvm-svn: 86947
2009-11-11Add support for tail duplication to BranchFolding, and extendDan Gohman
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 Gohman
- 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 Gohman
llvm-svn: 85571
2009-10-30Initial target-independent CodeGen support for BlockAddresses.Dan Gohman
llvm-svn: 85556
2009-08-23remove std::ostream versions of printing stuff for MBB and MF,Chris Lattner
upgrading a few things to use raw_ostream llvm-svn: 79811
2009-08-23remove dead PrefixPrinter class.Chris Lattner
llvm-svn: 79796
2009-08-23random cleanups.Chris Lattner
llvm-svn: 79794
2009-08-18fix another bozo bugChris Lattner
llvm-svn: 79313
2009-08-18fix accidentally inverted conditional and add comment.Chris Lattner
llvm-svn: 79312
2009-08-18turn this conditional into something humans might actuallyChris Lattner
be able to understand ;-) llvm-svn: 79311
2009-08-03Re-apply LiveInterval index dumping patch, with fixes suggested by BillDavid Greene
and others. llvm-svn: 78003
2009-07-24Move more to raw_ostream, provide support for writing MachineBasicBlock,Daniel Dunbar
LiveInterval, etc to raw_ostream. llvm-svn: 76965
2009-07-21revert r76602, 76603, and r76615, pending design discussions.Chris Lattner
llvm-svn: 76646
2009-07-21Add PrefixPrinter arguments to the dump routines for MachineFunction andDavid Greene
MachineBasicBlock. We'll use these shortly. llvm-svn: 76603
2009-05-05If a MachineBasicBlock has multiple ways of reaching another block,Dan Gohman
allow it to have multiple CFG edges to that block. This is needed to allow MachineBasicBlock::isOnlyReachableByFallthrough to work correctly. This fixes PR4126. llvm-svn: 71018
2009-03-31Reapply 68073, with fixes. EH Landing-pad basic blocks are notDan Gohman
entered via fall-through. Don't miss fallthroughs from blocks terminated by conditional branches. Also, move isOnlyReachableByFallthrough out of line. llvm-svn: 68129
2009-03-30Constify arguments in isSuccessor and isLayoutSuccessor.Dan Gohman
llvm-svn: 68054
2009-01-08Delete unnecessary parens around return values.Dan Gohman
llvm-svn: 61950
2008-10-03Switch the MachineOperand accessors back to the short names likeDan Gohman
isReg, etc., from isRegister, etc. llvm-svn: 57006
2008-10-02Add a new MachineBasicBlock utility function, isLayoutSuccessor, thatDan Gohman
can be used when deciding if a block can transfer control to another via a fall-through instead of a branch. llvm-svn: 56968
2008-09-13Remove isImm(), isReg(), and friends, in favor of Dan Gohman
isImmediate(), isRegister(), and friends, to avoid confusion about having two different names with the same meaning. I'm not attached to the longer names, and would be ok with changing to the shorter names if others prefer it. llvm-svn: 56189