summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
Commit message (Collapse)AuthorAgeFilesLines
* Fix PR5258, jump-threading creating invalid PHIs.Torok Edwin2009-10-201-2/+10
| | | | | | | When an incoming value for a PHI is updated, we must also updated all other incoming values for the same BB to match, otherwise we create invalid PHIs. llvm-svn: 84638
* 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
* Change instnamer to name arguments "arg" instead of "tmp" for clarity, andDan Gohman2009-10-191-2/+2
| | | | | | to name basic blocks "bb" instead of "BB", for consistency. llvm-svn: 84502
* Simplify some code (first hunk) and fix PR5208 (second hunk) byChris Lattner2009-10-171-8/+6
| | | | | | updating the callgraph when introducing a call. llvm-svn: 84310
* Remove MallocInst from LLVM Instructions.Victor Hernandez2009-10-171-29/+10
| | | | llvm-svn: 84299
* Strip trailing white space.Duncan Sands2009-10-161-33/+31
| | | | llvm-svn: 84256
* Update CMake file.Ted Kremenek2009-10-131-1/+0
| | | | llvm-svn: 84001
* Commit the removal of this file, which is now moved to lib/Analysis.Dan Gohman2009-10-131-337/+0
| | | | llvm-svn: 83999
* Start refactoring the inline cost estimation code so that it can be usedDan Gohman2009-10-131-71/+71
| | | | | | for purposes other than inlining. llvm-svn: 83997
* change simplifycfg to not duplicate 'unwind' instructions. HopefullyChris Lattner2009-10-131-12/+5
| | | | | | | this will increase the likelihood of common code getting sunk towards the unwind. llvm-svn: 83996
* rewrite LCSSA to use SSAUpdate, to only return true if it modifiesChris Lattner2009-10-111-154/+130
| | | | | | the IR, and to implement the FIXME'd optimization. llvm-svn: 83748
* clean up and simplify some code. Don't use setvector when things will beChris Lattner2009-10-111-28/+23
| | | | | | | inserted only once, just use vector. Don't compute ExitBlocks unless we need it, change std::sort to array_pod_sort. llvm-svn: 83747
* add a simple helper method.Chris Lattner2009-10-101-0/+6
| | | | llvm-svn: 83745
* add ability for clients of SSAUpdater to find out about theChris Lattner2009-10-101-1/+9
| | | | | | PHI nodes inserted. llvm-svn: 83744
* add the ability to get a rewritten value from the middle of a block,Chris Lattner2009-10-101-3/+92
| | | | | | | not just at the end. Add a big comment explaining when this could be useful (which never happens for jump threading). llvm-svn: 83741
* rename GetValueInBlock -> GetValueAtEndOfBlock to better reflect Chris Lattner2009-10-101-11/+11
| | | | | | what it does. llvm-svn: 83740
* use a typedef instead of spelling out an insane type. Yay for auto someday.Chris Lattner2009-10-101-3/+3
| | | | llvm-svn: 83707
* Implement an efficient and fully general SSA update mechanism that Chris Lattner2009-10-102-0/+233
| | | | | | works on unstructured CFGs. This implements PR217, our oldest open PR. llvm-svn: 83705
* random tidyingChris Lattner2009-10-101-7/+5
| | | | llvm-svn: 83701
* Use names instead of numbers for some of the magicDale Johannesen2009-10-091-6/+6
| | | | | | | constants used in inlining heuristics (especially those used in more than one file). No functional change. llvm-svn: 83675
* Add FreeInst to the "is a call" check for Insts that are calls, butEric Christopher2009-10-071-2/+2
| | | | | | not intrinsics. llvm-svn: 83441
* While we still have a MallocInst treat it as a call like any otherEric Christopher2009-10-071-0/+4
| | | | | | | | | for inlining. When MallocInst goes away this code will be subsumed as part of calls and work just fine... llvm-svn: 83434
* Introduce and use convenience methods for getting pointer typesDuncan Sands2009-10-063-6/+6
| | | | | | | where the element is of a basic builtin type. For example, to get an i8* use getInt8PtrTy. llvm-svn: 83379
* Remove an unnnecessary LLVMContext argument inDan Gohman2009-10-051-1/+1
| | | | | | ConstantFoldLoadThroughGEPConstantExpr. llvm-svn: 83311
* Do away with the strange use of BitVectors in SSI, and just use normal sets. ↵Owen Anderson2009-10-041-116/+90
| | | | | | This makes the code much more C++/LLVM-ish. llvm-svn: 83286
* Fix a typo in the comment.Owen Anderson2009-10-041-1/+1
| | | | llvm-svn: 83283
* SSI needs to require DT and DF transitively, since it uses them outside of ↵Owen Anderson2009-10-041-3/+3
| | | | | | | | its runOnFunction. Similarly, it can be marked setPreservesAll, since it does no work in its runOnFunction. llvm-svn: 83282
* Fix this code so that it doesn't try to iterate through a std::vectorDan Gohman2009-09-301-3/+4
| | | | | | | while calling changeImmediateDominator, which removes elements from the vector. This fixes PR5097. llvm-svn: 83166
* Remove a redundant #ifndef and add an assertion string.Dan Gohman2009-09-281-3/+1
| | | | llvm-svn: 82991
* Convert LoopSimplify and LoopExtractor from FunctionPass to LoopPass.Dan Gohman2009-09-281-83/+48
| | | | llvm-svn: 82990
* calls are already handled, malloc doesn't need a special case.Chris Lattner2009-09-271-3/+1
| | | | llvm-svn: 82931
* Instruction::clone does not need to take an LLVMContext&. Remove that andNick Lewycky2009-09-274-12/+10
| | | | | | update all the callers. llvm-svn: 82889
* A minor improvment in accuracy to inline costDale Johannesen2009-09-231-6/+14
| | | | | | computation, and some cosmetics. llvm-svn: 82660
* tidy upChris Lattner2009-09-211-7/+8
| | | | llvm-svn: 82488
* Enhance transform passes so that they apply the same tranforms to malloc ↵Victor Hernandez2009-09-181-1/+2
| | | | | | | | calls as to MallocInst. Reviewed by Dan Gohman. llvm-svn: 82300
* Update malloc call creation code (AllocType is now the element type of the ↵Victor Hernandez2009-09-181-2/+6
| | | | | | | | | | | | | | | | | | malloc, not the resulting type). In getMallocArraySize(), fix bug in the case that array size is the product of 2 constants. Extend isArrayMalloc() and getMallocArraySize() to handle case where malloc is used as char array. Ensure that ArraySize in LowerAllocations::runOnBasicBlock() is correct type. Extend Instruction::isSafeToSpeculativelyExecute() to handle malloc calls. Add verification for malloc calls. Reviewed by Dan Gohman. llvm-svn: 82257
* Preserve ProfileInfo during CodeGenPrepare.Andreas Neustifter2009-09-161-1/+9
| | | | llvm-svn: 82034
* Correctly handle the case where a comparison is created in one BasicBlock andNick Lewycky2009-09-101-37/+30
| | | | | | used by a terminator in another. llvm-svn: 81437
* Add malloc call utility functions. Patch by Victor Hernandez.Evan Cheng2009-09-101-52/+6
| | | | llvm-svn: 81426
* Fix SplitCriticalEdge to properly update LCSSA form when splitting aDan Gohman2009-09-091-24/+51
| | | | | | | | | | loop exit edge -- new PHIs may be needed not only for the additional splits that are made to preserve LoopSimplify form, but also for the original split. Factor out the code that inserts new PHIs so that it can be used for both. Remove LoopRotation.cpp's code for manually updating LCSSA form, as it is now redundant. This fixes PR4934. llvm-svn: 81363
* Preserve ProfileInfo.Andreas Neustifter2009-09-091-0/+7
| | | | llvm-svn: 81360
* Re-apply r80926, with fixes: keep the domtree informed of new blocksDan Gohman2009-09-084-63/+161
| | | | | | | | | | | | | | | 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
* Fix comment.Eric Christopher2009-09-061-1/+1
| | | | llvm-svn: 81138
* Revert r80926. It causes loop unswitch assertion and slow down some JIT ↵Evan Cheng2009-09-064-154/+62
| | | | | | tests significantly. llvm-svn: 81101
* Add a verifyAnalysis to LoopInfo, LoopSimplify, and LCSSA form that verifyDan Gohman2009-09-034-62/+154
| | | | | | | | | 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-033-27/+20
| | | | | | | | 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
* back out my recent commit (r80858), it seems to break self-hosting ↵Gabor Greif2009-09-031-2/+2
| | | | | | buildbot's stage 2 configure llvm-svn: 80871
* re-commit r66920 (which has been backed out in r66953) I may have more luck ↵Gabor Greif2009-09-031-2/+2
| | | | | | this time. I'll back out if needed... llvm-svn: 80858
* remove a bunch of explicit code previously needed to update theChris Lattner2009-09-011-27/+7
| | | | | | callgraph. This is now dead because RAUW does the job. llvm-svn: 80703
* Change CallGraphNode to maintain it's Function as an AssertingVHChris Lattner2009-09-011-1/+1
| | | | | | | | | | | | for sanity. This didn't turn up any bugs. Change CallGraphNode to maintain its "callsite" information in the call edges list as a WeakVH instead of as an instruction*. This fixes a broad class of dangling pointer bugs, and makes CallGraph have a number of useful invariants again. This fixes the class of problem indicated by PR4029 and PR3601. llvm-svn: 80663
OpenPOWER on IntegriCloud