summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO
Commit message (Collapse)AuthorAgeFilesLines
* Refactor code from inlining and globalopt that checks whether a function ↵Eli Friedman2011-10-202-5/+2
| | | | | | definition is unused, and enhance it so it can tell that functions which are only used by a blockaddress are in fact dead. This probably doesn't happen much on most code, but the Linux kernel's _THIS_IP_ can trigger this issue with blockaddress. (GlobalDCE can also handle the given tescase, but we only run that at -O3.) Found while looking at PR11180. llvm-svn: 142572
* Inlining and unrolling heuristics should be aware of free truncs.Andrew Trick2011-10-012-0/+5
| | | | | | | | | | We want heuristics to be based on accurate data, but more importantly we don't want llvm to behave randomly. A benign trunc inserted by an upstream pass should not cause a wild swings in optimization level. See PR11034. It's a general problem with threshold-based heuristics, but we can make it less bad. llvm-svn: 140919
* whitespaceAndrew Trick2011-10-012-18/+18
| | | | llvm-svn: 140916
* Stop emitting instructions with the name "tmp" they eat up memory and have ↵Benjamin Kramer2011-09-271-2/+1
| | | | | | | | to be uniqued, without any benefit. If someone prefers %tmp42 to %42, run instnamer. llvm-svn: 140634
* Place the check for an exit landing pad where it will be run on both code ↵Bill Wendling2011-09-201-6/+15
| | | | | | paths through the if-then-else. llvm-svn: 140195
* Omit extracting a loop if one of the exits is a landing pad.Bill Wendling2011-09-201-5/+11
| | | | | | | | | The landing pad must accompany the invoke when it's extracted. However, if it does, then the loop isn't properly extracted. I.e., the resulting extraction has a loop in it. The extracted function is then extracted, etc. resulting in an infinite loop. llvm-svn: 140193
* Check the terminator, not the basic block.Bill Wendling2011-09-201-1/+2
| | | | llvm-svn: 140176
* When extracting a basic block that ends in an 'invoke' instruction, we need toBill Wendling2011-09-201-7/+46
| | | | | | | | | | extract its associated landing pad block as well. However, that landing pad block may have more than one predecessor. So split the landing pad block so that individual landing pads have only one predecessor. This type of transformation may produce a false positive with bugpoint. llvm-svn: 140173
* C API functions must be able to see their extern "C" definitions, or it will ↵Benjamin Kramer2011-08-191-0/+1
| | | | | | be impossible to call them from C. llvm-svn: 138022
* Add a mechanism for optimisation plugins to register passes that all front ↵David Chisnall2011-08-161-0/+15
| | | | | | | | ends can use without needing to be aware of the plugin (or the plugin be aware of the front end). Before 3.0, I'd like to add a mechanism for automatically loading a set of plugins from a config file. API suggestions welcome... llvm-svn: 137717
* Revert a bit of r137667; the logic in question can safely handle atomic ↵Eli Friedman2011-08-161-4/+4
| | | | | | load/store. llvm-svn: 137702
* Minor comment fixes.Eli Friedman2011-08-161-4/+6
| | | | llvm-svn: 137693
* Update inter-procedural optimizations for atomic load/store.Eli Friedman2011-08-154-10/+16
| | | | llvm-svn: 137667
* Mark the SCC as "might unwind" if we run into a 'resume' instruction.Bill Wendling2011-08-151-2/+3
| | | | llvm-svn: 137627
* switch to use the new api for structtypes.Chris Lattner2011-08-121-1/+1
| | | | llvm-svn: 137480
* Add a C interface to PassManagerBuilder. It is missing the addExtensionRafael Espindola2011-08-091-0/+80
| | | | | | | functionality since in the C api a pass is created and added to a pass manager in a single call. llvm-svn: 137159
* Remove the LowerSetJmp pass. It wasn't used effectively by any of the targets.Bill Wendling2011-08-033-553/+0
| | | | | | This is some of my original LLVM code. *wipes tear* llvm-svn: 136821
* Move methods in PassManagerBuilder offline.Rafael Espindola2011-08-022-0/+249
| | | | llvm-svn: 136727
* Add the 'resume' instruction for the new EH rewrite.Bill Wendling2011-07-311-1/+1
| | | | | | | | | This adds the 'resume' instruction class, IR parsing, and bitcode reading and writing. The 'resume' instruction resumes propagation of an existing (in-flight) exception whose unwinding was interrupted with a 'landingpad' instruction (to be added later). llvm-svn: 136589
* Revert r136253, r136263, r136269, r136313, r136325, r136326, r136329, r136338,Bill Wendling2011-07-301-1/+1
| | | | | | | r136339, r136341, r136369, r136387, r136392, r136396, r136429, r136430, r136444, r136445, r136446, r136253 pending review. llvm-svn: 136556
* Misc optimizer+codegen work for 'cmpxchg' and 'atomicrmw'. They appear to beEli Friedman2011-07-291-16/+16
| | | | | | | | | working on x86 (at least for trivial testcases); other architectures will need more work so that they actually emit the appropriate instructions for orderings stricter than 'monotonic'. (As far as I can tell, the ARM, PPC, Mips, and Alpha backends need such changes.) llvm-svn: 136457
* Rewrite the CMake build to use explicit dependencies between libraries,Chandler Carruth2011-07-291-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | specified in the same file that the library itself is created. This is more idiomatic for CMake builds, and also allows us to correctly specify dependencies that are missed due to bugs in the GenLibDeps perl script, or change from compiler to compiler. On Linux, this returns CMake to a place where it can relably rebuild several targets of LLVM. I have tried not to change the dependencies from the ones in the current auto-generated file. The only places I've really diverged are in places where I was seeing link failures, and added a dependency. The goal of this patch is not to start changing the dependencies, merely to move them into the correct location, and an explicit form that we can control and change when necessary. This also removes a serialization point in the build because we don't have to scan all the libraries before we begin building various tools. We no longer have a step of the build that regenerates a file inside the source tree. A few other associated cleanups fall out of this. This isn't really finished yet though. After talking to dgregor he urged switching to a single CMake macro to construct libraries with both sources and dependencies in the arguments. Migrating from the two macros to that style will be a follow-up patch. Also, llvm-config is still generated with GenLibDeps.pl, which means it still has slightly buggy dependencies. The internal CMake 'llvm-config-like' macro uses the correct explicitly specified dependencies however. A future patch will switch llvm-config generation (when using CMake) to be based on these deps as well. This may well break Windows. I'm getting a machine set up now to dig into any failures there. If anyone can chime in with problems they see or ideas of how to solve them for Windows, much appreciated. llvm-svn: 136433
* Merge the contents from exception-handling-rewrite to the mainline.Bill Wendling2011-07-271-1/+1
| | | | | | This adds the new instructions 'landingpad' and 'resume'. llvm-svn: 136253
* Teach the ConstantMerge pass about alignment. Fixes PR10514!Nick Lewycky2011-07-271-8/+41
| | | | llvm-svn: 136250
* Add LLVMAddAlwaysInlinerPass to the C API.Rafael Espindola2011-07-261-0/+4
| | | | llvm-svn: 136083
* LLVM 3.0 is here, remove old do nothing method.Rafael Espindola2011-07-261-5/+0
| | | | llvm-svn: 136082
* Convert GetElementPtrInst to use ArrayRef.Jay Foad2011-07-252-10/+6
| | | | llvm-svn: 135904
* Fix more MSVC warnings caused by a cases I missed when convertingJay Foad2011-07-221-1/+1
| | | | | | ConstantExpr::getGetElementPtr to use ArrayRef. llvm-svn: 135762
* Make better use of ConstantExpr::getGetElementPtr's InBounds parameter.Jay Foad2011-07-211-3/+3
| | | | llvm-svn: 135676
* Convert ConstantExpr::getGetElementPtr andJay Foad2011-07-211-6/+4
| | | | | | ConstantExpr::getInBoundsGetElementPtr to use ArrayRef. llvm-svn: 135673
* move tier out of an anonymous namespace, it doesn't make senseChris Lattner2011-07-211-5/+3
| | | | | | | | to for it to be an an anon namespace and be in a header. Eliminate some extraenous uses of tie. llvm-svn: 135669
* Convert TargetData::getIndexedOffset to use ArrayRef.Jay Foad2011-07-191-2/+2
| | | | llvm-svn: 135478
* Use ArrayRef in ConstantFoldInstOperands and ConstantFoldCall.Jay Foad2011-07-191-2/+1
| | | | llvm-svn: 135477
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-187-80/+80
| | | | llvm-svn: 135375
* Convert CallInst and InvokeInst APIs to use ArrayRef.Jay Foad2011-07-155-12/+11
| | | | llvm-svn: 135265
* Second attempt at de-constifying LLVM Types in FunctionType::get(),Jay Foad2011-07-122-5/+5
| | | | | | StructType::get() and TargetData::getIntPtrType(). llvm-svn: 134982
* Revert r134893 and r134888 (and related patches in other trees). It was causingBill Wendling2011-07-122-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | an assert on Darwin llvm-gcc builds. Assertion failed: (castIsValid(op, S, Ty) && "Invalid cast!"), function Create, file /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.llvm-gcc-i386-darwin9-RA/llvm.src/lib/VMCore/Instructions.cpp, li\ ne 2067. etc. http://smooshlab.apple.com:8013/builders/llvm-gcc-i386-darwin9-RA/builds/2354 --- Reverse-merging r134893 into '.': U include/llvm/Target/TargetData.h U include/llvm/DerivedTypes.h U tools/bugpoint/ExtractFunction.cpp U unittests/Support/TypeBuilderTest.cpp U lib/Target/ARM/ARMGlobalMerge.cpp U lib/Target/TargetData.cpp U lib/VMCore/Constants.cpp U lib/VMCore/Type.cpp U lib/VMCore/Core.cpp U lib/Transforms/Utils/CodeExtractor.cpp U lib/Transforms/Instrumentation/ProfilingUtils.cpp U lib/Transforms/IPO/DeadArgumentElimination.cpp U lib/CodeGen/SjLjEHPrepare.cpp --- Reverse-merging r134888 into '.': G include/llvm/DerivedTypes.h U include/llvm/Support/TypeBuilder.h U include/llvm/Intrinsics.h U unittests/Analysis/ScalarEvolutionTest.cpp U unittests/ExecutionEngine/JIT/JITTest.cpp U unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp U unittests/VMCore/PassManagerTest.cpp G unittests/Support/TypeBuilderTest.cpp U lib/Target/MBlaze/MBlazeIntrinsicInfo.cpp U lib/Target/Blackfin/BlackfinIntrinsicInfo.cpp U lib/VMCore/IRBuilder.cpp G lib/VMCore/Type.cpp U lib/VMCore/Function.cpp G lib/VMCore/Core.cpp U lib/VMCore/Module.cpp U lib/AsmParser/LLParser.cpp U lib/Transforms/Utils/CloneFunction.cpp G lib/Transforms/Utils/CodeExtractor.cpp U lib/Transforms/Utils/InlineFunction.cpp U lib/Transforms/Instrumentation/GCOVProfiling.cpp U lib/Transforms/Scalar/ObjCARC.cpp U lib/Transforms/Scalar/SimplifyLibCalls.cpp U lib/Transforms/Scalar/MemCpyOptimizer.cpp G lib/Transforms/IPO/DeadArgumentElimination.cpp U lib/Transforms/IPO/ArgumentPromotion.cpp U lib/Transforms/InstCombine/InstCombineCompares.cpp U lib/Transforms/InstCombine/InstCombineAndOrXor.cpp U lib/Transforms/InstCombine/InstCombineCalls.cpp U lib/CodeGen/DwarfEHPrepare.cpp U lib/CodeGen/IntrinsicLowering.cpp U lib/Bitcode/Reader/BitcodeReader.cpp llvm-svn: 134949
* De-constify Types in StructType::get() and TargetData::getIntPtrType().Jay Foad2011-07-111-2/+2
| | | | llvm-svn: 134893
* De-constify Types in FunctionType::get().Jay Foad2011-07-112-3/+3
| | | | llvm-svn: 134888
* remove the DerivedType which isn't adding value anymore.Chris Lattner2011-07-091-2/+1
| | | | llvm-svn: 134832
* Land the long talked about "type system rewrite" patch. ThisChris Lattner2011-07-095-128/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | patch brings numerous advantages to LLVM. One way to look at it is through diffstat: 109 files changed, 3005 insertions(+), 5906 deletions(-) Removing almost 3K lines of code is a good thing. Other advantages include: 1. Value::getType() is a simple load that can be CSE'd, not a mutating union-find operation. 2. Types a uniqued and never move once created, defining away PATypeHolder. 3. Structs can be "named" now, and their name is part of the identity that uniques them. This means that the compiler doesn't merge them structurally which makes the IR much less confusing. 4. Now that there is no way to get a cycle in a type graph without a named struct type, "upreferences" go away. 5. Type refinement is completely gone, which should make LTO much MUCH faster in some common cases with C++ code. 6. Types are now generally immutable, so we can use "Type *" instead "const Type *" everywhere. Downsides of this patch are that it removes some functions from the C API, so people using those will have to upgrade to (not yet added) new API. "LLVM 3.0" is the right time to do this. There are still some cleanups pending after this, this patch is large enough as-is. llvm-svn: 134829
* Revamp the "ConstantStruct::get" methods. Previously, these were scatteredChris Lattner2011-06-201-39/+39
| | | | | | | | | | | | | | | all over the place in different styles and variants. Standardize on two preferred entrypoints: one that takes a StructType and ArrayRef, and one that takes StructType and varargs. In cases where there isn't a struct type convenient, we now add a ConstantStruct::getAnon method (whose name will make more sense after a few more patches land). It would be "really really nice" if the ConstantStruct::get and ConstantVector::get methods didn't make temporary std::vectors. llvm-svn: 133412
* When deleting a basic block, remove call edges only for non-intrinsics.John McCall2011-06-091-1/+1
| | | | llvm-svn: 132803
* Improve the handling of available_externally and llvm.global_ctors.Rafael Espindola2011-06-091-4/+16
| | | | llvm-svn: 132775
* Don't crash owhen ComputeLoadResult can't compute the result of the load.Nick Lewycky2011-05-291-1/+1
| | | | llvm-svn: 132290
* Obey the isVolatile bit on memory intrinsics when analyzing uses of a globalNick Lewycky2011-05-291-5/+19
| | | | | | | | | variable. Noticed by inspection. Simulate memset in EvaluateFunction where the target of the memset and the value we're setting are both the null value. Fixes PR10047! llvm-svn: 132288
* fix PR9856, an incorrectly conservative assertion: a global can beChris Lattner2011-05-221-3/+3
| | | | | | "stored once" even if its address is compared. llvm-svn: 131849
* Fix a source of non determinism in FindUsedTypes, use a SetVector instead of aJulien Lerouge2011-05-131-1/+2
| | | | | | | | set. rdar://9423996 llvm-svn: 131283
* Preserve line number information.Devang Patel2011-05-101-0/+1
| | | | llvm-svn: 131112
* Remove unused STL header includes.Jay Foad2011-04-232-2/+0
| | | | llvm-svn: 130068
OpenPOWER on IntegriCloud