summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/Local.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Enable scalar replacement of AllocaInst whose one of the user is dbg info.Devang Patel2009-02-101-0/+22
| | | | llvm-svn: 64207
* Revert rev. 63876. It is causing llvm-gcc bootstrap failure.Devang Patel2009-02-051-17/+0
| | | | llvm-svn: 63888
* Ignore dbg intrinsics while propagating conditional expression info.Devang Patel2009-02-051-0/+17
| | | | llvm-svn: 63876
* use precise gettersGabor Greif2009-01-301-2/+2
| | | | llvm-svn: 63402
* rewrite RecursivelyDeleteTriviallyDeadInstructions to use a more efficientChris Lattner2008-11-281-16/+26
| | | | | | formulation that doesn't require set lookups or scanning a set. llvm-svn: 60203
* remove some weirdness that came from the LSR code that hasChris Lattner2008-11-281-8/+1
| | | | | | | nothing to do with dead instruction elimination. No tests in dejagnu depend on this, so I don't know what it was needed for. llvm-svn: 60202
* enhance RecursivelyDeleteTriviallyDeadInstructions to makeChris Lattner2008-11-271-0/+9
| | | | | | PHIs dead if they are single-value. llvm-svn: 60194
* Enhance RecursivelyDeleteTriviallyDeadInstructions to optionallyChris Lattner2008-11-271-7/+15
| | | | | | return a list of deleted instructions. llvm-svn: 60193
* remove doConstantPropagation and dceInstruction, they are justChris Lattner2008-11-271-30/+25
| | | | | | | | | | wrappers around the interesting code and use an obscure iterator abstraction that dates back many many years. Move EraseDeadInstructions to Transforms/Utils and name it RecursivelyDeleteTriviallyDeadInstructions. llvm-svn: 60191
* move MergeBasicBlockIntoOnlyPred to Transforms/Utils.Chris Lattner2008-11-271-0/+33
| | | | llvm-svn: 60162
* Use Instruction::eraseFromParent().Dan Gohman2008-06-211-1/+1
| | | | llvm-svn: 52606
* API changes for class Use size reduction, wave 1.Gabor Greif2008-04-061-2/+2
| | | | | | | | Specifically, introduction of XXX::Create methods for Users that have a potentially variable number of Uses. llvm-svn: 49277
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* dead calls to llvm.stacksave can be deleted, even though theyChris Lattner2007-12-291-1/+10
| | | | | | have potential side-effects. llvm-svn: 45392
* Move the GET_SIDE_EFFECT_INFO logic from isInstructionTriviallyDeadDan Gohman2007-07-261-7/+0
| | | | | | | to Instruction::mayWriteToMemory, fixing a FIXME, and helping various places that call mayWriteToMemory directly. llvm-svn: 40533
* move a bunch of constant folding code f rom Transforms/Utils/Local.cpp intoChris Lattner2007-01-301-152/+0
| | | | | | libanalysis/ConstantFolding.cpp. llvm-svn: 33679
* remove now-dead code.Chris Lattner2007-01-301-14/+0
| | | | llvm-svn: 33678
* Change constant folding APIs to take an optional TargetData, and changeChris Lattner2007-01-301-22/+15
| | | | | | | | | | | ConstantFoldInstOperands/ConstantFoldCall to take a pointer to an array of operands + size, instead of an std::vector. In some cases, switch to using a SmallVector instead of a vector. This allows us to get rid of some special case gross code that was there to avoid the cost of constructing a vector. llvm-svn: 33670
* Implement review feedback for the ConstantBool->ConstantInt merge. ChrisReid Spencer2007-01-121-2/+2
| | | | | | | | recommended that getBoolValue be replaced with getZExtValue and that get(bool) be replaced by get(const Type*, uint64_t). This implements those changes. llvm-svn: 33110
* For PR1043:Zhou Sheng2007-01-111-3/+3
| | | | | | | Merge ConstantIntegral and ConstantBool into ConstantInt. Remove ConstantIntegral and ConstantBool from LLVM. llvm-svn: 33073
* For PR950:Reid Spencer2006-12-231-10/+20
| | | | | | | | This patch removes the SetCC instructions and replaces them with the ICmp and FCmp instructions. The SetCondInst instruction has been removed and been replaced with ICmpInst and FCmpInst. llvm-svn: 32751
* For PR950:Reid Spencer2006-11-271-2/+13
| | | | | | | | | | The long awaited CAST patch. This introduces 12 new instructions into LLVM to replace the cast instruction. Corresponding changes throughout LLVM are provided. This passes llvm-test, llvm/test, and SPEC CPUINT2000 with the exception of 175.vpr which fails only on a slight floating point output difference. llvm-svn: 31931
* Remove redundant <cmath>.Jim Laskey2006-11-081-1/+0
| | | | llvm-svn: 31561
OpenPOWER on IntegriCloud