summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/GlobalOpt.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Now with fewer extraneous semicolons!Owen Anderson2010-10-071-1/+1
| | | | llvm-svn: 115996
* Reapply r110396, with fixes to appease the Linux buildbot gods.Owen Anderson2010-08-061-1/+1
| | | | llvm-svn: 110460
* Revert r110396 to fix buildbots.Owen Anderson2010-08-061-1/+1
| | | | llvm-svn: 110410
* Don't use PassInfo* as a type identifier for passes. Instead, use the ↵Owen Anderson2010-08-051-1/+1
| | | | | | | | address of the static ID member as the sole unique type identifier. Clean up APIs related to this change. llvm-svn: 110396
* Prefix `next' iterator operation with `llvm::'.Oscar Fuentes2010-08-021-1/+1
| | | | | | | | Fixes potential ambiguity problems on VS 2010. Patch by nobled! llvm-svn: 110029
* undo 80 column trespassing I causedGabor Greif2010-07-221-1/+2
| | | | llvm-svn: 109092
* Fix batch of converting RegisterPass<> to INTIALIZE_PASS().Owen Anderson2010-07-211-1/+2
| | | | llvm-svn: 109045
* eliminate unlockedRefineAbstractTypeTo, types are all per-llvmcontext,Chris Lattner2010-07-161-1/+1
| | | | | | so there is no locking involved in type refinement. llvm-svn: 108553
* cache result of operator*Gabor Greif2010-07-121-4/+6
| | | | llvm-svn: 108144
* make the prototypes for CreateMalloc and CreateFree more consistent. PatchChris Lattner2010-07-121-2/+2
| | | | | | by Hans Vandierendonck from PR7605 llvm-svn: 108116
* cache result of operator*Gabor Greif2010-07-091-6/+6
| | | | llvm-svn: 107990
* use ArgOperand API and CallSite for arg range; add necessary casts and ↵Gabor Greif2010-06-241-11/+14
| | | | | | perform some cosmetics llvm-svn: 106747
* use abstract accessors to CallInstGabor Greif2010-04-201-2/+2
| | | | llvm-svn: 101899
* Revert 101465, it broke internal OpenGL testing.Eric Christopher2010-04-161-13/+13
| | | | | | | Probably the best way to know that all getOperand() calls have been handled is to replace that API instead of updating. llvm-svn: 101579
* reapply r101434Gabor Greif2010-04-161-13/+13
| | | | | | | | | | | | | with a fix for self-hosting rotate CallInst operands, i.e. move callee to the back of the operand array the motivation for this patch are laid out in my mail to llvm-commits: more efficient access to operands and callee, faster callgraph-construction, smaller compiler binary llvm-svn: 101465
* back out r101423 and r101397, they break llvm-gcc self-host on darwin10Gabor Greif2010-04-161-13/+13
| | | | llvm-svn: 101434
* reapply r101364, which has been backed out in r101368Gabor Greif2010-04-151-13/+13
| | | | | | | | | | | | | with a fix rotate CallInst operands, i.e. move callee to the back of the operand array the motivation for this patch are laid out in my mail to llvm-commits: more efficient access to operands and callee, faster callgraph-construction, smaller compiler binary llvm-svn: 101397
* back out r101364, as it trips the linux nightlybot on some clang C++ testsGabor Greif2010-04-151-13/+13
| | | | llvm-svn: 101368
* rotate CallInst operands, i.e. move callee to the backGabor Greif2010-04-151-13/+13
| | | | | | | | | | of the operand array the motivation for this patch are laid out in my mail to llvm-commits: more efficient access to operands and callee, faster callgraph-construction, smaller compiler binary llvm-svn: 101364
* - Code clean up to reduce indentation.Evan Cheng2010-04-141-51/+54
| | | | | | - TryToOptimizeStoreOfMallocToGlobal should check if TargetData is available and bail out if it is not. The transformations being done requires TD. llvm-svn: 101285
* fix PR6760, a missing check in heap SRoA.Chris Lattner2010-04-101-1/+2
| | | | llvm-svn: 100936
* fix 80-col violationsGabor Greif2010-04-071-13/+17
| | | | llvm-svn: 100677
* make more two predicates constantGabor Greif2010-04-061-15/+15
| | | | llvm-svn: 100549
* performance: get rid of repeated dereferencing of use_iterator by caching ↵Gabor Greif2010-04-061-21/+28
| | | | | | its result llvm-svn: 100547
* const-ize predicate ValueIsOnlyUsedLocallyOrStoredToOneGlobalGabor Greif2010-04-061-9/+10
| | | | llvm-svn: 100546
* use CallSite to access calls vs. invokes uniformlyGabor Greif2010-04-061-5/+6
| | | | | | and remove assumptions about operand order llvm-svn: 100544
* Revert the recent alignment changes. They're broken for -Os because,Dan Gohman2010-04-021-7/+1
| | | | | | | in particular, they end up aligning strings at 16-byte boundaries, and there's no way for GlobalOpt to check OptForSize. llvm-svn: 100172
* Make globalopt refine global variable alignment.Dan Gohman2010-04-021-1/+7
| | | | llvm-svn: 100160
* Introduce ImmutableCallSite, useful for contexts where no mutationGabor Greif2010-04-011-37/+37
| | | | | | | | | is necessary. Inherits from new templated baseclass CallSiteBase<> which is highly customizable. Base CallSite on it too, in a configuration that allows full mutation. Adapt some call sites in analyses to employ ImmutableCallSite. llvm-svn: 100100
* Add a setCalledFunction member to InvokeInst (like in CallInst)Gabor Greif2010-03-201-2/+2
| | | | | | | and use this (as well as getCalledValue) to access the callee, instead of {g|s}etOperand(0). llvm-svn: 99084
* Fix rdar://7694996 a miscompile of 183.equake from my patch yesterday,Chris Lattner2010-02-261-3/+2
| | | | | | | | | | | | | confusing the old MAT variable with the new GlobalType one. This caused us to promote the @disp global pointer into: @disp.body = internal global double*** undef instead of: @disp.body = internal global [3 x double**] undef llvm-svn: 97285
* remove dead code, by this point all uses of CI are gone.Chris Lattner2010-02-261-4/+1
| | | | llvm-svn: 97283
* fix PR6435 another bug from the MallocInst elimination work.Chris Lattner2010-02-261-3/+1
| | | | llvm-svn: 97231
* rewrite OptimizeGlobalAddressOfMalloc to fix PR6422, some bugsChris Lattner2010-02-251-79/+73
| | | | | | introduced when mallocinst was eliminated. llvm-svn: 97178
* Modernize comment.Nick Lewycky2010-02-251-1/+1
| | | | llvm-svn: 97121
* There are two ways of checking for a given type, for example isa<PointerType>(T)Duncan Sands2010-02-161-5/+5
| | | | | | | and T->isPointerTy(). Convert most instances of the first form to the second form. Requested by Chris. llvm-svn: 96344
* Uniformize the names of type predicates: rather than having isFloatTy andDuncan Sands2010-02-151-2/+2
| | | | | | isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris! llvm-svn: 96223
* Keep iterating over all uses when meeting a phi node in ↵Jakob Stoklund Olesen2010-01-291-2/+2
| | | | | | | | | | | AllUsesOfValueWillTrapIfNull(). This bug was exposed by my inliner cost changes in r94615, and caused failures of lencod on most architectures when building with LTO. This patch fixes lencod and 464.h264ref on x86-64 (and likely others). llvm-svn: 94858
* handle ConstantVector while I'm in here.Chris Lattner2010-01-071-0/+3
| | | | llvm-svn: 92892
* fix a globalopt crash on 'bullet' (handling evaluation of a storeChris Lattner2010-01-071-16/+20
| | | | | | | | | | 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
* Move remaining stuff to the isInteger predicate.Benjamin Kramer2010-01-051-1/+1
| | | | llvm-svn: 92771
* Avoid going through the LLVMContext for type equality where it's safe to ↵Benjamin Kramer2010-01-051-1/+1
| | | | | | dereference the type pointer. llvm-svn: 92726
* Change errs() to dbgs().David Greene2010-01-051-25/+25
| | | | llvm-svn: 92629
* Teach GlobalOpt to delete aliases with internal linkage (afterDuncan Sands2009-12-081-21/+20
| | | | | | | forwarding any uses). GlobalDCE can also do this, but is only run at -O3. llvm-svn: 90850
* Make ConstantFoldConstantExpression recursively visit the entireDan Gohman2009-11-231-0/+9
| | | | | | | | | | 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
* Update computeArraySize() to use ComputeMultiple() to determine the array ↵Victor Hernandez2009-11-101-7/+7
| | | | | | 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
* - new SROA mallocs should have the mallocs running-or'ed, not the malloc's ↵Victor Hernandez2009-11-071-19/+22
| | | | | | | | bitcast - fix ProcessInternalGlobal() debug output llvm-svn: 86317
* Re-commit r86077 now that r86290 fixes the 179.art and 175.vpr ARM regressions.Victor Hernandez2009-11-071-69/+72
| | | | | | | | | | | | | | | | | | | | | | | 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
* remove a bunch of extraneous LLVMContext argumentsChris Lattner2009-11-061-120/+95
| | | | | | from various APIs, addressing PR5325. llvm-svn: 86231
* Revert r86077 because it caused crashes in 179.art and 175.vpr on ARMVictor Hernandez2009-11-061-74/+68
| | | | llvm-svn: 86213
OpenPOWER on IntegriCloud