summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/BranchFolding.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix tail merging to assign the (more) correct BasicBlock when splitting.Andrew Trick2013-06-241-1/+3
| | | | | | | | | | | This makes it possible to write unit tests that are less susceptible to minor code motion, particularly copy placement. block-placement.ll covers this case with -pre-RA-sched=source which will soon be default. One incorrectly named block is already fixed, but without this fix, enabling new coalescing and scheduling would cause more failures. llvm-svn: 184680
* When tail-merging multiple blocks, make sure to correctly update the live-in ↵Eli Friedman2011-07-061-0/+2
| | | | | | | | | | list on the merged block to correctly account for the live-outs of all the predecessors. They might not be the same in all cases (the testcase I have involves a PHI node where one of the operands is an IMPLICIT_DEF). Unfortunately, the testcase I have is large and confidential, so I don't have a test to commit at the moment; I'll see if I can come up with something smaller where this issue reproduces. <rdar://problem/9716278> llvm-svn: 134565
* Add 132986 back, but avoid non-determinism if a bb address gets reused.Rafael Espindola2011-06-141-0/+2
| | | | llvm-svn: 132995
* revert 132986 to see if the bots go green.Rafael Espindola2011-06-141-2/+0
| | | | llvm-svn: 132988
* Make the threshold used by branch folding softer. Before we would get aRafael Espindola2011-06-141-0/+2
| | | | | | | sharp all or nothing transition when one extra predecessor was added. Now we still test first ones for merging. llvm-svn: 132974
* Re-commit 131172 with fix. MachineInstr identity checks should check deadEvan Cheng2011-05-121-2/+5
| | | | | | | | | markers. In some cases a register def is dead on one path, but not on another. This is passing Clang self-hosting. llvm-svn: 131214
* Revert 131172 as it is causing clang to miscompile itself. I will tryRafael Espindola2011-05-111-5/+2
| | | | | | to provide a reduced testcase. llvm-svn: 131176
* Add a late optimization to BranchFolding that hoist common instruction sequencesEvan Cheng2011-05-111-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | at the start of basic blocks to their common predecessor. It's actually quite common (e.g. about 50 times in JM/lencod) and has shown to be a nice code size benefit. e.g. pushq %rax testl %edi, %edi jne LBB0_2 ## BB#1: xorb %al, %al popq %rdx ret LBB0_2: xorb %al, %al callq _foo popq %rdx ret => pushq %rax xorb %al, %al testl %edi, %edi je LBB0_2 ## BB#1: callq _foo LBB0_2: popq %rdx ret rdar://9145558 llvm-svn: 131172
* Tail merging pass shall not break up IT blocks. rdar://8115404Evan Cheng2010-06-221-2/+3
| | | | llvm-svn: 106517
* Split tail duplication into a separate pass. This is needed to avoidBob Wilson2009-11-261-8/+0
| | | | | | | | | 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
* Perform tail duplication only once, after tail merging is complete.Bob Wilson2009-11-171-3/+2
| | | | | | | It was too difficult to keep the heuristics for merging and duplication consistent. llvm-svn: 89105
* Make the BranchFolderPass class local to BranchFolding.cpp.Dan Gohman2009-11-121-14/+1
| | | | llvm-svn: 86928
* Promote MergePotentialsElt and SameTailElt to be regular classesDan Gohman2009-11-111-2/+49
| | | | | | | instead of typedefs for std::pair. This simplifies the type of SameTails, which previously was std::vector<std::pair<std::vector<std::pair<unsigned, MachineBasicBlock *> >::iterator, MachineBasicBlock::iterator> llvm-svn: 86885
* Check in the changes to this file too.Dan Gohman2009-11-111-3/+9
| | | | llvm-svn: 86873
* Revert r85346 change to control tail merging by CodeGenOpt::Level.Bob Wilson2009-10-281-7/+3
| | | | | | 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-3/+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
* Run branch folding if if-converter make some transformations.Evan Cheng2009-09-041-0/+84
llvm-svn: 80994
OpenPOWER on IntegriCloud