summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
...
* Update isImpliedCond to use the new SimplifyICmpOperands utility.Dan Gohman2010-04-241-111/+6
| | | | llvm-svn: 102232
* Add a new utility function SimplifyICmpOperands. Much of this code isDan Gohman2010-04-241-0/+198
| | | | | | | refactored out of ScalarEvolution::isImpliedCond, which will be updated to use this new utility routine soon. llvm-svn: 102229
* fix callgraph dump to not print 0x0x1234 for nodes.Chris Lattner2010-04-231-6/+8
| | | | | | | | | | | | | | | | Add the instruction pointer value for debuggability. We now get dump output that looks like this: Call graph node for function: 'f1'<<0x1017086b0>> #uses=1 CS<0x1017046f8> calls external node Call graph node for function: '_ZNSt6vectorIdSaIdEEC1EmRKdRKS0_'<<0x1017086f0>> #uses=1 CS<0x0> calls external node Call graph node for function: 'f4'<<0x1017087a0>> #uses=1 CS<0x101708c88> calls function 'f3' llvm-svn: 102194
* Fix LSR to tolerate cases where ScalarEvolution initiallyDan Gohman2010-04-231-0/+12
| | | | | | | misses an opportunity to fold add operands, but folds them after LSR has separated them out. This fixes rdar://7886751. llvm-svn: 102157
* When it doesn't matter whether zero or sign extension is used,Dan Gohman2010-04-231-6/+2
| | | | | | use ScalarEvolutions "any" extend function. llvm-svn: 102156
* add a DEBUG call so that -debug lists when CGSCCPM iterates.Chris Lattner2010-04-221-7/+4
| | | | | | | | | Fix RefreshCallGraph to use CGN->replaceCallEdge instead of hand rolling its own loop. replaceCallEdge properly maintains the reference counts of the nodes, fixing a crash exposed by the iterative callgraph stuff. llvm-svn: 102120
* Don't attempt to analyze values which are obviously undef. This fixes someDan Gohman2010-04-221-75/+102
| | | | | | assertion failures in extreme cases. llvm-svn: 102042
* Tidy a comment.Dan Gohman2010-04-221-1/+1
| | | | llvm-svn: 102041
* Make ScalarEvolution::getConstant support pointer types, for consistencyDan Gohman2010-04-211-2/+2
| | | | | | with ScalarEvolution's overall approach to pointer types. llvm-svn: 102003
* Implement (but don't enable) PR6724 and rdar://6295824. In short,Chris Lattner2010-04-211-56/+122
| | | | | | | | | | | | | | | we have RefreshCallGraph detect when a function pass devirtualizes a call, and have CGSCCPassMgr iterate (up to a count) when this happens. This allows (in the example) GVN to devirtualize the call in foo, then the inliner to inline it away. This is not currently enabled because I haven't done any analysis on the (potentially substantial) code size or performance impact of doing this, and guess what, it exposes callgraph updating bugs in various passes. This is progress though, and you can play with it by passing -max-cg-scc-iterations=5 to opt. llvm-svn: 101973
* Revert r101471. For tight recursive functions which have multipleDan Gohman2010-04-211-7/+0
| | | | | | | | | recursive callsites, inlining can reduce the number of calls by exponential factors, as it does in MultiSource/Benchmarks/Olden/treeadd. More involved heuristics will be needed. llvm-svn: 101969
* PR6880: Don't dereference CallsExternalNode if it's NULL.Benjamin Kramer2010-04-201-3/+5
| | | | llvm-svn: 101897
* move some select simplifications out out instcombine intoChris Lattner2010-04-201-0/+32
| | | | | | inst simplify. No functionality change. llvm-svn: 101873
* make CallGraphNode dtor abort if a node is deleted when there are stillChris Lattner2010-04-201-0/+9
| | | | | | references to it. llvm-svn: 101847
* Remove the Expr member from IVUsers. Instead of remembering the expression,Dan Gohman2010-04-191-29/+27
| | | | | | | just ask ScalarEvolution for it on demand. This helps IVUsers be more robust in the case of expressions changing underneath it. This fixes PR6862. llvm-svn: 101819
* fix PR6858: a dangling pointer use bug which was causedChris Lattner2010-04-171-1/+8
| | | | | | | | | | | | by switching CachedFunctionInfo from a std::map to a ValueMap (which is implemented in terms of a DenseMap). DenseMap has different iterator invalidation semantics than std::map. This should hopefully fix the dragonegg builder. llvm-svn: 101658
* a bunch of cleanups and tweaks, no functionality changes.Chris Lattner2010-04-171-42/+48
| | | | llvm-svn: 101657
* reenable r101565, removing a problematic assertion.Chris Lattner2010-04-171-2/+0
| | | | | | | | | | | CGSCC can delete nodes in regions of the callgraph that have already been visited. If new CG nodes are allocated to the same pointer, we shouldn't abort, just handle it correctly by assigning a new number. This should restore stability by removing invalidated pointers that *will* be reused from the densemap in the iterator. llvm-svn: 101628
* disable r101565: an assert is getting triggered. More lurking badness no doubt.Chris Lattner2010-04-171-0/+2
| | | | llvm-svn: 101583
* Revert 101465, it broke internal OpenGL testing.Eric Christopher2010-04-166-27/+27
| | | | | | | Probably the best way to know that all getOperand() calls have been handled is to replace that API instead of updating. llvm-svn: 101579
* building on the new CallGraphSCC abstraction, teach CallGraphSCCPassManager Chris Lattner2010-04-161-0/+5
| | | | | | | | | | | | to keep the node entries in scc_iterator up to date instead of dangling as the SCC mutates. This is a really terrible problem which was causing -g to affect codegen because it would permute the memory image of the compiler process. Thanks to Dale for expertly hunting it down. llvm-svn: 101565
* move ReplaceNode out of line, rename scc_iterator::fini -> isAtEnd().Chris Lattner2010-04-161-5/+15
| | | | | | No functionality change. llvm-svn: 101562
* introduce a new CallGraphSCC class, and pass it aroundChris Lattner2010-04-161-21/+34
| | | | | | | | to CallGraphSCCPass's instead of passing around a std::vector<CallGraphNode*>. No functionality change, but now we have a much tidier interface. llvm-svn: 101558
* move PrintCallGraphPass out of the middle of CGPassManager.Chris Lattner2010-04-161-33/+43
| | | | llvm-svn: 101543
* Disable inlining of recursive calls. It can complicate tailcallelim andDan Gohman2010-04-161-0/+7
| | | | | | | dependent analyses, and increase code size, so doing it profitably would require more complex heuristics. llvm-svn: 101471
* reapply r101434Gabor Greif2010-04-166-27/+27
| | | | | | | | | | | | | with a fix for self-hosting rotate CallInst operands, i.e. move callee to the back of the operand array the motivation for this patch are laid out in my mail to llvm-commits: more efficient access to operands and callee, faster callgraph-construction, smaller compiler binary llvm-svn: 101465
* Make callIsSmall accessible as a utility function.Dan Gohman2010-04-161-4/+4
| | | | llvm-svn: 101463
* Fix SCEVCommutativeExpr::print to be robust in the case of improperDan Gohman2010-04-161-4/+6
| | | | | | | expression canonicalization. Its job is to print what's there, not to make judgements about it. llvm-svn: 101461
* back out r101423 and r101397, they break llvm-gcc self-host on darwin10Gabor Greif2010-04-166-27/+27
| | | | llvm-svn: 101434
* reapply r101364, which has been backed out in r101368Gabor Greif2010-04-156-27/+27
| | | | | | | | | | | | | with a fix rotate CallInst operands, i.e. move callee to the back of the operand array the motivation for this patch are laid out in my mail to llvm-commits: more efficient access to operands and callee, faster callgraph-construction, smaller compiler binary llvm-svn: 101397
* Fix a bunch of namespace polution.Dan Gohman2010-04-152-2/+6
| | | | llvm-svn: 101376
* Make getPredecessorWithUniqueSuccessorForBB return the unique successorDan Gohman2010-04-151-12/+10
| | | | | | in addition to the predecessor. llvm-svn: 101374
* back out r101364, as it trips the linux nightlybot on some clang C++ testsGabor Greif2010-04-156-27/+27
| | | | llvm-svn: 101368
* rotate CallInst operands, i.e. move callee to the backGabor Greif2010-04-156-27/+27
| | | | | | | | | | of the operand array the motivation for this patch are laid out in my mail to llvm-commits: more efficient access to operands and callee, faster callgraph-construction, smaller compiler binary llvm-svn: 101364
* Constify GetConstantStringInfo.Dan Gohman2010-04-141-12/+13
| | | | llvm-svn: 101298
* performance: cache the dereferenced use_iteratorGabor Greif2010-04-141-7/+8
| | | | llvm-svn: 101265
* Add a comment.Dan Gohman2010-04-141-0/+2
| | | | llvm-svn: 101248
* Teach ScalarEvolution to simplify smax and umax when it can proveDan Gohman2010-04-131-2/+14
| | | | | | that one operand is always greater than another. llvm-svn: 101142
* Minor code micro-optimizations.Dan Gohman2010-04-131-7/+7
| | | | llvm-svn: 101141
* Micro-optimize a few hot spots.Dan Gohman2010-04-121-10/+11
| | | | llvm-svn: 101086
* Add fast paths to ScalarEvolution::getSizeOf and getOffsetOf, asDan Gohman2010-04-121-0/+14
| | | | | | | they're used a lot by getNodeForGEP, which can be called a lot. This speeds up -iv-users by around 15% on several testcases. llvm-svn: 101083
* Remove unneeded debug in PostDominator runOnFunction()Tobias Grosser2010-04-121-1/+0
| | | | | | | | The information is already available with "opt -analyze". The DominatorTree does also not have this in its runOnFunction. So they behave now more consistent. llvm-svn: 101038
* Remove dead code in the dotty dominance tree printer.Tobias Grosser2010-04-121-25/+0
| | | | | | | This template is not needed anymore as it was replaced by the DOTGraphTraitsViewer. llvm-svn: 101036
* Generalize ScalarEvolution's PHI analysis to handle loops that don'tDan Gohman2010-04-121-14/+26
| | | | | | | have preheaders or dedicated exit blocks, as clients may not otherwise need to run LoopSimplify. llvm-svn: 101030
* Rewrite the overflow checking in the get{Signed,Unsigned}Range code forDan Gohman2010-04-121-10/+34
| | | | | | | | | AddRecs so that it checks for overflow in the computation that it is performing, rather than just checking hasNo{Signed,Unsigned}Wrap, since those flags are for a different computation. This fixes a bug that impacts an upcoming change. llvm-svn: 101028
* Minor code simplification.Dan Gohman2010-04-121-1/+1
| | | | llvm-svn: 101009
* Fix indentation.Dan Gohman2010-04-111-1/+1
| | | | llvm-svn: 101001
* Enhance ScalarEvolution::isKnownPredicate with support forDan Gohman2010-04-111-8/+33
| | | | | | loop conditions which are invariants. llvm-svn: 100995
* Minor code simplification.Dan Gohman2010-04-111-2/+1
| | | | llvm-svn: 100994
* When creating a ConstantRange for [n,UINT_MAX], special case n == 0, becauseDan Gohman2010-04-111-3/+4
| | | | | | ConstantRange(0, 0) creates an empty range rather than a full one. llvm-svn: 100993
OpenPOWER on IntegriCloud