summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Refactor to share code to find the position of a basic block successor in theBob Wilson2010-02-161-11/+17
| | | | | | terminator's list of successors. llvm-svn: 96377
* No need to look through bitcasts for DbgInfoIntrinsicVictor Hernandez2010-01-211-5/+0
| | | | llvm-svn: 94114
* Make RecursivelyDeleteTriviallyDeadInstructions,Dan Gohman2010-01-051-2/+5
| | | | | | | RecursivelyDeleteDeadPHINode, and DeleteDeadPHIs return a flag indicating whether they made any changes. llvm-svn: 92732
* Avoid going through the LLVMContext for type equality where it's safe to ↵Benjamin Kramer2010-01-051-1/+1
| | | | | | dereference the type pointer. llvm-svn: 92726
* Remove dead debug info intrinsics.Devang Patel2010-01-051-13/+0
| | | | | | | | | | Intrinsic::dbg_stoppoint Intrinsic::dbg_region_start Intrinsic::dbg_region_end Intrinsic::dbg_func_start AutoUpgrade simply ignores these intrinsics now. llvm-svn: 92557
* Remove unnecessary #include "llvm/LLVMContext.h".Nick Lewycky2009-12-081-1/+0
| | | | llvm-svn: 90836
* Add an assertion to catch indirectbr in SplitBlockPredecessors. ThisDan Gohman2009-11-051-2/+6
| | | | | | | | | | | | makes several optimization passes abort in cases where they're currently silently miscompiling code. Remove the indirectbr assertion from SplitEdge. Indirectbr is only a problem for critical edges, and SplitEdge defers to SplitCriticalEdge to handle those, and SplitCriticalEdge has its own assertion for indirectbr. llvm-svn: 86147
* change llvm::MergeBlockIntoPredecessor to not merge two blocks BB1->BB2 Chris Lattner2009-11-011-3/+7
| | | | | | | | | when BB2 has its address taken. Since it ends up doing BB2->rauw(BB1), this can cause the address of the entry block to be taken. Since it is generally undesirable to nuke blocks whose address is taken, even when we can, just unconditionally stop this xform. llvm-svn: 85708
* llvm::SplitEdge should refuse to split an edge from an indirectbr.Chris Lattner2009-10-311-0/+2
| | | | | | Fix CodeGenPrepare to not try to split edges from indirectbr. llvm-svn: 85690
* Revert r85667. LoopUnroll currently can't call utility functions whichDan Gohman2009-10-311-23/+47
| | | | | | | auto-update the DominatorTree because it doesn't keep the DominatorTree current while it works. llvm-svn: 85670
* Remove redundant code.Dan Gohman2009-10-311-3/+0
| | | | llvm-svn: 85668
* Merge the enhancements from LoopUnroll's FoldBlockIntoPredecessor intoDan Gohman2009-10-311-47/+23
| | | | | | | MergeBlockIntoPredecessor. This makes SimplifyCFG slightly more aggressive, and makes it unnecessary for LoopUnroll to have its own copy of this code. llvm-svn: 85667
* Factor out redundancy from clone() implementations.Devang Patel2009-10-271-1/+1
| | | | llvm-svn: 85327
* Fix SplitBlockPredecessors' LoopInfo updating code to handle the caseDan Gohman2009-10-191-8/+20
| | | | | | | | where a loop's header is being split and it has predecessors which are not contained by the most-nested loop which contains the loop. This fixes PR5235. llvm-svn: 84505
* Instruction::clone does not need to take an LLVMContext&. Remove that andNick Lewycky2009-09-271-1/+1
| | | | | | update all the callers. llvm-svn: 82889
* Re-apply r80926, with fixes: keep the domtree informed of new blocksDan Gohman2009-09-081-23/+69
| | | | | | | | | | | | | | | that get created during loop unswitching, and fix SplitBlockPredecessors' LCSSA updating code to create new PHIs instead of trying to just move existing ones. Also, optimize Loop::verifyLoop, since it gets called a lot. Use searches on a sorted list of blocks instead of calling the "contains" function, as is done in other places in the Loop class, since "contains" does a linear search. Also, don't call verifyLoop from LoopSimplify or LCSSA, as the PassManager is already calling verifyLoop as part of LoopInfo's verifyAnalysis. llvm-svn: 81221
* Revert r80926. It causes loop unswitch assertion and slow down some JIT ↵Evan Cheng2009-09-061-69/+23
| | | | | | tests significantly. llvm-svn: 81101
* Add a verifyAnalysis to LoopInfo, LoopSimplify, and LCSSA form that verifyDan Gohman2009-09-031-23/+69
| | | | | | | | | that these passes are properly preserved. Fix several transformation passes that claimed to preserve LoopSimplify form but weren't. llvm-svn: 80926
* Change PHINode::hasConstantValue to have a DominatorTree argumentDan Gohman2009-09-031-7/+4
| | | | | | | | instead of a bool argument, and to do the dominator check itself. This makes it eaiser to use when DominatorTree information is available. llvm-svn: 80920
* Rename Instruction::isIdenticalTo to Instruction::isIdenticalToWhenDefined,Dan Gohman2009-08-251-2/+6
| | | | | | | | | | | | | | | | and introduce a new Instruction::isIdenticalTo which tests for full identity, including the SubclassOptionalData flags. Also, fix the Instruction::clone implementations to preserve the SubclassOptionalData flags. Finally, teach several optimizations how to handle SubclassOptionalData correctly, given these changes. This fixes the counterintuitive behavior of isIdenticalTo not comparing the full value, and clone not returning an identical clone, as well as some subtle bugs that could be caused by these. Thanks to Nick Lewycky for reporting this, and for an initial patch! llvm-svn: 80038
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-131-4/+4
| | | | llvm-svn: 78948
* Move a few more APIs back to 2.5 forms. The only remaining ones left to ↵Owen Anderson2009-07-311-2/+1
| | | | | | | | change back are metadata related, which I'm waiting on to avoid conflicting with Devang. llvm-svn: 77721
* Move more code back to 2.5 APIs.Owen Anderson2009-07-301-4/+3
| | | | llvm-svn: 77635
* Make AliasAnalysis and related classes useDan Gohman2009-07-251-1/+1
| | | | | | getAnalysisIfAvailable<TargetData>(). llvm-svn: 77028
* AliasAnalysis wants sizes in address-units, not bits.Dan Gohman2009-07-241-1/+1
| | | | llvm-svn: 77009
* Get rid of the Pass+Context magic.Owen Anderson2009-07-221-5/+5
| | | | llvm-svn: 76702
* llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.Torok Edwin2009-07-141-1/+1
| | | | | | | | | 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
* Convert more assert(0)+abort() -> LLVM_UNREACHABLE,Torok Edwin2009-07-111-2/+2
| | | | | | and abort()/exit() -> llvm_report_error(). llvm-svn: 75363
* This started as a small change, I swear. Unfortunately, lots of things call ↵Owen Anderson2009-07-091-1/+1
| | | | | | the [I|F]CmpInst constructors. Who knew!? llvm-svn: 75200
* More LLVMContext-ification.Owen Anderson2009-07-051-4/+7
| | | | llvm-svn: 74807
* Re-apply 70645, converting ScalarEvolution to useDan Gohman2009-05-041-4/+3
| | | | | | | | | | | | CallbackVH, with fixes. allUsesReplacedWith need to walk the def-use chains and invalidate all users of a value that is replaced. SCEVs of users need to be recalcualted even if the new value is equivalent. Also, make forgetLoopPHIs walk def-use chains, since any SCEV that depends on a PHI should be recalculated when more information about that PHI becomes available. llvm-svn: 70927
* Factor loop backedge finding out of CodeGenPrepare into a new Chris Lattner2009-05-041-0/+50
| | | | | | FindFunctionBackedges function. llvm-svn: 70819
* Revert r70645 for now; it's causing a variety of regressions.Dan Gohman2009-05-031-3/+4
| | | | llvm-svn: 70661
* Convert ScalarEvolution to use CallbackVH for its internal map. ThisDan Gohman2009-05-021-4/+3
| | | | | | | | | makes ScalarEvolution::deleteValueFromRecords, and it's code that subtly needed to be called before ReplaceAllUsesWith, unnecessary. It also makes ValueDeletionListener unnecessary. llvm-svn: 70645
* Previously, RecursivelyDeleteDeadInstructions provided an optionDan Gohman2009-05-021-0/+20
| | | | | | | | | | | | | | | | | | of returning a list of pointers to Values that are deleted. This was unsafe, because the pointers in the list are, by nature of what RecursivelyDeleteDeadInstructions does, always dangling. Replace this with a simple callback mechanism. This may eventually be removed if all clients can reasonably be expected to use CallbackVH. Use this to factor out the dead-phi-cycle-elimination code from LSR utility function, and generalize it to use the RecursivelyDeleteTriviallyDeadInstructions utility function. This makes LSR more aggressive about eliminating dead PHI cycles; adjust tests to either be less trivial or to simply expect fewer instructions. llvm-svn: 70636
* Skip ptr-to-ptr bitcasts when counting in another case.Dale Johannesen2009-03-041-4/+4
| | | | llvm-svn: 66000
* Instruction counters must skip the bitcasts thatDale Johannesen2009-03-031-0/+6
| | | | | | | feed into llvm.dbg.declare nodes, as well as the debug directives themselves. llvm-svn: 65976
* When removing a store to an alloca that has only oneDale Johannesen2009-03-031-2/+1
| | | | | | | | use, check also for the case where it has two uses, the other being a llvm.dbg.declare. This is needed so debug info doesn't affect codegen. llvm-svn: 65970
* Fix a bunch of Doxygen syntax issues. Escape special characters,Dan Gohman2009-03-031-2/+2
| | | | | | and put @file directives on their own comment line. llvm-svn: 65920
* When sinking an insn in InstCombine bring its debugDale Johannesen2009-03-031-2/+25
| | | | | | | | info with it. Don't count debug info insns against the scan maximum in FindAvailableLoadedValue (lest they affect codegen). llvm-svn: 65910
* While folding unconditional return move DbgRegionEndInst into the ↵Devang Patel2009-02-241-22/+2
| | | | | | | | | | | predecessor, instead of removing it. This fixes following tests from llvmgcc42 testsuite. gcc.c-torture/execute/20000605-3.c gcc.c-torture/execute/20020619-1.c gcc.c-torture/execute/20030920-1.c gcc.c-torture/execute/loop-ivopts-1.c llvm-svn: 65353
* If llvm.dbg.region.end is disappearing then remove corresponding ↵Devang Patel2009-02-111-2/+22
| | | | | | llvm.dbg.func.start also. llvm-svn: 64278
* Rename getAnalysisToUpdate to getAnalysisIfAvailable.Duncan Sands2009-01-281-7/+7
| | | | llvm-svn: 63198
* Factor some code into a new FoldSingleEntryPHINodes method.Chris Lattner2008-12-031-0/+18
| | | | llvm-svn: 60501
* third time is the charm.Chris Lattner2008-12-031-1/+3
| | | | llvm-svn: 60469
* fix assertion.Chris Lattner2008-12-031-1/+1
| | | | llvm-svn: 60468
* Rename DeleteBlockIfDead to DeleteDeadBlock and make it Chris Lattner2008-12-031-9/+4
| | | | | | | unconditionally delete the block. All likely clients will do the checking anyway. llvm-svn: 60464
* Factor some code out of SimplifyCFG, forming a new Chris Lattner2008-12-031-0/+33
| | | | | | DeleteBlockIfDead method. llvm-svn: 60463
* switch InstCombine::visitLoadInst to use Chris Lattner2008-11-271-2/+25
| | | | | | FindAvailableLoadedValue llvm-svn: 60169
* enhance FindAvailableLoadedValue to make use of AliasAnalysisChris Lattner2008-11-271-1/+20
| | | | | | if it has it. llvm-svn: 60167
OpenPOWER on IntegriCloud