summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Constants.cpp
Commit message (Collapse)AuthorAgeFilesLines
* remove the old and dangerous uncheckedReplaceAllUsesWith method,Chris Lattner2011-07-151-9/+5
| | | | | | | which was just replaceAllUsesWith without some assertions. It was needed back when type refinement was alive. llvm-svn: 135253
* devirtualize Constant::isNullValue:Chris Lattner2011-07-151-5/+14
| | | | | | 4 files changed, 15 insertions(+), 60 deletions(-) llvm-svn: 135252
* add CFP::isNegative() and ConstnatInt::isNegative() methods.Chris Lattner2011-07-151-0/+9
| | | | | | Devirtualize the isNegativeZeroValue method. llvm-svn: 135249
* Convert InsertValueInst and ExtractValueInst APIs to use ArrayRef.Jay Foad2011-07-131-12/+9
| | | | llvm-svn: 135040
* Second attempt at de-constifying LLVM Types in FunctionType::get(),Jay Foad2011-07-121-1/+1
| | | | | | StructType::get() and TargetData::getIntPtrType(). llvm-svn: 134982
* simplify assertions to not be completely redundant.Chris Lattner2011-07-121-15/+2
| | | | llvm-svn: 134968
* Revert r134893 and r134888 (and related patches in other trees). It was causingBill Wendling2011-07-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+1
| | | | llvm-svn: 134893
* Silence -Wunused-variable in release builds.Chandler Carruth2011-07-101-0/+2
| | | | llvm-svn: 134868
* the various ConstantExpr::get*Ty methods existed to work with issues aroundChris Lattner2011-07-091-145/+90
| | | | | | type refinement. Zap them now that type refinement is toast. llvm-svn: 134837
* Land the long talked about "type system rewrite" patch. ThisChris Lattner2011-07-091-29/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* PR10210: New method ConstantArray::getAsCString(). Use it in LTO toJay Foad2011-06-281-8/+23
| | | | | | avoid getting embedded trailing null bytes in std::strings. llvm-svn: 133999
* Replace the existing forms of ConstantArray::get() with a single formJay Foad2011-06-221-9/+1
| | | | | | that takes an ArrayRef. llvm-svn: 133615
* Make ConstantVector::get() always take an ArrayRef, never a std::vector.Jay Foad2011-06-221-9/+3
| | | | llvm-svn: 133614
* Eliminate a temporary std::vector in ConstantStruct::get().Jay Foad2011-06-221-4/+2
| | | | llvm-svn: 133612
* Revamp the "ConstantStruct::get" methods. Previously, these were scatteredChris Lattner2011-06-201-31/+35
| | | | | | | | | | | | | | | 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
* fix the varargs version of StructType::get to not require an LLVMContext, ↵Chris Lattner2011-06-181-2/+2
| | | | | | | | making usage much cleaner. llvm-svn: 133364
* Remove unused STL header includes.Jay Foad2011-04-231-1/+0
| | | | llvm-svn: 130068
* PR9214: Convert ConstantExpr::getIndices() to return an ArrayRef, plusJay Foad2011-04-131-3/+3
| | | | | | related tweaks to ExprMapKeyType. llvm-svn: 129443
* Remove some redundant llvm:: prefixes.Jay Foad2011-04-131-1/+1
| | | | llvm-svn: 129441
* PR9214: Convert ConstantExpr::getWithOperands() to use ArrayRef.Jay Foad2011-04-131-5/+5
| | | | llvm-svn: 129439
* ConstantInt has some getters which return ConstantInt's or ConstantVector's ofNick Lewycky2011-03-061-6/+31
| | | | | | | | the value splatted into every element. Extend this to getTrue and getFalse which by providing new overloads that take Types that are either i1 or <N x i1>. Use it in InstCombine to add vector support to some code, fixing PR8469! llvm-svn: 127116
* Added missing va_end().Talin2011-03-011-0/+1
| | | | llvm-svn: 126759
* Add an END_WITH_NULL accessor for ConstantStruct.Talin2011-02-281-2/+13
| | | | llvm-svn: 126714
* hoist GlobalValue::removeDeadConstantUsers up to being a method on Constant.Chris Lattner2011-02-181-0/+53
| | | | llvm-svn: 125828
* Enhance constant folding of bitcast operations on vectors of floats.Nadav Rotem2011-02-171-1/+7
| | | | | | | Add getAllOnesValue of FP numbers to Constants and APFloat. Add more tests. llvm-svn: 125776
* convert ConstantVector::get to use ArrayRef.Chris Lattner2011-02-151-20/+15
| | | | llvm-svn: 125537
* revert my ConstantVector patch, it seems to have made the llvm-gccChris Lattner2011-02-141-15/+20
| | | | | | builders unhappy. llvm-svn: 125504
* Switch ConstantVector::get to use ArrayRef instead of a pointer+sizeChris Lattner2011-02-141-20/+15
| | | | | | idiom. Change various clients to simplify their code. llvm-svn: 125487
* make ConstantExpr::replaceUsesOfWithOnConstant preserve the inboundsChris Lattner2011-02-111-1/+2
| | | | | | flag. Noticed by Jin Gu Kang! llvm-svn: 125366
* make the constantexpr interfaces for inbounds GEPs follow the same styleChris Lattner2011-02-111-63/+10
| | | | | | as other constantexpr flags, reducing redundancy. llvm-svn: 125365
* switch the constantexpr, target folder, and IRBuilder interfacesChris Lattner2011-02-101-67/+24
| | | | | | | for NSW/NUW binops to follow the pattern of exact binops. This allows someone to use Builder.CreateAdd(x, y, "tmp", MaybeNUW); llvm-svn: 125270
* refactor ConstantExpr interfaces a bit around "exactness".Chris Lattner2011-02-091-29/+12
| | | | llvm-svn: 125190
* fix comment change.Chris Lattner2011-02-071-1/+1
| | | | llvm-svn: 125047
* implement .ll and .bc support for nsw/nuw on shl and exact on lshr/ashr.Chris Lattner2011-02-071-53/+74
| | | | | | Factor some code better. llvm-svn: 125006
* enhance vmcore to know that udiv's can be exact, and add a trivialChris Lattner2011-02-061-1/+6
| | | | | | | | instcombine xform to exercise this. Nothing forms exact udivs yet though. This is progress on PR8862 llvm-svn: 124992
* Have m_One also match constant vectors for which every element is 1.Duncan Sands2011-02-011-1/+1
| | | | llvm-svn: 124655
* Fix indentation.Jay Foad2011-01-271-9/+9
| | | | llvm-svn: 124375
* Remove casts between Value** and Constant**, which won't work if aJay Foad2011-01-141-13/+28
| | | | | | | static_cast from Constant* to Value* has to adjust the "this" pointer. This is groundwork for PR889. llvm-svn: 123435
* Apparently APFloat::getZero doesn't like PPCDoubleDoubles.Benjamin Kramer2010-12-041-1/+1
| | | | llvm-svn: 120909
* Simplify code. No functionality change.Benjamin Kramer2010-12-041-6/+9
| | | | llvm-svn: 120907
* Simplify code. No change in functionality.Benjamin Kramer2010-11-201-10/+6
| | | | llvm-svn: 119908
* remove unions from LLVM IR. They are severely buggy and notChris Lattner2010-08-281-80/+1
| | | | | | being actively maintained, improved, or extended. llvm-svn: 112356
* 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
* Preallocate vector, avoid unnecessary vector growth.Benjamin Kramer2010-08-011-0/+1
| | | | llvm-svn: 109971
* Fix PR7658, a problem where type refinement can triggerChris Lattner2010-07-171-24/+21
| | | | | | | | constant replacement which was botching its handling of types. Use of getType() instead of getRawType() was causing the type map in constant folding to be updated wrong. llvm-svn: 108610
* Remove the API compatibility layer which converted add, sub, and mulDan Gohman2010-05-031-9/+0
| | | | | | | | to fadd, fsub, and fmul, when used with a floating-point type. LLVM has supported the new instructions since 2.6, so it's time to get on board. llvm-svn: 102971
* Simplify this code.Dan Gohman2010-04-121-14/+14
| | | | llvm-svn: 101074
* move some method definitions to files that make sense.Chris Lattner2010-03-301-0/+14
| | | | llvm-svn: 99927
* add support for zero initialized unions, patch by Tim Northover!Chris Lattner2010-03-291-1/+3
| | | | llvm-svn: 99818
OpenPOWER on IntegriCloud