aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
* Add Hybrid Cycle Detection to Andersen's analysis.Daniel Berlin2008-03-051-32/+272
| | | | | | | | Patch by Curtis Dunham. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47959 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix http://llvm.org/bugs/show_bug.cgi?id=2104 by ordering lexicographically ↵Gabor Greif2008-02-281-5/+12
| | | | | | what gets printed. Be const-correct in PrintResults and uninline it too git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47712 91177308-0d34-0410-b5e6-96231b3b80d8
* De-tabify.Bill Wendling2008-02-261-8/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47598 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporarily reverting 46959.Evan Cheng2008-02-251-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47542 91177308-0d34-0410-b5e6-96231b3b80d8
* Change a C-style cast to const_cast, to avoid a -Wcast-qual warning.Dan Gohman2008-02-211-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47437 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify this code, no functionality change.Nick Lewycky2008-02-211-5/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47434 91177308-0d34-0410-b5e6-96231b3b80d8
* GlobalValues are Constants, remove redundant code. Also fix typo in a comment.Nick Lewycky2008-02-211-3/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47433 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak build with gcc 4.3: provide missed includes and silence most ↵Anton Korobeynikov2008-02-204-4/+7
| | | | | | annoying warnings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47367 91177308-0d34-0410-b5e6-96231b3b80d8
* Use getConstant for ConstantInts.Nick Lewycky2008-02-201-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47361 91177308-0d34-0410-b5e6-96231b3b80d8
* Add 'umax' similar to 'smax' SCEV. Closes PR2003.Nick Lewycky2008-02-202-45/+156
| | | | | | | | | | | | | | | | Parse reversed smax and umax as smin and umin and express them with negative or binary-not SCEVs (which are really just subtract under the hood). Parse 'xor %x, -1' as (-1 - %x). Remove dead code (ConstantInt::get always returns a ConstantInt). Don't use getIntegerSCEV(-1, Ty). The first value is an int, then it gets passed into a uint64_t. Instead, create the -1 directly from ConstantInt::getAllOnesValue(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47360 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a compiler warning.Duncan Sands2008-02-191-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47328 91177308-0d34-0410-b5e6-96231b3b80d8
* In addition to arguments passed to it, memcpy (and all other calls) can ↵Owen Anderson2008-02-191-1/+2
| | | | | | ModRef pointers that alias their arguments as well. This fixes PR2057. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47317 91177308-0d34-0410-b5e6-96231b3b80d8
* don't bother calling getUnderlyingObject for non-pointers.Chris Lattner2008-02-181-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47272 91177308-0d34-0410-b5e6-96231b3b80d8
* Since we're not checking for the more general AllocationInst first, we need ↵Owen Anderson2008-02-181-1/+1
| | | | | | | | | to explicitly check that Object is an Argument before casting it to one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47268 91177308-0d34-0410-b5e6-96231b3b80d8
* This check is not correct for mallocs, so exclude them earlier.Owen Anderson2008-02-181-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47263 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a comment, and a bug where we weren't applying the tail call logic in ↵Owen Anderson2008-02-181-6/+8
| | | | | | cases that failed the first test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47253 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bugs that Chris noticed in my last patch.Owen Anderson2008-02-181-9/+17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47252 91177308-0d34-0410-b5e6-96231b3b80d8
* bitcasts of pointers are always pointers.Chris Lattner2008-02-181-5/+2
| | | | | | | | If we see a memcpy of a pointer, make sure to check later uses of the pointer as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47250 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach getModRefInfo that memcpy, memmove, and memset don't "capture" memory ↵Owen Anderson2008-02-171-3/+13
| | | | | | | | | | addresses. Also, noalias arguments are be considered "like" stack allocated ones for this purpose, because the only way they can be modref'ed is if they escape somewhere in the current function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47247 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typo. Thanks to Duncan for noticing.Wojciech Matyjewicz2008-02-131-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47062 91177308-0d34-0410-b5e6-96231b3b80d8
* Add comments as per review feedback.Wojciech Matyjewicz2008-02-131-5/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47061 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-apply the patch to improve the optimizations of memcpy's, with severalOwen Anderson2008-02-121-1/+41
| | | | | | | bugs fixed. This now passes PPC bootstrap. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47026 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR2002. Suppose n is the initial value for the induction Wojciech Matyjewicz2008-02-121-6/+4
| | | | | | | | | | | variable (with step 1) and m is its final value. Then, the correct trip count is SMAX(m,n)-n. Previously, we used SMAX(0,m-n), but m-n may overflow and can't in general be interpreted as signed. Patch by Nick Lewycky. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47007 91177308-0d34-0410-b5e6-96231b3b80d8
* If the LHS of the comparison is a loop-invariant we also want to move it Wojciech Matyjewicz2008-02-111-2/+2
| | | | | | | | | to the RHS. This simple change allows to compute loop iteration count for loops with condition similar to the one in the testcase (which seems to be quite common). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46959 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR1798 - an error in the evaluation of SCEVAddRecExpr at an Wojciech Matyjewicz2008-02-111-49/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | arbitrary iteration. The patch: 1) changes SCEVSDivExpr into SCEVUDivExpr, 2) replaces PartialFact() function with BinomialCoefficient(); the computations (essentially, the division) in BinomialCoefficient() are performed with the apprioprate bitwidth necessary to avoid overflow; unsigned division is used instead of the signed one. Computations in BinomialCoefficient() require support from the code generator for APInts. Currently, we use a hack rounding up the neccessary bitwidth to the nearest power of 2. The hack is easy to turn off in future. One remaining issue: we assume the divisor of the binomial coefficient formula can be computed accurately using 16 bits. It means we can handle AddRecs of length up to 9. In future, we should use APInts to evaluate the divisor. Thanks to Nicholas for cooperation! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46955 91177308-0d34-0410-b5e6-96231b3b80d8
* We should check that existing cast operation has the appropriate opcode ↵Wojciech Matyjewicz2008-02-091-19/+21
| | | | | | before we reuse it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46908 91177308-0d34-0410-b5e6-96231b3b80d8
* Throttle the non-local dependence analysis for basic blocks with more than ↵Tanya Lattner2008-02-061-7/+20
| | | | | | 50 predecessors. Added command line option to play with this threshold. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46790 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an obscure read-after-free bug that Duncan found.Owen Anderson2008-02-051-10/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46738 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid unnecessarily casting away const, fixing a FIXME.Dan Gohman2008-01-312-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46591 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an issue where, under very specific circumstances, memdep could end up ↵Owen Anderson2008-01-301-2/+2
| | | | | | | | | dereferencing the end of one of its internal maps. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46541 91177308-0d34-0410-b5e6-96231b3b80d8
* getUnderlyingObject can return null, handle this.Chris Lattner2008-01-241-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46318 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach basicaa that 'byval' arguments define a new memory location thatChris Lattner2008-01-241-34/+34
| | | | | | | | can't be aliased to other known objects. This allows us to know that byval pointer args don't alias globals, etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46315 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't be rude, emit debugging info where asked to.Nick Lewycky2008-01-021-5/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45485 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-2929-58/+58
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
* remove attribution from lib Makefiles.Chris Lattner2007-12-292-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45415 91177308-0d34-0410-b5e6-96231b3b80d8
* Adding bindings for memory buffers and module providers. SwitchingGordon Henriksen2007-12-191-4/+0
| | | | | | to exceptions rather than variants for error handling in Ocaml. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45226 91177308-0d34-0410-b5e6-96231b3b80d8
* Add explicit keywords, and fix a minor typo that they uncovered.Dan Gohman2007-12-141-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45034 91177308-0d34-0410-b5e6-96231b3b80d8
* Make these loops follow GetGEPOperands() behavior.Wojciech Matyjewicz2007-12-131-11/+13
| | | | | | | | | Let: %q = GEP %p, X, ... If %p is a GEP, we can chase baseptr further, only if X==0. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44999 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r44626, which turned off the use of readonlyDuncan Sands2007-12-121-12/+4
| | | | | | | | | | | and readnone for functions with bodies because it broke llvm-gcc-4.2 bootstrap. It turns out that, because of LLVM's array_ref hack, gcc was computing pure/const attributes wrong (now fixed by turning off the gcc ipa-pure-const pass). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44937 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug in my previous patch, thanks to Jay Foad forChris Lattner2007-12-121-2/+2
| | | | | | | pointing this out and correcting the patch! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44907 91177308-0d34-0410-b5e6-96231b3b80d8
* Changes from Curtis Dunham implementing lazy cycle detection algorithm.Daniel Berlin2007-12-121-125/+287
| | | | | | | | Changes from me implementing different way of representing points-to anything. Changes from me that improve slightly on LCD. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44895 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement constant folding if vector<->vector bitcasts where the numberChris Lattner2007-12-111-2/+122
| | | | | | | | of source/dest elements changes. This implements test/Transforms/InstCombine/bitcast-vector-fold.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44855 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR1850 by removing an unsafe transformation from VMCore/ConstantFold.cpp.Chris Lattner2007-12-102-21/+95
| | | | | | | | | Reimplement the xform in Analysis/ConstantFolding.cpp where we can use targetdata to validate that it is safe. While I'm in there, fix some const correctness issues and generalize the interface to the "operand folder". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44817 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR1782, patch by Wojtek Matyjewicz!Chris Lattner2007-12-091-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44733 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix several cache coherence bugs in MemDep/GVN that were found. Also add ↵Owen Anderson2007-12-081-23/+67
| | | | | | | | | some (disabled) debugging code to make such problems easier to diagnose in the future, written by Duncan Sands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44695 91177308-0d34-0410-b5e6-96231b3b80d8
* Commit 44487 broke bootstrap of llvm-gcc-4.2. It isDuncan Sands2007-12-051-4/+12
| | | | | | | | not yet clear why, but in the meantime work around the problem by making less use of readnone/readonly info. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44626 91177308-0d34-0410-b5e6-96231b3b80d8
* Rather than having special rules like "intrinsics cannotDuncan Sands2007-12-033-42/+5
| | | | | | | | | | throw exceptions", just mark intrinsics with the nounwind attribute. Likewise, mark intrinsics as readnone/readonly and get rid of special aliasing logic (which didn't use anything more than this anyway). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44544 91177308-0d34-0410-b5e6-96231b3b80d8
* Integrate the readonly/readnone logic more deeplyDuncan Sands2007-12-017-43/+58
| | | | | | | | | | | | | | | | into alias analysis. This meant updating the API which now has versions of the getModRefBehavior, doesNotAccessMemory and onlyReadsMemory methods which take a callsite parameter. These should be used unless the callsite is not known, since in general they can do a better job than the versions that take a function. Also, users should no longer call the version of getModRefBehavior that takes both a function and a callsite. To reduce the chance of misuse it is now protected. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44487 91177308-0d34-0410-b5e6-96231b3b80d8
* chain update requests properly.Chris Lattner2007-11-301-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44460 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some convenience methods for querying attributes, andDuncan Sands2007-11-281-3/+2
| | | | | | | use them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44403 91177308-0d34-0410-b5e6-96231b3b80d8