Commit Graph

22 Commits

Author SHA1 Message Date
Gabor Greif 7cf6056484 simplify
llvm-svn: 109578
2010-07-28 10:57:28 +00:00
Gabor Greif c78d720f02 rename use_const_iterator to const_use_iterator for consistency's sake
llvm-svn: 99564
2010-03-25 23:06:16 +00:00
Duncan Sands 19d0b47b1f There are two ways of checking for a given type, for example isa<PointerType>(T)
and T->isPointerTy().  Convert most instances of the first form to the second form.
Requested by Chris.

llvm-svn: 96344
2010-02-16 11:11:14 +00:00
Dan Gohman 220b196c94 Reuse the Threshold value to size these containers because it's
currently somewhat convenient for them to have the same value.

llvm-svn: 90980
2009-12-09 18:48:53 +00:00
Dan Gohman 56a5f19c70 Fix a typo in a comment, and adjust SmallSet and SmallVector sizes,
that Chris noticed.

llvm-svn: 90910
2009-12-09 00:28:42 +00:00
Dan Gohman 2d27b191d9 Put a threshold on the number of users PointerMayBeCaptured
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-12-08 23:59:12 +00:00
Dan Gohman ff20377740 Use stripPointerCasts(). Thanks Duncan!
llvm-svn: 89472
2009-11-20 19:33:16 +00:00
Dan Gohman a8c144d534 Revert the rule that considers comparisons between two pointers in the
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-20 17:50:21 +00:00
Dan Gohman 6d919f1613 Simplify this code; it's not necessary to check isIdentifiedObject here
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-20 01:34:03 +00:00
Dan Gohman 91449224e8 Refine the capture tracking rules for comparisons to be more
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-20 00:50:47 +00:00
Dan Gohman 01956f5a6b Use isVoidTy().
llvm-svn: 89419
2009-11-20 00:43:11 +00:00
Dan Gohman 772f922acb Refine this to only apply to null in the default address space.
llvm-svn: 89411
2009-11-19 23:53:49 +00:00
Dan Gohman 94e617627d Extend CaptureTracking to indicate when a value is never stored, even
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-19 21:57:48 +00:00
Dan Gohman 0a2ba1068e Comparing a pointer with null is not a capture.
llvm-svn: 89389
2009-11-19 21:34:07 +00:00
Chris Lattner e9dccd4934 remove a check of isFreeCall: the argument to free is already nocapture so the generic call code works fine.
llvm-svn: 85865
2009-11-03 05:34:51 +00:00
Victor Hernandez f390e04a47 Rename MallocFreeHelper as MemoryBuiltins
llvm-svn: 85286
2009-10-27 20:05:49 +00:00
Victor Hernandez 762195bd01 Rename MallocHelper as MallocFreeHelper, since it now also identifies calls to free()
llvm-svn: 85181
2009-10-26 23:58:56 +00:00
Victor Hernandez de5ad42aa1 Remove FreeInst.
Remove LowerAllocations pass.
Update some more passes to treate free calls just like they were treating FreeInst.

llvm-svn: 85176
2009-10-26 23:43:48 +00:00
Owen Anderson 55f1c09e31 Push LLVMContexts through the IntegerType APIs.
llvm-svn: 78948
2009-08-13 21:58:54 +00:00
Duncan Sands 7a8cfafd2e Revert r70876 and add a testcase (@c7) showing the problem:
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-07 18:08:34 +00:00
Duncan Sands 50c70336b0 Teach capture tracking that readonly functions can
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-05-04 16:50:29 +00:00
Duncan Sands e0aa0d677d BasicAliasAnalysis and FunctionAttrs were both
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
2009-01-18 12:19:30 +00:00