| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
llvm-svn: 92892
|
| |
|
|
|
|
|
|
|
|
| |
to an element of a vector in a static ctor) which occurs with an
unrelated patch I'm testing. Annoyingly, EvaluateStoreInto basically
does exactly the same stuff as InsertElement constant folding, but it
now handles vectors, and you can't insertelement into a vector. It
would be 'really nice' if GEP into a vector were not legal.
llvm-svn: 92889
|
| |
|
|
| |
llvm-svn: 92771
|
| |
|
|
|
|
| |
dereference the type pointer.
llvm-svn: 92726
|
| |
|
|
| |
llvm-svn: 92629
|
| |
|
|
|
|
|
| |
forwarding any uses). GlobalDCE can also do this, but is only
run at -O3.
llvm-svn: 90850
|
| |
|
|
|
|
|
|
|
|
| |
ConstantExpr, not just the top-level operator. This allows it to
fold many more constants.
Also, make GlobalOpt call ConstantFoldConstantExpression on
GlobalVariable initializers.
llvm-svn: 89659
|
| |
|
|
|
|
| |
size associated with a malloc; also extend PerformHeapAllocSRoA() to check if the optimized malloc's arg had its highest bit set, so that it is safe for ComputeMultiple() to look through sext instructions while determining the optimized malloc's array size
llvm-svn: 86676
|
| |
|
|
|
|
|
|
| |
bitcast
- fix ProcessInternalGlobal() debug output
llvm-svn: 86317
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Here is the original commit message:
This commit updates malloc optimizations to operate on malloc calls that have constant int size arguments.
Update CreateMalloc so that its callers specify the size to allocate:
MallocInst-autoupgrade users use non-TargetData-computed allocation sizes.
Optimization uses use TargetData to compute the allocation size.
Now that malloc calls can have constant sizes, update isArrayMallocHelper() to use TargetData to determine the size of the malloced type and the size of malloced arrays.
Extend getMallocType() to support malloc calls that have non-bitcast uses.
Update OptimizeGlobalAddressOfMalloc() to optimize malloc calls that have non-bitcast uses. The bitcast use of a malloc call has to be treated specially here because the uses of the bitcast need to be replaced and the bitcast needs to be erased (just like the malloc call) for OptimizeGlobalAddressOfMalloc() to work correctly.
Update PerformHeapAllocSRoA() to optimize malloc calls that have non-bitcast uses. The bitcast use of the malloc is not handled specially here because ReplaceUsesOfMallocWithGlobal replaces through the bitcast use.
Update OptimizeOnceStoredGlobal() to not care about the malloc calls' bitcast use.
Update all globalopt malloc tests to not rely on autoupgraded-MallocInsts, but instead use explicit malloc calls with correct allocation sizes.
llvm-svn: 86311
|
| |
|
|
|
|
| |
from various APIs, addressing PR5325.
llvm-svn: 86231
|
| |
|
|
| |
llvm-svn: 86213
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
MallocInst-autoupgrade users use non-TargetData-computed allocation sizes.
Optimization uses use TargetData to compute the allocation size.
Now that malloc calls can have constant sizes, update isArrayMallocHelper() to use TargetData to determine the size of the malloced type and the size of malloced arrays.
Extend getMallocType() to support malloc calls that have non-bitcast uses.
Update OptimizeGlobalAddressOfMalloc() to optimize malloc calls that have non-bitcast uses. The bitcast use of a malloc call has to be treated specially here because the uses of the bitcast need to be replaced and the bitcast needs to be erased (just like the malloc call) for OptimizeGlobalAddressOfMalloc() to work correctly.
Update PerformHeapAllocSRoA() to optimize malloc calls that have non-bitcast uses. The bitcast use of the malloc is not handled specially here because ReplaceUsesOfMallocWithGlobal replaces through the bitcast use.
Update OptimizeOnceStoredGlobal() to not care about the malloc calls' bitcast use.
Update all globalopt malloc tests to not rely on autoupgraded-MallocInsts, but instead use explicit malloc calls with correct allocation sizes.
llvm-svn: 86077
|
| |
|
|
| |
llvm-svn: 85730
|
| |
|
|
|
|
|
| |
indirectbr, thus we don't need "blockaddr(@func, null)". Eliminate it
for simplicity.
llvm-svn: 85699
|
| |
|
|
| |
llvm-svn: 85680
|
| |
|
|
|
|
| |
static constructors with indirect gotos :)
llvm-svn: 85495
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
argument is:
ArraySize * ElementSize
ElementSize * ArraySize
ArraySize << log2(ElementSize)
ElementSize << log2(ArraySize)
Refactor isArrayMallocHelper and delete isSafeToGetMallocArraySize, so that there is only 1 copy of the malloc array determining logic.
Update users of getMallocArraySize() to not bother calling isArrayMalloc() as well.
llvm-svn: 85421
|
| |
|
|
| |
llvm-svn: 85286
|
| |
|
|
|
|
| |
to free()
llvm-svn: 85181
|
| |
|
|
|
|
| |
VISIBILITY_HIDDEN removal.
llvm-svn: 85043
|
| |
|
|
|
|
|
| |
Chris claims we should never have visibility_hidden inside any .cpp file but
that's still not true even after this commit.
llvm-svn: 85042
|
| |
|
|
|
|
|
| |
Update all analysis passes and transforms to treat free calls just like FreeInst.
Remove RaiseAllocations and all its tests since FreeInst no longer needs to be raised.
llvm-svn: 84987
|
| |
|
|
| |
llvm-svn: 84299
|
| |
|
|
| |
llvm-svn: 84288
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
resulted in MallocHelper
identifying the malloc as a non-array malloc. This broke GlobalOpt's optimization of stores of mallocs
to global variables.
The fix is to classify malloc's into 3 categories:
1. non-array mallocs
2. array mallocs whose array size can be determined
3. mallocs that cannot be determined to be of type 1 or 2 and cannot be optimized
getMallocArraySize() returns NULL for category 3, and all users of this function must avoid their
malloc optimization if this function returns NULL.
Eventually, currently unexpected codegen for computing the malloc's size argument will be supported in
isArrayMalloc() and getMallocArraySize(), extending malloc optimizations to those examples.
llvm-svn: 84199
|
| |
|
|
|
|
| |
ConstantFoldLoadThroughGEPConstantExpr.
llvm-svn: 83311
|
| |
|
|
|
|
| |
update the code which was broken by this.
llvm-svn: 82327
|
| |
|
|
|
|
|
|
| |
calls as to MallocInst.
Reviewed by Dan Gohman.
llvm-svn: 82300
|
| |
|
|
|
|
|
|
|
| |
within the notional bounds of the static type of the getelementptr (which
is not the same as "inbounds") from GlobalOpt into a utility routine,
and use it in ConstantFold.cpp to check whether there are any mis-behaved
indices.
llvm-svn: 81478
|
| |
|
|
|
|
|
|
| |
compile-time constant integers or that are out of bounds for their
corresponding static array types. These can cause aliasing that
GlobalOpt assumes won't happen.
llvm-svn: 81165
|
| |
|
|
|
|
|
| |
an aggregate store overlapping a different aggregate store, despite
the stores having distinct addresses.
llvm-svn: 81164
|
| |
|
|
|
|
|
|
| |
is missing the inbounds flag. This is slightly conservative, but it
avoids problems with two constants pointing to the same address but
getting distinct entries in the Memory DenseMap.
llvm-svn: 81163
|
| |
|
|
|
|
| |
into a getelementptr ConstantExpr.
llvm-svn: 81162
|
| |
|
|
| |
llvm-svn: 81161
|
| |
|
|
|
|
| |
This required converting a bunch of stuff off DOUT and other cleanups.
llvm-svn: 79819
|
| |
|
|
|
|
|
| |
by hand, and fix a few places that were using hasInitializer() that
appear to depend on the initializer value.
llvm-svn: 79441
|
| |
|
|
|
|
| |
unruly indices for arrays that are members of structs.
llvm-svn: 79337
|
| |
|
|
|
|
|
|
|
|
|
| |
vector (&Formals[0]). With this change llvm-gcc builds
with expensive checking enabled for C, C++ and Fortran.
While there, change a std::vector into a SmallVector.
This is partly gratuitous, but mostly because not all
STL vector implementations define the data method (and
it should be faster).
llvm-svn: 79237
|
| |
|
|
| |
llvm-svn: 78967
|
| |
|
|
| |
llvm-svn: 78948
|
| |
|
|
| |
llvm-svn: 78809
|
| |
|
|
|
|
| |
contexts through a number of APIs.
llvm-svn: 78258
|
| |
|
|
|
|
|
|
| |
change back are
metadata related, which I'm waiting on to avoid conflicting with Devang.
llvm-svn: 77721
|
| |
|
|
| |
llvm-svn: 77685
|
| |
|
|
| |
llvm-svn: 77635
|
| |
|
|
| |
llvm-svn: 77605
|
| |
|
|
|
|
|
|
|
| |
a Twine, e.g., for names).
- I am a little ambivalent about this; we don't want the string conversion of
utostr, but using overload '+' mixed with string and integer arguments is
sketchy. On the other hand, this particular usage is something of an idiom.
llvm-svn: 77579
|
| |
|
|
| |
llvm-svn: 77516
|
| |
|
|
| |
llvm-svn: 77494
|