summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO
Commit message (Collapse)AuthorAgeFilesLines
...
* Add missing whitespace.Nick Lewycky2011-01-151-2/+2
| | | | llvm-svn: 123543
* Make constmerge a two-pass algorithm so that it won't miss mergingNick Lewycky2011-01-151-4/+34
| | | | | | opporuntities. Fixes PR8978. llvm-svn: 123541
* Try to unbreak selfhost.Benjamin Kramer2011-01-151-0/+1
| | | | llvm-svn: 123537
* Add a cache that protects mergefunc's internals from more surprises in DenseSet.Nick Lewycky2011-01-151-5/+27
| | | | | | Also, replace tabs with spaces. Yes, it's 2011. llvm-svn: 123535
* Fix a false-positive warning.Owen Anderson2011-01-141-1/+3
| | | | llvm-svn: 123480
* Enhance GlobalOpt to be able evaluate initializers that involve stores throughOwen Anderson2011-01-141-2/+49
| | | | | | bitcasts, at least in simple cases. This fixes clang's CodeGenCXX/virtual-base-dtor.cpp llvm-svn: 123477
* Improve the accuracy of the inlining heuristic looking for theDale Johannesen2011-01-041-9/+14
| | | | | | | | | | case where a static caller is itself inlined everywhere else, and thus may go away if it doesn't get too big due to inlining other things into it. If there are references to the caller other than calls, it will not be removed; account for this. This results in same-day completion of the case in PR8853. llvm-svn: 122821
* Also remove functions that use complex constant expressions in terms ofNick Lewycky2011-01-021-5/+18
| | | | | | another function. llvm-svn: 122705
* Remove functions from the FnSet when one of their callee's is being merged. ThisNick Lewycky2011-01-021-82/+66
| | | | | | | | | | | maintains the guarantee that the DenseSet expects two elements it contains to not go from inequal to equal under its nose. As a side-effect, this also lets us switch from iterating to a fixed-point to actually maintaining a work queue of functions to look at again, and we don't add thunks to our work queue so we don't need to detect and ignore them. llvm-svn: 122677
* fix a globalopt crash on two Adobe-C++ testcases that the recentChris Lattner2011-01-011-0/+5
| | | | | | loop idiom pass exposed. llvm-svn: 122674
* reapply r121100 with a tweak to constant fold ConstExprs with TargetDataChris Lattner2010-12-071-8/+95
| | | | | | | | (if available) as we go so that we get simple constantexprs not insane ones. This fixes the failure of clang/test/CodeGenCXX/virtual-base-ctor.cpp that the previous iteration of this patch had. llvm-svn: 121111
* Temporarily revert r121100 as it's causing clang to failEric Christopher2010-12-071-85/+5
| | | | | | CodeGenCXX/virtual-base-ctor.cpp. llvm-svn: 121102
* fix PR8710 - teach global opt that some constantexprs are too complex toChris Lattner2010-12-071-5/+85
| | | | | | put in a global variable's initializer. llvm-svn: 121100
* replace a linear scan with a symtab lookup, reduce indentation.Chris Lattner2010-12-061-38/+38
| | | | | | No functionality change. llvm-svn: 121042
* Fix PR8735, a really terrible problem in the inliner's "alloca merging"Chris Lattner2010-12-061-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | optimization. Consider: static void foo() { A = alloca ... } static void bar() { B = alloca ... call foo(); } void main() { bar() } The inliner proceeds bottom up, but lets pretend it decides not to inline foo into bar. When it gets to main, it inlines bar into main(), and says "hey, I just inlined an alloca "B" into main, lets remember that. Then it keeps going and finds that it now contains a call to foo. It decides to inline foo into main, and says "hey, foo has an alloca A, and I have an alloca B from another inlined call site, lets reuse it". The problem with this of course, is that the lifetime of A and B are nested, not disjoint. Unfortunately I can't create a reasonable testcase for this: the one in the PR is both huge and extremely sensitive, because you minor tweaks end up causing foo to get inlined into bar too early. We already have tests for the basic alloca merging optimization and this does not break them. llvm-svn: 120995
* improve -debug output and comments a little.Chris Lattner2010-12-061-3/+5
| | | | llvm-svn: 120993
* Add helper functions for computing the Location of load, store,Dan Gohman2010-11-112-14/+4
| | | | | | and vaarg instructions. llvm-svn: 118845
* Factor out Instruction::isSafeToSpeculativelyExecute's code forDan Gohman2010-11-111-14/+1
| | | | | | | | | | | | testing for dereferenceable pointers into a helper function, isDereferenceablePointer. Teach it how to reason about GEPs with simple non-zero indices. Also eliminate ArgumentPromtion's IsAlwaysValidPointer, which didn't check for weak externals or out of range gep indices. llvm-svn: 118840
* TBAA-enable ArgumentPromotion.Dan Gohman2010-11-111-8/+8
| | | | llvm-svn: 118804
* Add a doesAccessArgPointees helper function, and update code to useDan Gohman2010-11-101-1/+1
| | | | | | it, and to be consistent. llvm-svn: 118692
* Factor out the code for testing whether a function accessesDan Gohman2010-11-101-3/+2
| | | | | | arbitrary memory into a helper function, and adjust some comments. llvm-svn: 118687
* Make ModRefBehavior a lattice. Use this to clean up AliasAnalysisDan Gohman2010-11-101-44/+31
| | | | | | chaining and simplify FunctionAttrs' GetModRefBehavior logic. llvm-svn: 118660
* Teach FunctionAttrs about the VAArg instruction.Dan Gohman2010-11-091-0/+7
| | | | llvm-svn: 118627
* Use the AliasAnalysis interface to determine how a Function accessesDan Gohman2010-11-091-2/+3
| | | | | | | memory. This isn't a real improvement with present day AliasAnalysis implementations; it's mainly for consistency. llvm-svn: 118624
* Teach FunctionAttrs about AccessesArgumentsReadonly.Dan Gohman2010-11-091-0/+19
| | | | llvm-svn: 118617
* Fix a thinko that Duncan spotted.Dan Gohman2010-11-081-1/+1
| | | | llvm-svn: 118430
* Make FunctionAttrs TBAA-aware.Dan Gohman2010-11-081-12/+24
| | | | llvm-svn: 118417
* Extend the AliasAnalysis::pointsToConstantMemory interface to allow itDan Gohman2010-11-081-52/+5
| | | | | | | | | | | | to optionally look for constant or local (alloca) memory. Teach BasicAliasAnalysis::pointsToConstantMemory to look through Select and Phi nodes, and to support looking for local memory. Remove FunctionAttrs' PointsToLocalOrConstantMemory function, now that AliasAnalysis knows all the tricks that it knew. llvm-svn: 118412
* Make FunctionAttrs use AliasAnalysis::getModRefBehavior, now that itDan Gohman2010-11-081-18/+33
| | | | | | knows about intrinsic functions. llvm-svn: 118410
* Rename PointsToLocalMemory to PointsToLocalOrConstantMemory to makeDuncan Sands2010-11-031-8/+11
| | | | | | the code more self-documenting. llvm-svn: 118171
* Let the -inline-threshold command line argument take precedence over theJakob Stoklund Olesen2010-11-021-1/+2
| | | | | | | | threshold given to createFunctionInliningPass(). Both opt -O3 and clang would silently ignore the -inline-threshold option. llvm-svn: 118117
* Now that the MallocInst no longer exists, this workaround forDuncan Sands2010-10-301-5/+0
| | | | | | it claiming not to have side-effects is no longer needed. llvm-svn: 117789
* If a function does a volatile load from a global constant, do notDuncan Sands2010-10-301-4/+4
| | | | | | | | | consider it to be readonly. In fact, don't even consider it to be readonly if it does a volatile load from an AllocaInst either (it is debatable as to whether readonly would be correct or not in this case; play safe for the moment). This fixes PR8279. llvm-svn: 117783
* RetOp is not actually used for anything useful (thoughDuncan Sands2010-10-211-2/+0
| | | | | | | it looks like maybe it was supposed to be used in the test...), so zap it (gcc-4.6 warning). llvm-svn: 117023
* Reapply r116831 and r116839, converting AliasAnalysis to useDan Gohman2010-10-191-1/+1
| | | | | | uint64_t, plus fixes for places I missed before. llvm-svn: 116875
* Get rid of static constructors for pass registration. Instead, every pass ↵Owen Anderson2010-10-1920-24/+75
| | | | | | | | | | | | | | | | | exposes an initializeMyPassFunction(), which must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize the pass's dependencies. Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h before parsing commandline arguments. I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass registration/creation, please send the testcase to me directly. llvm-svn: 116820
* GlobalOpt: EvaluateFunction() must not evaluate stores to weak_odr globals.Mikhail Glushenkov2010-10-191-6/+7
| | | | | | Fixes PR8389. llvm-svn: 116812
* Trailing whitespace.Mikhail Glushenkov2010-10-181-151/+151
| | | | llvm-svn: 116749
* CallGraphSCC passes implicity require CallGraph analysis.Owen Anderson2010-10-135-4/+17
| | | | llvm-svn: 116443
* Be more consistent in using ValueToValueMapTy.Rafael Espindola2010-10-132-4/+4
| | | | llvm-svn: 116387
* Begin adding static dependence information to passes, which will allow us toOwen Anderson2010-10-123-3/+14
| | | | | | | | | perform initialization without static constructors AND without explicit initialization by the client. For the moment, passes are required to initialize both their (potential) dependencies and any passes they preserve. I hope to be able to relax the latter requirement in the future. llvm-svn: 116334
* Now using a variant of the existing inlining heuristics to decide whether to ↵Kenneth Uildriks2010-10-091-40/+50
| | | | | | create a given specialization of a function in PartialSpecialization. If the total performance bonus across all callsites passing the same constant exceeds the specialization cost, we create the specialization. llvm-svn: 116158
* Now with fewer extraneous semicolons!Owen Anderson2010-10-0720-26/+26
| | | | llvm-svn: 115996
* Add an initialization routine for libLLVMipo.aOwen Anderson2010-10-071-2/+37
| | | | llvm-svn: 115933
* Massive rewrite of MMX: Dale Johannesen2010-09-301-2/+4
| | | | | | | | | | | | | | | | | | | The x86_mmx type is used for MMX intrinsics, parameters and return values where these use MMX registers, and is also supported in load, store, and bitcast. Only the above operations generate MMX instructions, and optimizations do not operate on or produce MMX intrinsics. MMX-sized vectors <2 x i32> etc. are lowered to XMM or split into smaller pieces. Optimizations may occur on these forms and the result casted back to x86_mmx, provided the result feeds into a previous existing x86_mmx operation. The point of all this is prevent optimizations from introducing MMX operations, which is unsafe due to the EMMS problem. llvm-svn: 115243
* Removed a bunch of unnecessary target_link_libraries.Oscar Fuentes2010-09-281-2/+0
| | | | llvm-svn: 114999
* Fix llvm-extract so that it changes the linkage of all GlobalValues toBob Wilson2010-09-231-16/+14
| | | | | | | "external" even when doing lazy bitcode loading. This was broken because a function that is not materialized fails the !isDeclaration() test. llvm-svn: 114666
* fix PR8144, a bug where constant merge would merge globals markedChris Lattner2010-09-151-1/+27
| | | | | | attribute(used). llvm-svn: 113911
* Revert "CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally."Michael J. Spencer2010-09-131-8/+1
| | | | | | | | | | This reverts commit r113632 Conflicts: cmake/modules/AddLLVM.cmake llvm-svn: 113819
* CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally.Michael J. Spencer2010-09-101-1/+8
| | | | llvm-svn: 113632
OpenPOWER on IntegriCloud