summaryrefslogtreecommitdiff
path: root/lib/Analysis/CaptureTracking.cpp
Commit message (Collapse)AuthorAge
* Give CaptureTracker::shouldExplore a base implementation. Most users want to doNick Lewycky2012-10-08
| | | | | | | the same thing. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165435 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix intendation.Chad Rosier2012-05-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156589 91177308-0d34-0410-b5e6-96231b3b80d8
* Move includes to the .cpp file.Jakub Staszak2012-01-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148342 91177308-0d34-0410-b5e6-96231b3b80d8
* Change CaptureTracking to pass a Use* instead of a Value* when a value isNick Lewycky2011-12-28
| | | | | | | | | | | | | | | captured. This allows the tracker to look at the specific use, which may be especially interesting for function calls. Use this to fix 'nocapture' deduction in FunctionAttrs. The existing one does not iterate until a fixpoint and does not guarantee that it produces the same result regardless of iteration order. The new implementation builds up a graph of how arguments are passed from function to function, and uses a bottom-up walk on the argument-SCCs to assign nocapture. This gets us nocapture more often, and does so rather efficiently and independent of iteration order. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147327 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix crasher in GVN due to my recent capture tracking changes.Nick Lewycky2011-11-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145047 91177308-0d34-0410-b5e6-96231b3b80d8
* Add virtual destructor. Whoops!Nick Lewycky2011-11-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145044 91177308-0d34-0410-b5e6-96231b3b80d8
* Less template, more virtual! Refactoring suggested by Chris in code review.Nick Lewycky2011-11-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145014 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor capture tracking (which already had a couple flags for whether returnsNick Lewycky2011-11-14
| | | | | | | | | | | and stores capture) to permit the caller to see each capture point and decide whether to continue looking. Use this inside memdep to do an analysis that basicaa won't do. This lets us solve another devirtualization case, fixing PR8908! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144580 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't include Operator.h from InstrTypes.h.Jay Foad2011-04-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129271 91177308-0d34-0410-b5e6-96231b3b80d8
* VAArg doesn't capture its operand.Dan Gohman2010-11-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118623 91177308-0d34-0410-b5e6-96231b3b80d8
* simplifyGabor Greif2010-07-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109578 91177308-0d34-0410-b5e6-96231b3b80d8
* rename use_const_iterator to const_use_iterator for consistency's sakeGabor Greif2010-03-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99564 91177308-0d34-0410-b5e6-96231b3b80d8
* There are two ways of checking for a given type, for example isa<PointerType>(T)Duncan Sands2010-02-16
| | | | | | | | and T->isPointerTy(). Convert most instances of the first form to the second form. Requested by Chris. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96344 91177308-0d34-0410-b5e6-96231b3b80d8
* Reuse the Threshold value to size these containers because it'sDan Gohman2009-12-09
| | | | | | | currently somewhat convenient for them to have the same value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90980 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a typo in a comment, and adjust SmallSet and SmallVector sizes,Dan Gohman2009-12-09
| | | | | | | that Chris noticed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90910 91177308-0d34-0410-b5e6-96231b3b80d8
* Put a threshold on the number of users PointerMayBeCapturedDan Gohman2009-12-08
| | | | | | | | | | | | | examines; fall back to a conservative answer if there are more. This works around some several compile time problems resulting from BasicAliasAnalysis calling PointerMayBeCaptured. The value has been chosen arbitrarily. This fixes rdar://7438917 and may partially address PR5708. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90905 91177308-0d34-0410-b5e6-96231b3b80d8
* Use stripPointerCasts(). Thanks Duncan!Dan Gohman2009-11-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89472 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert the rule that considers comparisons between two pointers in theDan Gohman2009-11-20
| | | | | | | | | | | | | same object to be a non-capture; Duncan pointed out a way that such a comparison could be a capture. Make the rule that considers a comparison against null more specific, and only consider noalias return values compared against null. This still supports test/Transforms/GVN/nonescaping-malloc.ll, and is not susceptible to the problem Duncan pointed out with noalias arguments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89468 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify this code; it's not necessary to check isIdentifiedObject hereDan Gohman2009-11-20
| | | | | | | | | because if the results from getUnderlyingObject match, the values must be from the same underlying object, even if we don't know what that object is. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89434 91177308-0d34-0410-b5e6-96231b3b80d8
* Refine the capture tracking rules for comparisons to be moreDan Gohman2009-11-20
| | | | | | | | | | careful about crazy methods of capturing pointers using comparisons. Comparisons of identified objects with null in the default address space are not captures. And, comparisons of two pointers within the same identified object are not captures. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89421 91177308-0d34-0410-b5e6-96231b3b80d8
* Use isVoidTy().Dan Gohman2009-11-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89419 91177308-0d34-0410-b5e6-96231b3b80d8
* Refine this to only apply to null in the default address space.Dan Gohman2009-11-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89411 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend CaptureTracking to indicate when a value is never stored, evenDan Gohman2009-11-19
| | | | | | | | | if it is not ultimately captured. Teach BasicAliasAnalysis that a local object address which does not escape and is never stored does not alias with a value resulting from a load. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89398 91177308-0d34-0410-b5e6-96231b3b80d8
* Comparing a pointer with null is not a capture.Dan Gohman2009-11-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89389 91177308-0d34-0410-b5e6-96231b3b80d8
* remove a check of isFreeCall: the argument to free is already nocapture so ↵Chris Lattner2009-11-03
| | | | | | the generic call code works fine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85865 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename MallocFreeHelper as MemoryBuiltinsVictor Hernandez2009-10-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85286 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename MallocHelper as MallocFreeHelper, since it now also identifies calls ↵Victor Hernandez2009-10-26
| | | | | | to free() git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85181 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove FreeInst.Victor Hernandez2009-10-26
| | | | | | | | | Remove LowerAllocations pass. Update some more passes to treate free calls just like they were treating FreeInst. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85176 91177308-0d34-0410-b5e6-96231b3b80d8
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78948 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r70876 and add a testcase (@c7) showing the problem:Duncan Sands2009-05-07
| | | | | | | | | | | | bits captured, but the pointer marked nocapture. In fact I now recall that this problem is why only readnone functions returning void were considered before! However keep a small fix that was also in r70876: a readnone function returning void can result in bits being captured if it unwinds, so test for this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71168 91177308-0d34-0410-b5e6-96231b3b80d8
* Restore minor deletion.Mike Stump2009-05-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70892 91177308-0d34-0410-b5e6-96231b3b80d8
* BasicAliasAnalysis and FunctionAttrs were bothDuncan Sands2009-01-18
doing very similar pointer capture analysis. Factor out the common logic. The new version is from FunctionAttrs since it does a better job than the version in BasicAliasAnalysis git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62461 91177308-0d34-0410-b5e6-96231b3b80d8