summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/Local.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Preserve debug info for unused zero extended boolean argument.Devang Patel2011-05-161-4/+13
| | | | | | Radar 9422775. llvm-svn: 131422
* Remove DbgDeclare only if all uses are converted.Devang Patel2011-04-281-1/+5
| | | | llvm-svn: 130431
* Trivial simplification.Jay Foad2011-04-191-2/+1
| | | | llvm-svn: 129759
* Don't include Operator.h from InstrTypes.h.Jay Foad2011-04-111-0/+1
| | | | llvm-svn: 129271
* Attempt to fix breakage from r128782 reported by Francois Pichet onEli Friedman2011-04-041-0/+3
| | | | | | | llvm-commits. (Not sure why it only breaks on Windows; maybe it has something to do with the iterator representation...) llvm-svn: 128802
* PR9446: RecursivelyDeleteTriviallyDeadInstructions can delete the instructionEli Friedman2011-04-021-1/+4
| | | | | | | | | | | after the given instruction; make sure to handle that case correctly. (It's difficult to trigger; the included testcase involves a dead block, but I don't think that's a requirement.) While I'm here, get rid of the unnecessary warning about SimplifyInstructionsInBlock, since it should work correctly as far as I know. llvm-svn: 128782
* Simplify.Devang Patel2011-03-211-5/+4
| | | | llvm-svn: 128030
* If an AllocaInst referred by DbgDeclareInst is used by a LoadInst then the ↵Devang Patel2011-03-181-0/+24
| | | | | | LoadInst should also get a corresponding llvm.dbg.value intrinsic. llvm-svn: 127924
* Remove dead code.Devang Patel2011-03-181-2/+0
| | | | llvm-svn: 127923
* Consider debug info intrinsics pointing to null value as dead instructions.Devang Patel2011-03-181-1/+14
| | | | llvm-svn: 127922
* Try to not lose variable's debug info during instcombine.Devang Patel2011-03-171-0/+26
| | | | | | | This is done by lowering dbg.declare intrinsic into dbg.value intrinsic. Radar 9143931. llvm-svn: 127834
* Refactor into a separate utility function.Devang Patel2011-03-171-0/+28
| | | | llvm-svn: 127832
* DenseMap<uintptr_t,...> doesn't allow all values as keys.Jakob Stoklund Olesen2011-03-041-0/+2
| | | | | | | Avoid colliding with the sentinels, hopefully unbreaking llvm-gcc-x86_64-linux-selfhost. llvm-svn: 126982
* If the phi node was used by an unreachable instruction that ends up usingDuncan Sands2011-02-211-2/+3
| | | | | | | | | | | | itself without going via a phi node then we could return false here in spite of making a change. Also, tweak the comment because this method can (and always could) return true without deleting the original phi node. For example, if the phi node was used by a read-only invoke instruction which is used by another phi node phi2 which is only used by and only uses the invoke, then phi2 would be deleted but not the invoke instruction and not the original phi node. llvm-svn: 126129
* Simplify RecursivelyDeleteDeadPHINode. The only functionality changeDuncan Sands2011-02-211-28/+16
| | | | | | | | should be that if the phi is used by a side-effect free instruction with no uses then the phi and the instruction now get zapped (checked by the unittest). llvm-svn: 126124
* Make RecursivelyDeleteDeadPHINode delete a phi node that has no users and add aNick Lewycky2011-02-201-7/+12
| | | | | | | | | test for that. With this change, test/CodeGen/X86/codegen-dce.ll no longer finds any instructions to DCE, so delete the test. Also renamed J and JP to I and IP in RecursivelyDeleteDeadPHINode. llvm-svn: 126088
* Teach RecursivelyDeleteDeadPHINodes to handle multiple self-references. PatchNick Lewycky2011-02-201-5/+21
| | | | | | by Andrew Clinton! llvm-svn: 126077
* Make more passes preserve dominators (or state that they preserve dominators ifCameron Zwarich2011-01-081-0/+7
| | | | | | | | | | they all ready do). This removes two dominator recomputations prior to isel, which is a 1% improvement in total llc time for 403.gcc. The only potentially suspect thing is making GCStrategy recompute dominators if it used a custom lowering strategy. llvm-svn: 123064
* Remove all uses of the "ugly" method BranchInst::setUnconditionalDest().Jay Foad2011-01-071-5/+6
| | | | llvm-svn: 123025
* 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
OpenPOWER on IntegriCloud