aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/CaptureTracking.cpp
AgeCommit message (Collapse)AuthorFilesLines
2012-10-08Give CaptureTracker::shouldExplore a base implementation. Most users want to doNick Lewycky1-2/+2
the same thing. No functionality change. llvm-svn: 165435
2012-05-10Fix intendation.Chad Rosier1-1/+1
llvm-svn: 156589
2012-01-17Move includes to the .cpp file.Jakub Staszak1-0/+2
llvm-svn: 148342
2011-12-28Change CaptureTracking to pass a Use* instead of a Value* when a value isNick Lewycky1-6/+6
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. llvm-svn: 147327
2011-11-21Fix crasher in GVN due to my recent capture tracking changes.Nick Lewycky1-0/+3
llvm-svn: 145047
2011-11-21Add virtual destructor. Whoops!Nick Lewycky1-0/+2
llvm-svn: 145044
2011-11-20Less template, more virtual! Refactoring suggested by Chris in code review.Nick Lewycky1-2/+107
llvm-svn: 145014
2011-11-14Refactor capture tracking (which already had a couple flags for whether returnsNick Lewycky1-116/+31
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! llvm-svn: 144580
2011-04-11Don't include Operator.h from InstrTypes.h.Jay Foad1-0/+1
llvm-svn: 129271
2010-11-09VAArg doesn't capture its operand.Dan Gohman1-0/+3
llvm-svn: 118623
2010-07-28simplifyGabor Greif1-1/+1
llvm-svn: 109578
2010-03-25rename use_const_iterator to const_use_iterator for consistency's sakeGabor Greif1-1/+1
llvm-svn: 99564
2010-02-16There are two ways of checking for a given type, for example isa<PointerType>(T)Duncan Sands1-1/+1
and T->isPointerTy(). Convert most instances of the first form to the second form. Requested by Chris. llvm-svn: 96344
2009-12-09Reuse the Threshold value to size these containers because it'sDan Gohman1-2/+2
currently somewhat convenient for them to have the same value. llvm-svn: 90980
2009-12-09Fix a typo in a comment, and adjust SmallSet and SmallVector sizes,Dan Gohman1-7/+7
that Chris noticed. llvm-svn: 90910
2009-12-08Put a threshold on the number of users PointerMayBeCapturedDan Gohman1-0/+16
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. llvm-svn: 90905
2009-11-20Use stripPointerCasts(). Thanks Duncan!Dan Gohman1-1/+1
llvm-svn: 89472
2009-11-20Revert the rule that considers comparisons between two pointers in theDan Gohman1-9/+4
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. llvm-svn: 89468
2009-11-20Simplify this code; it's not necessary to check isIdentifiedObject hereDan Gohman1-7/+5
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. llvm-svn: 89434
2009-11-20Refine the capture tracking rules for comparisons to be moreDan Gohman1-6/+19
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. llvm-svn: 89421
2009-11-20Use isVoidTy().Dan Gohman1-2/+1
llvm-svn: 89419
2009-11-19Refine this to only apply to null in the default address space.Dan Gohman1-2/+4
llvm-svn: 89411
2009-11-19Extend CaptureTracking to indicate when a value is never stored, evenDan Gohman1-2/+9
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. llvm-svn: 89398
2009-11-19Comparing a pointer with null is not a capture.Dan Gohman1-0/+5
llvm-svn: 89389
2009-11-03remove a check of isFreeCall: the argument to free is already nocapture so ↵Chris Lattner1-4/+0
the generic call code works fine. llvm-svn: 85865
2009-10-27Rename MallocFreeHelper as MemoryBuiltinsVictor Hernandez1-1/+1
llvm-svn: 85286
2009-10-26Rename MallocHelper as MallocFreeHelper, since it now also identifies calls ↵Victor Hernandez1-1/+1
to free() llvm-svn: 85181
2009-10-26Remove FreeInst.Victor Hernandez1-3/+4
Remove LowerAllocations pass. Update some more passes to treate free calls just like they were treating FreeInst. llvm-svn: 85176
2009-08-13Push LLVMContexts through the IntegerType APIs.Owen Anderson1-1/+1
llvm-svn: 78948
2009-05-07Revert r70876 and add a testcase (@c7) showing the problem:Duncan Sands1-47/+30
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. llvm-svn: 71168
2009-05-04Teach capture tracking that readonly functions canDuncan Sands1-28/+47
only capture their arguments by returning them or throwing an exception or not based on the argument value. Patch essentially by Frits van Bommel. llvm-svn: 70876
2009-01-18BasicAliasAnalysis and FunctionAttrs were bothDuncan Sands1-0/+110
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 llvm-svn: 62461