summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
* 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 llvm-svn: 47712
* De-tabify.Bill Wendling2008-02-261-8/+8
| | | | llvm-svn: 47598
* Temporarily reverting 46959.Evan Cheng2008-02-251-2/+2
| | | | llvm-svn: 47542
* Change a C-style cast to const_cast, to avoid a -Wcast-qual warning.Dan Gohman2008-02-211-1/+1
| | | | llvm-svn: 47437
* Simplify this code, no functionality change.Nick Lewycky2008-02-211-5/+2
| | | | llvm-svn: 47434
* GlobalValues are Constants, remove redundant code. Also fix typo in a comment.Nick Lewycky2008-02-211-3/+1
| | | | llvm-svn: 47433
* Unbreak build with gcc 4.3: provide missed includes and silence most ↵Anton Korobeynikov2008-02-204-4/+7
| | | | | | annoying warnings. llvm-svn: 47367
* Use getConstant for ConstantInts.Nick Lewycky2008-02-201-2/+2
| | | | llvm-svn: 47361
* 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(). llvm-svn: 47360
* Fix a compiler warning.Duncan Sands2008-02-191-1/+1
| | | | llvm-svn: 47328
* 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. llvm-svn: 47317
* don't bother calling getUnderlyingObject for non-pointers.Chris Lattner2008-02-181-1/+2
| | | | llvm-svn: 47272
* 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. llvm-svn: 47268
* This check is not correct for mallocs, so exclude them earlier.Owen Anderson2008-02-181-2/+2
| | | | llvm-svn: 47263
* 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. llvm-svn: 47253
* Fix bugs that Chris noticed in my last patch.Owen Anderson2008-02-181-9/+17
| | | | llvm-svn: 47252
* 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. llvm-svn: 47250
* 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. llvm-svn: 47247
* Fix typo. Thanks to Duncan for noticing.Wojciech Matyjewicz2008-02-131-1/+1
| | | | llvm-svn: 47062
* Add comments as per review feedback.Wojciech Matyjewicz2008-02-131-5/+13
| | | | llvm-svn: 47061
* 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. llvm-svn: 47026
* 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. llvm-svn: 47007
* 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). llvm-svn: 46959
* 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! llvm-svn: 46955
* We should check that existing cast operation has the appropriate opcode ↵Wojciech Matyjewicz2008-02-091-19/+21
| | | | | | before we reuse it. llvm-svn: 46908
* 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. llvm-svn: 46790
* Fix an obscure read-after-free bug that Duncan found.Owen Anderson2008-02-051-10/+20
| | | | llvm-svn: 46738
* Avoid unnecessarily casting away const, fixing a FIXME.Dan Gohman2008-01-312-2/+2
| | | | llvm-svn: 46591
* 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. llvm-svn: 46541
* getUnderlyingObject can return null, handle this.Chris Lattner2008-01-241-2/+3
| | | | llvm-svn: 46318
* 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. llvm-svn: 46315
* Don't be rude, emit debugging info where asked to.Nick Lewycky2008-01-021-5/+5
| | | | llvm-svn: 45485
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-2929-58/+58
| | | | llvm-svn: 45418
* remove attribution from lib Makefiles.Chris Lattner2007-12-292-4/+4
| | | | llvm-svn: 45415
* Adding bindings for memory buffers and module providers. SwitchingGordon Henriksen2007-12-191-4/+0
| | | | | | to exceptions rather than variants for error handling in Ocaml. llvm-svn: 45226
* Add explicit keywords, and fix a minor typo that they uncovered.Dan Gohman2007-12-141-1/+1
| | | | llvm-svn: 45034
* 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. llvm-svn: 44999
* 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). llvm-svn: 44937
* Fix a bug in my previous patch, thanks to Jay Foad forChris Lattner2007-12-121-2/+2
| | | | | | pointing this out and correcting the patch! llvm-svn: 44907
* 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. llvm-svn: 44895
* 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 llvm-svn: 44855
* 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". llvm-svn: 44817
* Fix PR1782, patch by Wojtek Matyjewicz!Chris Lattner2007-12-091-4/+4
| | | | llvm-svn: 44733
* 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. llvm-svn: 44695
* 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. llvm-svn: 44626
* 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). llvm-svn: 44544
* 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. llvm-svn: 44487
* chain update requests properly.Chris Lattner2007-11-301-0/+3
| | | | llvm-svn: 44460
* Add some convenience methods for querying attributes, andDuncan Sands2007-11-281-3/+2
| | | | | | use them. llvm-svn: 44403
* Fix PR1146: parameter attributes are longer part ofDuncan Sands2007-11-271-2/+2
| | | | | | | | | | | | the function type, instead they belong to functions and function calls. This is an updated and slightly corrected version of Reid Spencer's original patch. The only known problem is that auto-upgrading of bitcode files doesn't seem to work properly (see test/Bitcode/AutoUpgradeIntrinsics.ll). Hopefully a bitcode guru (who might that be? :) ) will fix it. llvm-svn: 44359
OpenPOWER on IntegriCloud