summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/IfConversion.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* More dbg_value cleanup so the presence of debug info doesn't affect code-gen.Jim Grosbach2010-06-141-2/+21
| | | | | | | Make sure to skip the dbg_value instructions when moving dups out of the diamond. rdar://7797940 llvm-svn: 105965
* Cleanup. Process the dbg_values separatelyJim Grosbach2010-06-071-18/+16
| | | | llvm-svn: 105554
* Move exit check where it really belongs.Jim Grosbach2010-06-071-4/+4
| | | | llvm-svn: 105541
* Make if-conversion ignore dbg_value instructions in its analysis. rdar://7797940Jim Grosbach2010-06-041-4/+23
| | | | llvm-svn: 105498
* Change errs() to dbgs().David Greene2010-01-041-14/+14
| | | | llvm-svn: 92520
* Allow target to disable if-converting predicable instructions. e.g. NEON ↵Evan Cheng2009-11-211-1/+1
| | | | | | instructions under ARM mode. llvm-svn: 89541
* Revert r85346 change to control tail merging by CodeGenOpt::Level.Bob Wilson2009-10-281-7/+6
| | | | | | I'm going to redo this using the OptimizeForSize function attribute. llvm-svn: 85426
* Record CodeGen optimization level in the BranchFolding pass so that we canBob Wilson2009-10-271-6/+7
| | | | | | | | | | | | | | | | use it to control tail merging when there is a tradeoff between performance and code size. When there is only 1 instruction in the common tail, we have been merging. That can be good for code size but is a definite loss for performance. Now we will avoid tail merging in that case when the optimization level is "Aggressive", i.e., "-O3". Radar 7338114. Since the IfConversion pass invokes BranchFolding, it too needs to know the optimization level. Note that I removed the RegisterPass instantiation for IfConversion because it required a default constructor. If someone wants to keep that for some reason, we can add a default constructor with a hard-wired optimization level. llvm-svn: 85346
* Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.Nick Lewycky2009-10-251-1/+1
| | | | | | | Chris claims we should never have visibility_hidden inside any .cpp file but that's still not true even after this commit. llvm-svn: 85042
* Run branch folding if if-converter make some transformations.Evan Cheng2009-09-041-0/+8
| | | | llvm-svn: 80994
* remove various std::ostream version of printing methods fromChris Lattner2009-08-231-2/+2
| | | | | | | | MachineInstr and MachineOperand. This required eliminating a bunch of stuff that was using DOUT, I hope that bill doesn't mind me stealing his fun. ;-) llvm-svn: 79813
* Convert DOUT to DEBUG(errs()...).Bill Wendling2009-08-221-20/+20
| | | | llvm-svn: 79751
* More migration to raw_ostream, the water has dried up around the iostream hole.Daniel Dunbar2009-07-251-2/+2
| | | | | | | | | | - Some clients which used DOUT have moved to DEBUG. We are deprecating the "magic" DOUT behavior which avoided calling printing functions when the statement was disabled. In addition to being unnecessary magic, it had the downside of leaving code in -Asserts builds, and of hiding potentially unnecessary computations. llvm-svn: 77019
* llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.Torok Edwin2009-07-141-2/+2
| | | | | | | | | This adds location info for all llvm_unreachable calls (which is a macro now) in !NDEBUG builds. In NDEBUG builds location info and the message is off (it only prints "UREACHABLE executed"). llvm-svn: 75640
* Fix assert(0) conversion, as suggested by Chris.Torok Edwin2009-07-121-8/+8
| | | | llvm-svn: 75423
* Convert more assert(0)+abort() -> LLVM_UNREACHABLE,Torok Edwin2009-07-111-4/+10
| | | | | | and abort()/exit() -> llvm_report_error(). llvm-svn: 75363
* Fewer static variables, part 3 of many.Owen Anderson2009-06-241-2/+2
| | | | llvm-svn: 74140
* ifcvt should ignore cfg where true and false successors are the same.Evan Cheng2009-06-151-1/+12
| | | | llvm-svn: 73423
* Revert r71744. I must not have understood this correctly, because theBob Wilson2009-05-141-4/+9
| | | | | | assertion is failing for some tests. llvm-svn: 71779
* The IfConverter::MergeBlocks method appears to be used only to merge a basicBob Wilson2009-05-131-9/+4
| | | | | | | | block with its unique predecessor. Change the code to assert if that is not the case, instead of trying to handle situations where the block has multiple predecessors. llvm-svn: 71744
* Revert a portion of Dan's change r71018 that I'm convinced is wrong.Bob Wilson2009-05-131-1/+1
| | | | | | | | | | | | | | | | | | | Dan was trying to catch the case where a basic block ends with a conditional branch to the fall-through block. In this case, all the instructions have been moved out of FromBBI, leaving it empty. It cannot end with a conditional branch. As the existing comment indicates, it will always fall through to the next block. If the block already had the next block (NBB) listed as a successor, the preceding loop has a check for that and does not remove it. Thus, we need to check and add the successor only when it is not already listed. With Dan's change, the empty block often ends up with the fall-through successor listed twice. This exposed the problem in pr4195, where CodePlacementOpt did not handle the same predecessor listed more than once. It is also at least partially responsible for pr4202 and probably a similar issue with Thumb branches being out of range. llvm-svn: 71742
* Merge adjacent conditional.Bob Wilson2009-05-131-2/+0
| | | | llvm-svn: 71741
* Remove an unused variable.Bob Wilson2009-05-131-3/+0
| | | | llvm-svn: 71740
* Fix some typos and spelling and grammar, mostly in comments, but also oneBob Wilson2009-05-131-21/+20
| | | | | | field name. No functional changes. llvm-svn: 71739
* If a MachineBasicBlock has multiple ways of reaching another block,Dan Gohman2009-05-051-5/+3
| | | | | | | | 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
* Fix typo. Patch by nlewycky.Duncan Sands2008-11-041-1/+1
| | | | llvm-svn: 58709
* fix leakage of IfcvtTokensNuno Lopes2008-11-041-1/+5
| | | | llvm-svn: 58690
* Optimized FCMP_OEQ and FCMP_UNE for x86.Dan Gohman2008-10-211-15/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Where previously LLVM might emit code like this: ucomisd %xmm1, %xmm0 setne %al setp %cl orb %al, %cl jne .LBB4_2 it now emits this: ucomisd %xmm1, %xmm0 jne .LBB4_2 jp .LBB4_2 It has fewer instructions and uses fewer registers, but it does have more branches. And in the case that this code is followed by a non-fallthrough edge, it may be followed by a jmp instruction, resulting in three branch instructions in sequence. Some effort is made to avoid this situation. To achieve this, X86ISelLowering.cpp now recognizes FCMP_OEQ and FCMP_UNE in lowered form, and replace them with code that emits two branches, except in the case where it would require converting a fall-through edge to an explicit branch. Also, X86InstrInfo.cpp's branch analysis and transform code now knows now to handle blocks with multiple conditional branches. It uses loops instead of having fixed checks for up to two instructions. It can now analyze and transform code generated from FCMP_OEQ and FCMP_UNE. llvm-svn: 57873
* 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-1/+1
| | | | | | | 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-19/+20
| | | | | | had to be propoagated down into all the targets and up into all clients of this API. llvm-svn: 54802
* Pool-allocation for MachineInstrs, MachineBasicBlocks, andDan Gohman2008-07-071-1/+3
| | | | | | | | | | | 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
* Register if-converter pass for -debug-pass.Evan Cheng2008-06-041-1/+4
| | | | llvm-svn: 51931
* 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
* Update gcc 4.3 warnings fix patch with recent head changesAnton Korobeynikov2008-02-201-1/+2
| | | | llvm-svn: 47368
* Use empty() instead of comparing size() with zero.Dan Gohman2008-01-291-3/+3
| | | | llvm-svn: 46514
* rename TargetInstrDescriptor -> TargetInstrDesc.Chris Lattner2008-01-071-7/+7
| | | | | | | Make MachineInstr::getDesc return a reference instead of a pointer, since it can never be null. llvm-svn: 45695
* simplify some code using new predicatesChris Lattner2008-01-071-21/+19
| | | | llvm-svn: 45689
* Rename MachineInstr::getInstrDescriptor -> getDesc(), which reflectsChris Lattner2008-01-071-10/+8
| | | | | | | | | | | | | | | 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
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* Somehow this wasn't committed last time. M_CLOBBERS_PRED is gone.Evan Cheng2007-07-101-2/+5
| | | | llvm-svn: 38495
* Teach if-conversion about instructions that were already predicated, e.g. ↵Evan Cheng2007-07-061-3/+14
| | | | | | conditional move. llvm-svn: 37964
* Avoid if-converting simple block that ends with unconditional branch or ↵Evan Cheng2007-06-191-1/+4
| | | | | | fallthrough unless it branches / falls to the 'false' block. Not profitable, may end up increasing code size. llvm-svn: 37660
* Replace TargetInstrInfo::CanBeDuplicated() with a M_NOT_DUPLICABLE bit.Evan Cheng2007-06-191-2/+2
| | | | llvm-svn: 37643
* Fix some fragile code wrt CFG edge updating.Evan Cheng2007-06-181-74/+39
| | | | llvm-svn: 37634
* Properly remove duplicate instructions as result of diamond if-conversion. ↵Evan Cheng2007-06-181-103/+176
| | | | | | Other bug fixes. llvm-svn: 37623
* Really turn if-converter loose:Evan Cheng2007-06-161-166/+211
| | | | | | | | | | 1. Consider all possible ifcvt cases at once. No longer restricted to bottom up iterative approach. 2. Sort all possible cases based on a cost function. Perform the most profitable ones first invalidate others that target the same blocks. 3. Fixed a number of bugs related to block duplication. llvm-svn: 37613
* Not every predicable block can be safely duplicated.Evan Cheng2007-06-151-8/+35
| | | | llvm-svn: 37607
* MachineInstr::isPredicable() is no longer needed.Evan Cheng2007-06-151-6/+5
| | | | llvm-svn: 37599
* Extra edges are deleted later if needed.Evan Cheng2007-06-151-1/+0
| | | | llvm-svn: 37593
OpenPOWER on IntegriCloud