summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/IfConversion.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Allow small blocks to be duplicated to enable if-conversion.Evan Cheng2007-06-151-25/+99
| | | | llvm-svn: 37590
* No really, clear predcessors states.Evan Cheng2007-06-141-7/+8
| | | | llvm-svn: 37581
* If BB is predicated, invalidate its predecessor(s) which would if-convert ↵Evan Cheng2007-06-141-3/+7
| | | | | | it. It needs to be re-analyzed. llvm-svn: 37580
* Fix typo.Evan Cheng2007-06-141-1/+1
| | | | llvm-svn: 37577
* Fix some stupid bugs that have effectively disabled if-conversion.Evan Cheng2007-06-141-1/+7
| | | | llvm-svn: 37575
* TypoEvan Cheng2007-06-131-1/+1
| | | | llvm-svn: 37566
* Now if-converting all 4 variants of triangles.Evan Cheng2007-06-121-24/+40
| | | | llvm-svn: 37565
* Restructure code to reduce ifcvt compile time cost.Evan Cheng2007-06-111-155/+193
| | | | llvm-svn: 37543
* Fix the build.Reid Spencer2007-06-101-1/+2
| | | | llvm-svn: 37537
* Don't change CFG during analysis stage. Do so during ifcvt and invalidate ↵Evan Cheng2007-06-091-56/+106
| | | | | | predecessors accordingly. llvm-svn: 37531
* Carefully remove extraneous CFG edges after each ifcvt.Evan Cheng2007-06-081-24/+51
| | | | llvm-svn: 37529
* Correct transfer predicate information.Evan Cheng2007-06-081-8/+6
| | | | llvm-svn: 37524
* Hidden options to help debugging ifcvt issues.Evan Cheng2007-06-081-2/+32
| | | | llvm-svn: 37523
* Allow more cmp / bcc to be predicated; clean up triangle ifcvt checking code.Evan Cheng2007-06-081-144/+135
| | | | llvm-svn: 37518
* Only remove the edge from entry to false if false block is merged.Evan Cheng2007-06-071-2/+2
| | | | llvm-svn: 37503
* ifcvt a triangle: don't merge ifcvt block with rejoin block if it can fall ↵Evan Cheng2007-06-071-17/+29
| | | | | | through to it. If merged, the resulting block is not a candidate for iterative ifcvting since it contains both predicated and non-predicated code. llvm-svn: 37487
* Lots of bug fixes. Now finally in a reasonable state.Evan Cheng2007-06-071-78/+104
| | | | llvm-svn: 37485
* Quick patch to fix the build, based on what it appears Evan meant to write.Owen Anderson2007-06-061-1/+1
| | | | | | Evan, please check that this is in fact correct. llvm-svn: 37471
* Lots of bug fixes.Evan Cheng2007-06-061-40/+76
| | | | llvm-svn: 37467
* If a unconditional branch is added to branch to the false path during ifcvt, ↵Evan Cheng2007-06-061-6/+33
| | | | | | the predicated block cannot be iteratively ifcvted. llvm-svn: 37456
* Minor statistics counting bug.Evan Cheng2007-06-061-3/+5
| | | | llvm-svn: 37451
* Fix a couple of typos and be smarter about order of blocks when ifcvt a diamond.Evan Cheng2007-06-061-17/+30
| | | | llvm-svn: 37449
* Fix diamond shape ifcvt bugs.Evan Cheng2007-06-051-61/+41
| | | | llvm-svn: 37444
* ReplaceUsesOfBlockWith() can modify the predecessors list.Evan Cheng2007-06-051-3/+4
| | | | llvm-svn: 37441
* Do not ifcvt if either true / false path is a backedge. Not profitable in ↵Evan Cheng2007-06-051-0/+3
| | | | | | almost all cases. llvm-svn: 37440
* I had a senior moment.Evan Cheng2007-06-051-3/+4
| | | | llvm-svn: 37433
* If the predicated block requires an early exit, end the block there and add ↵Evan Cheng2007-06-051-2/+3
| | | | | | a unconditional branch to false block. AnalyzeBranch() does not understand early exits. llvm-svn: 37430
OpenPOWER on IntegriCloud