summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/Local.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make a bunch of symbols internal.Benjamin Kramer2010-12-301-1/+2
| | | | llvm-svn: 122642
* don't lose TD infoChris Lattner2010-12-251-1/+1
| | | | llvm-svn: 122556
* Move getOrEnforceKnownAlignment out of instcombine into Transforms/Utils.Chris Lattner2010-12-251-0/+92
| | | | llvm-svn: 122554
* remove the pointless check of MemoryUseIntrinsic fromChris Lattner2010-11-301-3/+0
| | | | | | | is trivially dead, since these have side effects. This makes the (misnamed) MemoryUseIntrinsic class dead, so remove it. llvm-svn: 120382
* Have RemovePredecessorAndSimplify you SimplifyInstructionDuncan Sands2010-11-171-4/+4
| | | | | | rather than hasConstantValue. llvm-svn: 119457
* Teach SimplifyCFG how to simplify indirectbr instructions.Dan Gohman2010-08-141-0/+3
| | | | | | | | | | | - Eliminate redundant successors. - Convert an indirectbr with one successor into a direct branch. Also, generalize SimplifyCFG to be able to be run on a function entry block. It knows quite a few simplifications which are applicable to the entry block, and it only needs a few checks to avoid trouble with the entry block. llvm-svn: 111060
* make various clients of ReplaceAndSimplifyAllUses tolerate Chris Lattner2010-07-151-2/+3
| | | | | | | | it *changing* the things it replaces, not just causing them to drop to null. There is no functionality change yet, but this is required for a subsequent patch. llvm-svn: 108414
* cache dereferenced iteratorsGabor Greif2010-07-121-3/+5
| | | | llvm-svn: 108132
* Move FindAvailableLoadedValue isSafeToLoadUnconditionally out ofDan Gohman2010-05-281-105/+0
| | | | | | | lib/Transforms/Utils and into lib/Analysis so that Analysis passes can use them. llvm-svn: 104949
* There are two ways of checking for a given type, for example isa<PointerType>(T)Duncan Sands2010-02-161-2/+2
| | | | | | | and T->isPointerTy(). Convert most instances of the first form to the second form. Requested by Chris. llvm-svn: 96344
* fix PR6305 by handling BlockAddress in a helper functionChris Lattner2010-02-151-0/+11
| | | | | | called by jump threading. llvm-svn: 96263
* Fix pr6198 by moving the isSized() check to an outer conditional.Bob Wilson2010-02-011-6/+8
| | | | | | | The testcase from pr6198 does not crash for me -- I don't know what's up with that -- so I'm not adding it to the tests. llvm-svn: 94984
* Check alignment of loads when deciding whether it is safe to execute themBob Wilson2010-01-301-7/+14
| | | | | | | unconditionally. Besides checking the offset, also check that the underlying object is aligned as much as the load itself. llvm-svn: 94875
* Use uint64_t instead of unsigned for offsets and sizes.Bob Wilson2010-01-291-3/+3
| | | | llvm-svn: 94835
* Improve isSafeToLoadUnconditionally to recognize that GEPs with constantBob Wilson2010-01-291-8/+61
| | | | | | | indices are safe if the result is known to be within the bounds of the underlying object. llvm-svn: 94829
* DbgInfoIntrinsics no longer appear in an instruction's use list; so clean up ↵Victor Hernandez2010-01-211-24/+0
| | | | | | looking for them in use iterations and remove OnlyUsedByDbgInfoIntrinsics() llvm-svn: 94111
* add a helper function.Chris Lattner2010-01-121-0/+24
| | | | llvm-svn: 93251
* Nick Lewycky pointed out that this code makes changes unconditionally.Dan Gohman2010-01-051-1/+2
| | | | llvm-svn: 92739
* Use do+while instead of while for loops which obviously have aDan Gohman2010-01-051-2/+2
| | | | | | non-zero trip count. Use SmallVector's pop_back_val(). llvm-svn: 92734
* Make RecursivelyDeleteTriviallyDeadInstructions,Dan Gohman2010-01-051-7/+12
| | | | | | | RecursivelyDeleteDeadPHINode, and DeleteDeadPHIs return a flag indicating whether they made any changes. llvm-svn: 92732
* Change errs() to dbgs().David Greene2010-01-051-4/+4
| | | | llvm-svn: 92606
* prune #includes.Chris Lattner2009-12-291-2/+2
| | | | llvm-svn: 92260
* Move EliminateDuplicatePHINodes() from SimplifyCFG.cpp to Local.cppJim Grosbach2009-12-021-0/+62
| | | | llvm-svn: 90324
* Don't trivially delete unused calls to llvm.invariant.start. This allowsDuncan Sands2009-11-111-0/+3
| | | | | | | | | | | | | llvm.invariant.start to be used without necessarily being paired with a call to llvm.invariant.end. If you run the entire optimization pipeline then such calls are in fact deleted (adce does it), but that's actually a good thing since we probably do want them to be zapped late in the game. There should really be an integration test that checks that the llvm.invariant.start call lasts long enough that all passes that do interesting things with it get to do their stuff before it is deleted. But since no passes do anything interesting with it yet this will have to wait for later. llvm-svn: 86840
* move some generally useful functions out of jump threadingChris Lattner2009-11-101-2/+47
| | | | | | into libanalysis and transformutils. llvm-svn: 86735
* refactor TryToSimplifyUncondBranchFromEmptyBlock out of SimplifyCFG.Chris Lattner2009-11-101-0/+171
| | | | llvm-svn: 86666
* remove a isFreeCall check: it is a callinst that can write to memory already.Chris Lattner2009-11-031-3/+2
| | | | llvm-svn: 85863
* constant fold indirectbr(blockaddress(%bb)) -> br label %bb.Chris Lattner2009-11-011-9/+46
| | | | llvm-svn: 85704
* Rename MallocFreeHelper as MemoryBuiltinsVictor Hernandez2009-10-271-1/+1
| | | | llvm-svn: 85286
* Rename MallocHelper as MallocFreeHelper, since it now also identifies calls ↵Victor Hernandez2009-10-261-1/+1
| | | | | | to free() llvm-svn: 85181
* Remove FreeInst.Victor Hernandez2009-10-261-3/+2
| | | | | | | Remove LowerAllocations pass. Update some more passes to treate free calls just like they were treating FreeInst. llvm-svn: 85176
* Auto-upgrade free instructions to calls to the builtin free function.Victor Hernandez2009-10-241-1/+2
| | | | | | | Update all analysis passes and transforms to treat free calls just like FreeInst. Remove RaiseAllocations and all its tests since FreeInst no longer needs to be raised. llvm-svn: 84987
* Preserve ProfileInfo during CodeGenPrepare.Andreas Neustifter2009-09-161-1/+9
| | | | llvm-svn: 82034
* Move more code back to 2.5 APIs.Owen Anderson2009-07-301-4/+2
| | | | llvm-svn: 77635
* Get rid of the Pass+Context magic.Owen Anderson2009-07-221-3/+3
| | | | llvm-svn: 76702
* This started as a small change, I swear. Unfortunately, lots of things call ↵Owen Anderson2009-07-091-2/+2
| | | | | | the [I|F]CmpInst constructors. Who knew!? llvm-svn: 75200
* "LLVMContext* " --> "LLVMContext *"Owen Anderson2009-07-061-1/+1
| | | | llvm-svn: 74878
* More LLVMContext-ification.Owen Anderson2009-07-051-3/+5
| | | | llvm-svn: 74807
* Remove unused routines.Devang Patel2009-06-261-41/+0
| | | | llvm-svn: 74351
* Generalize instcombine's isSafeToLoadUnconditionally() functionChris Lattner2009-06-161-0/+45
| | | | | | | to ignore readonly calls, and factor it out of instcombine so that it can be used by other passes. Patch by Frits van Bommel! llvm-svn: 73506
* Simplify code by using SmallVector's pop_back_val() instead ofDan Gohman2009-05-061-2/+1
| | | | | | separate back() and pop_back() calls. llvm-svn: 71089
* Allow readonly functions to unwind exceptions. TeachDuncan Sands2009-05-061-7/+5
| | | | | | | | the optimizers about this. For example, a readonly function with no uses cannot be removed unless it is also marked nounwind. llvm-svn: 71071
* Re-apply 70645, converting ScalarEvolution to useDan Gohman2009-05-041-18/+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
* Revert r70645 for now; it's causing a variety of regressions.Dan Gohman2009-05-031-3/+18
| | | | llvm-svn: 70661
* Convert ScalarEvolution to use CallbackVH for its internal map. ThisDan Gohman2009-05-021-18/+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-5/+42
| | | | | | | | | | | | | | | | | | 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
* Revert my previous change on Local.cpp, instead, fix the bug on scalarrepl.Zhou Sheng2009-03-181-3/+0
| | | | | | | If the instruction has no users, it is also not only used by debug info and should not be deleted. llvm-svn: 67194
* Fix a bug.Zhou Sheng2009-03-181-0/+3
| | | | | | If I->use_empty(), this method should return false. llvm-svn: 67180
* Add "check/remove dbg var" helper routines.Devang Patel2009-03-061-0/+44
| | | | llvm-svn: 66223
* Marking debug info intrinsics as not touching memoryDale Johannesen2009-03-031-0/+3
| | | | | | caused them to be considered trivially dead. Fix this. llvm-svn: 65979
OpenPOWER on IntegriCloud