aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineBasicBlock.cpp
AgeCommit message (Collapse)AuthorFilesLines
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
2009-07-24Move more to raw_ostream, provide support for writing MachineBasicBlock,Daniel Dunbar1-1/+11
LiveInterval, etc to raw_ostream. llvm-svn: 76965
2009-07-21revert r76602, 76603, and r76615, pending design discussions.Chris Lattner1-3/+1
llvm-svn: 76646
2009-07-21Add PrefixPrinter arguments to the dump routines for MachineFunction andDavid Greene1-1/+3
MachineBasicBlock. We'll use these shortly. llvm-svn: 76603
2009-05-05If a MachineBasicBlock has multiple ways of reaching another block,Dan Gohman1-4/+2
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 Gohman1-0/+10
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 Gohman1-2/+2
llvm-svn: 68054
2009-01-08Delete unnecessary parens around return values.Dan Gohman1-1/+1
llvm-svn: 61950
2008-10-03Switch the MachineOperand accessors back to the short names likeDan Gohman1-1/+1
isReg, etc., from isRegister, etc. llvm-svn: 57006
2008-10-02Add a new MachineBasicBlock utility function, isLayoutSuccessor, thatDan Gohman1-0/+5
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 Gohman1-1/+2
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
2008-07-28Fold the useful features of alist and alist_node into ilist, andDan Gohman1-24/+12
a new ilist_node class, and remove them. Unlike alist_node, ilist_node doesn't attempt to manage storage itself, so it avoids the associated problems, including being opaque in gdb. Adjust the Recycler class so that it doesn't depend on alist_node. Also, change it to use explicit Size and Align parameters, allowing it to work when the largest-sized node doesn't have the greatest alignment requirement. Change MachineInstr's MachineMemOperand list from a pool-backed alist to a std::list for now. llvm-svn: 54146
2008-07-17Re-introduce LeakDetector support for MachineInstrs and MachineBasicBlocks.Dan Gohman1-0/+12
Fix a leak that this turned up in LowerSubregs.cpp. And, comment a leak in LiveIntervalAnalysis.cpp. llvm-svn: 53746
2008-07-07Pool-allocation for MachineInstrs, MachineBasicBlocks, andDan Gohman1-53/+53
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
2008-05-05Added addition atomic instrinsics and, or, xor, min, and max.Mon P Wang1-0/+13
llvm-svn: 50663
2008-04-24- Check if a register is livein before removing it. It may have already been ↵Evan Cheng1-0/+5
removed. - Do not iterate over SmallPtrSet, the order of iteration is not deterministic. llvm-svn: 50209
2008-02-28Add a quick and dirty "loop aligner pass". x86 uses it to align its loops to ↵Evan Cheng1-0/+1
16-byte boundaries. llvm-svn: 47703
2008-02-26Rename PrintableName to Name.Bill Wendling1-1/+1
llvm-svn: 47629
2008-02-26Change "Name" to "AsmName" in the target register info. Gee, a refactoring toolBill Wendling1-1/+1
would have been a Godsend here! llvm-svn: 47625
2008-02-10Rename MRegisterInfo to TargetRegisterInfo.Dan Gohman1-7/+7
llvm-svn: 46930
2008-01-07remove #includageChris Lattner1-1/+1
llvm-svn: 45697
2008-01-07rename TargetInstrDescriptor -> TargetInstrDesc.Chris Lattner1-3/+3
Make MachineInstr::getDesc return a reference instead of a pointer, since it can never be null. llvm-svn: 45695
2008-01-07Rename MachineInstr::getInstrDescriptor -> getDesc(), which reflectsChris Lattner1-4/+3
that it is cheap and efficient to get. Move a variety of predicates from TargetInstrInfo into TargetInstrDescriptor, which makes it much easier to query a predicate when you don't have TII around. Now you can use MI->getDesc()->isBranch() instead of going through TII, and this is much more efficient anyway. Not all of the predicates have been moved over yet. Update old code that used MI->getInstrDescriptor()->Flags to use the new predicates in many places. llvm-svn: 45674
2008-01-01Implement automatically updated def/use lists for all MachineInstr register Chris Lattner1-4/+55
operands. The lists are currently kept in MachineRegisterInfo, but it does not yet provide an iterator interface to them. llvm-svn: 45477