summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/BranchFolding.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* assert(0) -> LLVM_UNREACHABLE.Torok Edwin2009-07-111-1/+2
| | | | | | | | | Make llvm_unreachable take an optional string, thus moving the cerr<< out of line. LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for NDEBUG builds. llvm-svn: 75379
* Fix PR4188. TailMerging can't tolerate inexactDale Johannesen2009-05-111-0/+15
| | | | | | sucessor info. llvm-svn: 71478
* Turns out AnalyzeBranch can modify the mbb being analyzed. This is a nastyEvan Cheng2009-02-091-6/+6
| | | | | | | | suprise to some callers, e.g. register coalescer. For now, add an parameter that tells AnalyzeBranch whether it's safe to modify the mbb. A better solution is out there, but I don't have time to deal with it right now. llvm-svn: 64124
* Rename getAnalysisToUpdate to getAnalysisIfAvailable.Duncan Sands2009-01-281-1/+1
| | | | llvm-svn: 63198
* Delete unnecessary parens around return values.Dan Gohman2009-01-081-1/+1
| | | | llvm-svn: 61950
* Add a newline after this debug output.Bill Wendling2008-12-101-1/+1
| | | | llvm-svn: 60861
* Add a sanity-check to tablegen to catch the case where isSimpleLoadDan Gohman2008-12-031-1/+1
| | | | | | | | | is set but mayLoad is not set. Fix all the problems this turned up. Change code to not use isSimpleLoad instead of mayLoad unless it really wants isSimpleLoad. llvm-svn: 60459
* Increase default setting of tail-merge-threshold toDale Johannesen2008-10-271-1/+1
| | | | | | 150, based on llvm-test measurements. llvm-svn: 58225
* Switch the MachineOperand accessors back to the short names likeDan Gohman2008-10-031-2/+2
| | | | | | isReg, etc., from isRegister, etc. llvm-svn: 57006
* Mark several codegen passes as preserving all analysis.Evan Cheng2008-09-221-6/+6
| | | | llvm-svn: 56469
* Remove isImm(), isReg(), and friends, in favor of Dan Gohman2008-09-131-1/+1
| | | | | | | | | 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
* Tidy up several unbeseeming casts from pointer to intptr_t.Dan Gohman2008-09-041-1/+1
| | | | llvm-svn: 55779
* Fix SmallVector's size calculation so that a size of 0 isDan Gohman2008-08-221-2/+2
| | | | | | | handled correctly, and change a few SmallVector uses to use size 0 to more clearly reflect their intent. llvm-svn: 55181
* Convert uses of std::vector in TargetInstrInfo to SmallVector. This change ↵Owen Anderson2008-08-141-14/+14
| | | | | | had to be propoagated down into all the targets and up into all clients of this API. llvm-svn: 54802
* Fix PR2609. If a label is deleted, then it needsDuncan Sands2008-07-291-4/+3
| | | | | | | | to be marked invalid regardless of whether it is a debug, an exception handling or (hopefully) a GC label. llvm-svn: 54172
* Pool-allocation for MachineInstrs, MachineBasicBlocks, andDan Gohman2008-07-071-3/+5
| | | | | | | | | | | 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
* Fix longstanding thinko: don't excludeDale Johannesen2008-07-011-2/+1
| | | | | | | predessors of exit blocks from tail merging consideration. llvm-svn: 52985
* Split ISD::LABEL into ISD::DBG_LABEL and ISD::EH_LABEL, eliminatingDan Gohman2008-07-011-2/+2
| | | | | | | | | | | | | | | | the need for a flavor operand, and add a new SDNode subclass, LabelSDNode, for use with them to eliminate the need for a label id operand. Change instruction selection to let these label nodes through unmodified instead of creating copies of them. Teach the MachineInstr emitter how to emit a MachineInstr directly from an ISD label node. This avoids the need for allocating SDNodes for the label id and flavor value, as well as SDNodes for each of the post-isel label, label id, and label flavor. llvm-svn: 52943
* Use the transferSuccessors helper function.Dan Gohman2008-06-191-5/+1
| | | | llvm-svn: 52495
* Rewrite a loop to avoid using iterators pointing toDale Johannesen2008-05-231-4/+6
| | | | | | | elements that have been erased. Based on a patch by Nicolas Capens. llvm-svn: 51485
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-131-6/+6
| | | | | | | several things that were neither in an anonymous namespace nor static but not intended to be global. llvm-svn: 51017
* Be more aggressive about tail-merging small blocksDale Johannesen2008-05-121-1/+12
| | | | | | | if those blocks consist entirely of common instructions; merging will not add an extra branch in this case. llvm-svn: 51006
* Further rework of tail merge algorithm. Not quiteDale Johannesen2008-05-121-111/+77
| | | | | | | | semantically identical, but little difference in either results or execution speed; but it's much easier to read, at least IMO. llvm-svn: 50999
* Remove an evil vector bool. Cosmetic refactoring,Dale Johannesen2008-05-091-62/+85
| | | | | | no functional change. llvm-svn: 50921
* Rewrite tail merging algorithm to handle theDale Johannesen2008-05-091-87/+115
| | | | | | | | case where there are multiple blocks with a large number of common tail instructions more efficiently (compile time optimization). llvm-svn: 50916
* Make several variable declarations static.Dan Gohman2008-05-061-1/+1
| | | | llvm-svn: 50696
* Teach branch folding pass about implicit_def instructions. Unfortunately we ↵Evan Cheng2008-04-101-1/+56
| | | | | | can't just eliminate them since register scavenger expects every register use to be defined. However, we can delete them when there are no intra-block uses. Carefully removing some implicit def's which enable more blocks to be optimized away. llvm-svn: 49461
* Add a quick and dirty "loop aligner pass". x86 uses it to align its loops to ↵Evan Cheng2008-02-281-1/+1
| | | | | | 16-byte boundaries. llvm-svn: 47703
* PR1909: Tail merging pass ran wild. It makes no sense to merge blocks in ↵Evan Cheng2008-02-191-3/+12
| | | | | | order to save a single instruction since a branch will be inserted for each BB. llvm-svn: 47301
* Rename MRegisterInfo to TargetRegisterInfo.Dan Gohman2008-02-101-2/+2
| | | | llvm-svn: 46930
* Use empty() instead of comparing size() with zero.Dan Gohman2008-01-291-1/+1
| | | | llvm-svn: 46514
* rename TargetInstrDescriptor -> TargetInstrDesc.Chris Lattner2008-01-071-5/+5
| | | | | | | Make MachineInstr::getDesc return a reference instead of a pointer, since it can never be null. llvm-svn: 45695
* Rename MachineInstr::getInstrDescriptor -> getDesc(), which reflectsChris Lattner2008-01-071-14/+11
| | | | | | | | | | | | | | | 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
* rename isLoad -> isSimpleLoad due to evan's desire to have such a predicate.Chris Lattner2008-01-061-1/+1
| | | | llvm-svn: 45667
* rename isStore -> mayStore to more accurately reflect what it captures.Chris Lattner2008-01-061-1/+1
| | | | llvm-svn: 45656
* 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
* Improve branch folding by recgonizing that explict successor relationships ↵Christopher Lamb2007-12-101-0/+5
| | | | | | impact the value of fall-through choices. llvm-svn: 44785
* Changed XXX to FIXME, and added comment to the README fileBill Wendling2007-10-251-1/+1
| | | | llvm-svn: 43359
* Added comment explaining why we are doing this check.Bill Wendling2007-10-251-0/+5
| | | | llvm-svn: 43353
* Don't branch fold inline asm statements.Bill Wendling2007-10-191-1/+2
| | | | llvm-svn: 43191
* More explicit keywords.Dan Gohman2007-08-021-1/+1
| | | | llvm-svn: 40757
* If assertions are not enabled, we should return False here.Duncan Sands2007-07-111-5/+4
| | | | llvm-svn: 38535
* Make this work with GLIBCXX_DEBUG.David Greene2007-07-101-1/+8
| | | | llvm-svn: 38516
* Fix misue of iterator pointing to erased object. Uncovered byDavid Greene2007-06-291-4/+5
| | | | | | _GLIBCXX_DEBUG. llvm-svn: 37793
* Move CorrectExtraCFGEdges() from BranchFolding.cpp to a MachineBasicBlock ↵Evan Cheng2007-06-181-75/+4
| | | | | | method. llvm-svn: 37633
* Make throttle a hidden parameter, per review.Dale Johannesen2007-06-081-6/+11
| | | | llvm-svn: 37511
* Throttle tail merging; handling blocks with large numbers of predecessorsDale Johannesen2007-06-081-2/+6
| | | | | | is too slow. llvm-svn: 37509
* Tail merging wasn't working for predecessors of landing pads. PR 1496.Dale Johannesen2007-06-041-0/+22
| | | | llvm-svn: 37427
* Move ReplaceUsesOfBlockWith() out of BranchFolding into a MachineBasicBlock ↵Evan Cheng2007-06-041-40/+2
| | | | | | general facility. llvm-svn: 37408
OpenPOWER on IntegriCloud