aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Utils/BasicBlockUtils.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70927 91177308-0d34-0410-b5e6-96231b3b80d8
* Restore minor deletion.Mike Stump2009-05-041-0/+50
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70892 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r70645 for now; it's causing a variety of regressions.Dan Gohman2009-05-031-3/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70661 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70645 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70636 91177308-0d34-0410-b5e6-96231b3b80d8
* Skip ptr-to-ptr bitcasts when counting in another case.Dale Johannesen2009-03-041-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66000 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65976 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65970 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65920 91177308-0d34-0410-b5e6-96231b3b80d8
* 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). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65910 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65353 91177308-0d34-0410-b5e6-96231b3b80d8
* If llvm.dbg.region.end is disappearing then remove corresponding ↵Devang Patel2009-02-111-2/+22
| | | | | | llvm.dbg.func.start also. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64278 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename getAnalysisToUpdate to getAnalysisIfAvailable.Duncan Sands2009-01-281-7/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63198 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor some code into a new FoldSingleEntryPHINodes method.Chris Lattner2008-12-031-0/+18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60501 91177308-0d34-0410-b5e6-96231b3b80d8
* third time is the charm.Chris Lattner2008-12-031-1/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60469 91177308-0d34-0410-b5e6-96231b3b80d8
* fix assertion.Chris Lattner2008-12-031-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60468 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60464 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor some code out of SimplifyCFG, forming a new Chris Lattner2008-12-031-0/+33
| | | | | | | DeleteBlockIfDead method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60463 91177308-0d34-0410-b5e6-96231b3b80d8
* switch InstCombine::visitLoadInst to use Chris Lattner2008-11-271-2/+25
| | | | | | | FindAvailableLoadedValue git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60169 91177308-0d34-0410-b5e6-96231b3b80d8
* enhance FindAvailableLoadedValue to make use of AliasAnalysisChris Lattner2008-11-271-1/+20
| | | | | | | if it has it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60167 91177308-0d34-0410-b5e6-96231b3b80d8
* move FindAvailableLoadedValue from JumpThreading to Transforms/Utils.Chris Lattner2008-11-271-0/+62
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60166 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix unused variable warnings.Devang Patel2008-11-031-1/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58651 91177308-0d34-0410-b5e6-96231b3b80d8
* SplitBlock should only attempt to update LoopInfo if it is actually being used.Owen Anderson2008-10-031-4/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56994 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix simplifycfg crash in handing block merge.Devang Patel2008-09-091-1/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55971 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some checks that got lost in the shuffle. This fixes 464.h264ref.Owen Anderson2008-07-181-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53760 91177308-0d34-0410-b5e6-96231b3b80d8
* Make MergeBlockIntoPredecessor more aggressive when the same successor appearsOwen Anderson2008-07-171-5/+24
| | | | | | | more than once. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53731 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor MergeBlockIntoPredecessor out into BasicBlockUtils.Owen Anderson2008-07-171-0/+52
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53705 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove 'unwinds to' support from mainline. This patch undoes r47802 r47989Nick Lewycky2008-04-251-6/+1
| | | | | | | r48047 r48084 r48085 r48086 r48088 r48096 r48099 r48109 and r48123. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50265 91177308-0d34-0410-b5e6-96231b3b80d8
* Move SplitBlockPredecessors out of loopsimplify into BasicBlockUtils.hChris Lattner2008-04-211-0/+101
| | | | | | | | | | as a global helper function. At the same type, switch it from taking a vector of predecessors to an arbitrary sequential input. This allows us to switch LoopSimplify to use a SmallVector for various temporary vectors that it passed into SplitBlockPredecessors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50020 91177308-0d34-0410-b5e6-96231b3b80d8
* API changes for class Use size reduction, wave 1.Gabor Greif2008-04-061-1/+1
| | | | | | | | | Specifically, introduction of XXX::Create methods for Users that have a potentially variable number of Uses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49277 91177308-0d34-0410-b5e6-96231b3b80d8
* Two things. Preserve the unwind_to when splitting a BB.Nick Lewycky2008-03-091-0/+1
| | | | | | | | Add the ability to remove just one instance of a BB from a phi node. This fixes the compile error in the tree now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48085 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
* Make LoopInfoBase more generic, in preparation for having MachineLoopInfo. ↵Owen Anderson2007-11-271-1/+1
| | | | | | This involves a small interface change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44348 91177308-0d34-0410-b5e6-96231b3b80d8
* After a basic block is split into two parts,Devang Patel2007-07-191-2/+15
| | | | | | | | | | second part dominates all the blocks dominated by original basic block. And first part dominates second part. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40035 91177308-0d34-0410-b5e6-96231b3b80d8
* Add SplitEdge and SplitBlock utility routines. Devang Patel2007-07-061-0/+61
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37952 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify code by using Value::takeNameChris Lattner2007-02-111-5/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34177 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a doxygen problem and break lines at 80 columnsReid Spencer2006-05-191-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28395 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing whitespaceMisha Brukman2005-04-211-5/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21427 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve doxygen documentation, patch contributed by Evan Jones!Chris Lattner2005-04-211-17/+17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21393 91177308-0d34-0410-b5e6-96231b3b80d8
* second argument to Value::setName is now gone.Chris Lattner2005-03-051-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20463 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix #includes of i*.h => Instructions.h as per PR403.Misha Brukman2004-07-291-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15334 91177308-0d34-0410-b5e6-96231b3b80d8
* Finegrainify namespacificationChris Lattner2004-01-091-9/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10727 91177308-0d34-0410-b5e6-96231b3b80d8
* Put all LLVM code into the llvm namespace, as per bug 109.Brian Gaeke2003-11-111-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
* Added LLVM project notice to the top of every C++ source file.John Criswell2003-10-201-0/+7
| | | | | | | Header files will be on the way. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9298 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix spelling.Misha Brukman2003-10-101-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9027 91177308-0d34-0410-b5e6-96231b3b80d8
* Spell `necessary' correctly.Misha Brukman2003-08-181-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7944 91177308-0d34-0410-b5e6-96231b3b80d8
* - Eliminated the deferred symbol table stuff in Module & Function, it reallyChris Lattner2002-11-201-1/+1
| | | | | | | wasn't an optimization and it was causing lots of bugs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4779 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix spelling of `propagate'.Misha Brukman2002-10-291-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4423 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement a new RemoveSuccessor functionChris Lattner2002-07-291-4/+51
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3131 91177308-0d34-0410-b5e6-96231b3b80d8
* *** empty log message ***Chris Lattner2002-06-251-31/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2777 91177308-0d34-0410-b5e6-96231b3b80d8