summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineBasicBlock.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Cache iterators. Some of these are expensive to create.Benjamin Kramer2012-02-101-14/+16
| | | | llvm-svn: 150214
* Preserve physreg kills in MachineBasicBlock::SplitCriticalEdge.Lang Hames2012-02-091-4/+7
| | | | | | | Failure to preserve kills was causing LiveIntervals to miss some EFLAGS live ranges. Unfortunately I've been unable to reduce a good test case yet. llvm-svn: 150152
* Update comment for r149070.Chad Rosier2012-01-261-3/+1
| | | | llvm-svn: 149075
* Replace the use of isPredicable() with isPredicated() inChad Rosier2012-01-261-3/+2
| | | | | | | | | MachineBasicBlock::canFallThrough(). We're interested in the state of the instruction (i.e., is this a barrier or not?), not if the instruction is predicable or not. rdar://10501092 llvm-svn: 149070
* Add some constantness to BranchProbabilityInfo and BlockFrequnencyInfo.Jakub Staszak2011-12-201-2/+12
| | | | llvm-svn: 146986
* - Add MachineInstrBundle.h and MachineInstrBundle.cpp. This includes a functionEvan Cheng2011-12-141-20/+58
| | | | | | | | | | to finalize MI bundles (i.e. add BUNDLE instruction and computing register def and use lists of the BUNDLE instruction) and a pass to unpack bundles. - Teach more of MachineBasic and MachineInstr methods to be bundle aware. - Switch Thumb2 IT block to MI bundles and delete the hazard recognizer hack to prevent IT blocks from being broken apart. llvm-svn: 146542
* Add bundle aware API for querying instruction properties and switch the codeEvan Cheng2011-12-071-3/+3
| | | | | | | | | | | | | | generator to it. For non-bundle instructions, these behave exactly the same as the MC layer API. For properties like mayLoad / mayStore, look into the bundle and if any of the bundled instructions has the property it would return true. For properties like isPredicable, only return true if *all* of the bundled instructions have the property. For properties like canFoldAsLoad, isCompare, conservatively return false for bundles. llvm-svn: 146026
* First chunk of MachineInstr bundle support.Evan Cheng2011-12-061-26/+69
| | | | | | | | | 1. Added opcode BUNDLE 2. Taught MachineInstr class to deal with bundled MIs 3. Changed MachineBasicBlock iterator to skip over bundled MIs; added an iterator to walk all the MIs 4. Taught MachineBasicBlock methods about bundled MIs llvm-svn: 145975
* Pretty-print basic block alignment.Jakob Stoklund Olesen2011-12-061-2/+6
| | | | llvm-svn: 145965
* Handle the case of a no-return invoke correctly. It actually still hasChandler Carruth2011-11-231-0/+8
| | | | | | | | | successors, they just are all landing pad successors. We handle this the same way as no successors. Comments attached for the next person to wade through here and another lovely test case courtesy of Benjamin Kramer's bugpoint reduction. llvm-svn: 145098
* Fix a devilish miscompile exposed by block placement. TheChandler Carruth2011-11-221-2/+8
| | | | | | | | | | | | | | | | | | | | | updateTerminator code didn't correctly handle EH terminators in one very specific case. AnalyzeBranch would find no terminator instruction, and so the fallback in updateTerminator is to assume fallthrough. This is correct, but the destination of the fallthrough was assumed to be the first successor. This is *almost always* true, but in certain cases the loop transformations will cause the landing pad to be the first successor! Instead of this brittle logic, actually look through the successors for a non-landing-pad accessor, and to assert if more than one is found. This will hopefully fix some (if not all) of the self host miscompiles with block placement. Thanks to Benjamin Kramer for reporting, Nick Lewycky for an initial stab at a reduction, and Duncan for endless advice on EH (which I know nothing about) as well as reviewing the actual fix. llvm-svn: 145062
* Update live-in lists when splitting critical edges.Jakob Stoklund Olesen2011-10-141-0/+5
| | | | | | Fixes PR10814. Patch by Jan Sjödin! llvm-svn: 141960
* - Rename TargetInstrDesc, TargetOperandInfo to MCInstrDesc and MCOperandInfo andEvan Cheng2011-06-281-1/+0
| | | | | | | | sink them into MC layer. - Added MCInstrInfo, which captures the tablegen generated static data. Chang TargetInstrInfo so it's based off MCInstrInfo. llvm-svn: 134021
* getSuccWeight returns now default 0 if Weights vector is empty.Jakub Staszak2011-06-171-2/+4
| | | | llvm-svn: 133271
* Allow empty Weights vector.Jakub Staszak2011-06-171-1/+2
| | | | llvm-svn: 133265
* Introduce MachineBranchProbabilityInfo class, which has similar API toJakub Staszak2011-06-161-7/+69
| | | | | | | | BranchProbabilityInfo (expect setEdgeWeight which is not available here). Branch Weights are kept in MachineBasicBlocks. To turn off this analysis set -use-mbpi=false. llvm-svn: 133184
* Test commit.Jakub Staszak2011-06-161-7/+7
| | | | llvm-svn: 133174
* Fix PR10046 by updating LiveVariables kill info when splitting live ranges.Jakob Stoklund Olesen2011-05-291-2/+39
| | | | | | | | | | | | | This only affects targets like Mips where branch instructions may kill virtual registers. Most other targets branch on flag values, so virtual registers are not involved. The problem is that MachineBasicBlock::updateTerminator deletes branches and inserts new ones while LiveVariables keeps a list of pointers to instructions that kill virtual registers. That list wasn't properly updated in MBB::SplitCriticalEdge. llvm-svn: 132298
* Simplify declarations slightly by using typedefs.Eli Friedman2011-04-181-4/+2
| | | | llvm-svn: 129720
* Add LiveIntervals::getLastSplitPoint().Jakob Stoklund Olesen2011-02-041-0/+10
| | | | | | | | A live range cannot be split everywhere in a basic block. A split must go before the first terminator, and if the variable is live into a landing pad, the split must happen before the call that can throw. llvm-svn: 124894
* Try for the third time to teach getFirstTerminator() about debug values.Jakob Stoklund Olesen2011-01-141-2/+3
| | | | | | This time let's rephrase to trick gcc-4.3 into not miscompiling. llvm-svn: 123432
* Revert r123419. It still breaks llvm-gcc-i386-linux-selfhost.Jakob Stoklund Olesen2011-01-141-16/+5
| | | | llvm-svn: 123423
* Try again to teach getFirstTerminator() about debug values.Jakob Stoklund Olesen2011-01-141-5/+16
| | | | | | Fix some callers to better deal with debug values. llvm-svn: 123419
* Teach frame lowering to ignore debug values after the terminators.Jakob Stoklund Olesen2011-01-131-0/+12
| | | | llvm-svn: 123399
* Speculatively revert r123384 to make llvm-gcc-i386-linux-selfhost buildbot ↵Devang Patel2011-01-131-16/+5
| | | | | | happy. llvm-svn: 123389
* Teach MachineBasicBlock::getFirstTerminator to ignore debug values.Jakob Stoklund Olesen2011-01-131-5/+16
| | | | | | | It will still return an iterator that points to the first terminator or end(), but there may be DBG_VALUE instructions following the first terminator. llvm-svn: 123384
* Add missing space in debug outputJakob Stoklund Olesen2011-01-131-1/+1
| | | | llvm-svn: 123351
* Replace TargetRegisterInfo::printReg with a PrintReg class that also works ↵Jakob Stoklund Olesen2011-01-091-12/+1
| | | | | | | | | | without a TRI instance. Print virtual registers numbered from 0 instead of the arbitrary FirstVirtualRegister. The first virtual register is printed as %vreg0. TRI::NoRegister is printed as %noreg. llvm-svn: 123107
* Don't try to split weird critical edges that really aren't:Jakob Stoklund Olesen2010-11-021-2/+12
| | | | | | | | | | | | | | | BB#1: derived from LLVM BB %bb.nph28 Live Ins: %AL Predecessors according to CFG: BB#0 TEST8rr %reg16384<kill>, %reg16384, %EFLAGS<imp-def>; GR8:%reg16384 JNE_4 <BB#2>, %EFLAGS<imp-use,kill> JMP_4 <BB#2> Successors according to CFG: BB#2 BB#2 These double CFG edges only ever occur in bugpoint-generated code, so there is no need to attempt something clever. llvm-svn: 117992
* Add SkipPHIsAndLabels from PHIElimination to MachineBasicBlock. It is neededJakob Stoklund Olesen2010-10-301-0/+7
| | | | | | elsewhere. llvm-svn: 117763
* Teach MachineBasicBlock::print() to annotate instructions and blocks withJakob Stoklund Olesen2010-10-261-3/+15
| | | | | | SlotIndexes when available. llvm-svn: 117392
* Properly update MachineDominators when splitting critical edge.Evan Cheng2010-08-191-2/+25
| | | | llvm-svn: 111574
* Move the decision logic whether it's a good idea to split a critical edge to ↵Evan Cheng2010-08-171-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
* Fix debug message.Evan Cheng2010-08-171-1/+1
| | | | llvm-svn: 111250
* PHI elimination should not break back edge. It can cause some significant ↵Evan Cheng2010-08-171-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
* Add a getFirstNonPHI utility function.Dan Gohman2010-07-071-0/+7
| | | | llvm-svn: 107778
* Reapply r107655 with fixes; insert the pseudo instruction intoDan Gohman2010-07-061-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
* Revert r107655.Dan Gohman2010-07-061-25/+5
| | | | llvm-svn: 107668
* Fix a bunch of custom-inserter functions to handle the case whereDan Gohman2010-07-061-5/+25
| | | | | | the pseudo instruction is not at the end of the block. llvm-svn: 107655
* Move PHIElimination's SplitCriticalEdge for MachineBasicBlocks outDan Gohman2010-06-221-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
* Add a DebugLoc parameter to TargetInstrInfo::InsertBranch(). ThisStuart Hastings2010-06-171-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
* Eliminate MachineBasicBlock::const_livein_iterator and makeDan Gohman2010-04-131-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
* Reapply r100056. It doesn't look like it's the one that's causing a failure.Bill Wendling2010-04-011-35/+23
| | | | llvm-svn: 100065
* Revert r100056. It was causing a failure on MSVC.Bill Wendling2010-03-311-23/+35
| | | | llvm-svn: 100062
* Rewrite CorrectExtraCFGEdges() to make it more understandable.Bill Wendling2010-03-311-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
* Rip out the 'is temporary' nonsense from the MCContext interface toChris Lattner2010-03-301-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
* eliminate the now-unneeded context argument of MBB::getSymbol()Chris Lattner2010-03-131-2/+3
| | | | llvm-svn: 98451
* set the temporary bit on MCSymbols correctly.Chris Lattner2010-03-101-5/+4
| | | | llvm-svn: 98124
* move isOnlyReachableByFallthrough out of MachineBasicBlock into AsmPrinter,Chris Lattner2010-02-171-30/+0
| | | | | | | and add a sparc implementation that knows about delay slots. Patch by Nathan Keynes! llvm-svn: 96492
* Fix comments to reflect renaming elsewhere.Dale Johannesen2010-02-101-1/+1
| | | | llvm-svn: 95730
OpenPOWER on IntegriCloud