summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
* What the loop unroller cares about, rather than just not unrolling loops ↵Owen Anderson2010-09-091-0/+6
| | | | | | | | | | | with calls, is not unrolling loops that contain calls that would be better off getting inlined. This mostly comes up when an interleaved devirtualization pass has devirtualized a call which the inliner will inline on a future pass. Thus, rather than blocking all loops containing calls, add a metric for "inline candidate calls" and block loops containing those instead. llvm-svn: 113535
* Extend the getDependence query with support for PHI translation.Dan Gohman2010-09-092-13/+57
| | | | llvm-svn: 113521
* Refactor code-size reduction estimation methods out of InlineCostAnalyzer ↵Owen Anderson2010-09-091-92/+90
| | | | | | | | | | | and into CodeMetrics. They don't use any InlineCostAnalyzer state, and are useful for other clients who don't necessarily want to use all of InlineCostAnalyzer's logic, some of which is fairly inlining-specific. No intended functionality change. llvm-svn: 113499
* Add a new experimental generalized dependence query interface toDan Gohman2010-09-082-0/+212
| | | | | | | | AliasAnalysis, and some code for implementing the new query on top of existing implementations by making standard alias and getModRefInfo queries. llvm-svn: 113329
* Clean up some of the PassRegistry implementation, and pImpl-ize it to reduce ↵Owen Anderson2010-09-071-0/+2
| | | | | | | | #include clutter and exposing internal details. llvm-svn: 113252
* Add completely hokey binary-and and binary-or operations to ConstantRange andNick Lewycky2010-09-071-0/+6
| | | | | | teach LazyValueInfo to use them. llvm-svn: 113196
* cleanup some of the lifetime/invariant marker stuff, add a big fixme.Chris Lattner2010-09-061-6/+11
| | | | llvm-svn: 113144
* speed up -gvn 3.4% on the testcase in PR7023Chris Lattner2010-09-061-1/+1
| | | | llvm-svn: 113135
* pull a simple method out of LICM into a new Chris Lattner2010-09-061-6/+10
| | | | | | | | | | Loop::hasLoopInvariantOperands method. Remove a useless and confusing Loop::isLoopInvariant(Instruction) method, which didn't do what you thought it did. No functionality change. llvm-svn: 113133
* fix PR8063, a crash in globalopt in the malloc analysis code.Chris Lattner2010-09-051-20/+29
| | | | llvm-svn: 113109
* dead method.Chris Lattner2010-09-041-1/+0
| | | | llvm-svn: 113077
* zap dead code.Chris Lattner2010-09-044-29/+0
| | | | llvm-svn: 113073
* Disable the asserts that check that normalization is perfectlyDan Gohman2010-09-031-2/+7
| | | | | | | | | invertible. ScalarEvolution's folding routines don't always succeed in canonicalizing equal expressions to a single canonical form, and this can cause these asserts to fail, even though there's no actual correctness problem. This fixes PR8066. llvm-svn: 113021
* Add support for simplifying a load from a computed value to a load from a ↵Owen Anderson2010-09-031-2/+11
| | | | | | | | global when it is provable that they're equivalent. This fixes PR4855. llvm-svn: 112994
* stop forcing a noop AssemblyAnnotationWriter to silence #usesChris Lattner2010-09-021-5/+1
| | | | | | comments, these don't happen anymore. llvm-svn: 112901
* Remove incorrect and poorly tested code for trying to reason about values on ↵Owen Anderson2010-09-021-16/+2
| | | | | | | | default edges of switches. Just return the conservatively correct answer. llvm-svn: 112876
* Fix a bug in LazyValueInfo that CorrelatedValuePropagation exposed: In the ↵Owen Anderson2010-09-021-4/+0
| | | | | | | | LVI lattice, undef and the full set ConstantRange should not be treated as equivalent. llvm-svn: 112843
* Revert 112442 and 112440 until the compile time problems introducedDan Gohman2010-09-011-89/+78
| | | | | | by 112440 are resolved. llvm-svn: 112692
* Reapply r112432, now that the real problem is addressed.Dan Gohman2010-08-311-4/+9
| | | | llvm-svn: 112667
* Reapply r112433, now that the real problem is addressed.Dan Gohman2010-08-311-21/+24
| | | | llvm-svn: 112666
* Revert r110916. This patch is buggy because the code inside theDan Gohman2010-08-311-7/+4
| | | | | | inner loop doesn't update all the variables in the outer loop. llvm-svn: 112665
* Revert r112432. It appears to be exposing a problem in the emacs build.Dan Gohman2010-08-311-9/+4
| | | | llvm-svn: 112638
* Speculatively revert r112433.Dan Gohman2010-08-311-24/+21
| | | | llvm-svn: 112608
* It is possible to try to merge a not-constant with a constantrage, when ↵Owen Anderson2010-08-301-2/+3
| | | | | | | | | dealing with ptrtoint ConstantExpr's. Unfortunately, the only testcase I have for this is huge and doesn't reduce well because the error is sensitive to iteration-order issues, since the problem only occurs when merging values in a particular order. llvm-svn: 112489
* Don't print two "0x" prefixes. Use a raw_ostream overload instead of ↵Benjamin Kramer2010-08-301-2/+1
| | | | | | llvm::format. llvm-svn: 112479
* two changes: 1) make AliasSet hold the list of call sites with anChris Lattner2010-08-291-14/+20
| | | | | | | | | | | | | | assertingvh so we get a violent explosion if the pointer dangles. 2) Fix AliasSetTracker::deleteValue to remove call sites with by-pointer comparisons instead of by-alias queries. Using findAliasSetForCallSite can cause alias sets to get merged when they shouldn't, and can also miss alias sets when the call is readonly. #2 fixes PR6889, which only repros with a .c file :( llvm-svn: 112452
* Make IVUsers iterative instead of recursive.Dan Gohman2010-08-291-78/+89
| | | | | | | This has the side effect of reversing the order of most of IVUser's results. llvm-svn: 112442
* Restructure the {A,+,B}<L> * {C,+,D}<L> folding so that it foldsDan Gohman2010-08-291-21/+24
| | | | | | | all applicable addrecs before recursing on getMulExpr, instead of recursing on getMulExpr for each one. llvm-svn: 112433
* Batch up subtracts along with adds, when analyzing long chains ofDan Gohman2010-08-291-4/+9
| | | | | | operations. llvm-svn: 112432
* Micro-optimize GroupByComplexity.Dan Gohman2010-08-291-2/+3
| | | | llvm-svn: 112431
* Hold AddRec->getLoop() in a variable, to make the Mul code more consistentDan Gohman2010-08-291-3/+4
| | | | | | with the Add code. llvm-svn: 112430
* Rename a variable, for consistency.Dan Gohman2010-08-291-5/+8
| | | | llvm-svn: 112429
* Use iterators instead of indices.Dan Gohman2010-08-291-2/+2
| | | | llvm-svn: 112428
* when merging two alias sets, the result set is volatile if eitherChris Lattner2010-08-291-0/+1
| | | | | | | | | of the sets is volatile. We were dropping the volatile bit of the merged in set, leading (luckily) to assertions in cases like PR7535. I cannot produce a testcase that repros with opt, but this is obviously correct. llvm-svn: 112402
* more cleanupChris Lattner2010-08-291-8/+8
| | | | llvm-svn: 112401
* clean this upChris Lattner2010-08-291-51/+53
| | | | llvm-svn: 112400
* Fix an index calculation thinko.Dan Gohman2010-08-281-1/+1
| | | | llvm-svn: 112337
* Improve the precision of getConstant().Owen Anderson2010-08-271-0/+5
| | | | llvm-svn: 112323
* When merging adjacent operands, scan ahead and merge all equalDan Gohman2010-08-271-11/+14
| | | | | | adjacent operands at once, instead of just two at a time. llvm-svn: 112299
* Make the {A,+,B}<L> + {C,+,D}<L> --> Other + {A+C,+,B+D}<L>Dan Gohman2010-08-271-23/+21
| | | | | | | | transformation collect all the addrecs with the same loop add combine them at once rather than starting everything over at the first chance. llvm-svn: 112290
* Switch ScalarEvolution's main Value*->SCEV* map from std::mapDan Gohman2010-08-271-28/+26
| | | | | | to DenseMap. llvm-svn: 112281
* Use LVI to eliminate conditional branches where we've tested a related ↵Owen Anderson2010-08-271-1/+2
| | | | | | | | condition previously. Update tests for this change. This fixes PR5652. llvm-svn: 112270
* Optimize SCEVComplexityCompare. Use a 3-way return instead of a 2-wayDan Gohman2010-08-271-48/+82
| | | | | | | return to avoid needing two calls to test for equivalence, and sort addrecs by their degree before examining their operands. llvm-svn: 112267
* In the default address space, any GEP off of null results in a trap value if ↵Owen Anderson2010-08-251-4/+5
| | | | | | | | | you try to load it. Thus, any load in the default address space that completes implies that the base value that it GEP'd from was not null. llvm-svn: 112015
* NULL loads are only invalid in the default address space.Owen Anderson2010-08-241-1/+1
| | | | llvm-svn: 111972
* Add support for inferring values for the default cases of switches.Owen Anderson2010-08-241-3/+22
| | | | llvm-svn: 111971
* Add support for inferring that a load from a pointer implies that it is not ↵Owen Anderson2010-08-241-4/+17
| | | | | | null. llvm-svn: 111959
* Don't assume that all constants with integer types are ConstantInts.Owen Anderson2010-08-241-2/+11
| | | | llvm-svn: 111906
* Let FE use derived types for DW_TAG_friend.Devang Patel2010-08-231-0/+1
| | | | | | Patch by Alexander Herz! llvm-svn: 111861
* Handle qualified constants that are directly folded by FE.Devang Patel2010-08-231-0/+10
| | | | | | PR 7920. llvm-svn: 111820
OpenPOWER on IntegriCloud