summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore
Commit message (Collapse)AuthorAgeFilesLines
* Teach the constant folder about union types.Dan Gohman2010-02-251-0/+34
| | | | llvm-svn: 97142
* Remove code which assumes it knows how vectors are stored in memory.Dan Gohman2010-02-251-12/+2
| | | | llvm-svn: 97141
* Dump the presence of attached metadata even if we don't know what it is. ThisNick Lewycky2010-02-251-6/+10
| | | | | | | | format is not parsable, even if the module is legal. To get parsable output, dump the module instead of the function or smaller, since metadata kind are attached to the module (not the context). llvm-svn: 97124
* Canonicalize ConstantInts to the right operand of commutativeDan Gohman2010-02-221-0/+4
| | | | | | | | | | operators. The test difference is just due to the multiplication operands being commuted (and thus requiring a more elaborate match). In optimized code, that expression would be folded. llvm-svn: 96816
* Use Instruction::isCommutative instead of duplicating it.Dan Gohman2010-02-221-24/+1
| | | | llvm-svn: 96807
* replaceUsesOfWithOnConstant implementation for unions.Talin2010-02-181-1/+46
| | | | llvm-svn: 96616
* Destroy MDNodes gracefully while deleting llvm context.Devang Patel2010-02-182-1/+18
| | | | llvm-svn: 96609
* Function attributes have index ~0, not 0Kenneth Uildriks2010-02-161-2/+2
| | | | llvm-svn: 96370
* Introduce isOpaqueTy and use it rather than isa<OpaqueType>. Also, move someDuncan Sands2010-02-165-10/+10
| | | | | | methods to try to have the type predicates be more logically positioned. llvm-svn: 96349
* There are two ways of checking for a given type, for example isa<PointerType>(T)Duncan Sands2010-02-1611-103/+103
| | | | | | | and T->isPointerTy(). Convert most instances of the first form to the second form. Requested by Chris. llvm-svn: 96344
* Teach the verifier to check the condition on a branch and ensure that it hasNick Lewycky2010-02-151-0/+9
| | | | | | 'i1' type. llvm-svn: 96282
* Fix crash in VerifyType when checking Contexts. Because there may not be aNick Lewycky2010-02-151-8/+14
| | | | | | | Module (we were called with verifyFunction and an unowned Function) we can't rely on Mod->getContext(). llvm-svn: 96275
* Don't try to materialize a function that isn't materializable anyways. ThisNick Lewycky2010-02-151-3/+5
| | | | | | fixes a crash using FPM on a Function that isn't owned by a Module. llvm-svn: 96273
* A function with no Module owner isn't materializable. This fixes F->dump() forNick Lewycky2010-02-151-2/+2
| | | | | | functions not embedded within modules. llvm-svn: 96272
* Uniformize the names of type predicates: rather than having isFloatTy andDuncan Sands2010-02-158-166/+168
| | | | | | isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris! llvm-svn: 96223
* Make PassRegistrar thread-safe since it can be modified by code running inJeffrey Yasskin2010-02-131-0/+9
| | | | | | separate LLVMContexts. llvm-svn: 96051
* Add support for a union type in LLVM IR. Patch by Talin!Chris Lattner2010-02-128-7/+258
| | | | llvm-svn: 96011
* Add a new function attribute, 'alignstack'. It will indicate (when the backendsCharles Davis2010-02-121-0/+5
| | | | | | | implement support for it) that the stack should be forcibly realigned in the prologue (and the process reversed in the epilogue). llvm-svn: 95945
* revert 95903.Devang Patel2010-02-111-4/+1
| | | | llvm-svn: 95918
* Destroy MDNodes while destructing llvm context.Devang Patel2010-02-111-1/+4
| | | | llvm-svn: 95903
* Fix some of the memcheck errors found in the JIT unittests.Jeffrey Yasskin2010-02-112-26/+12
| | | | llvm-svn: 95856
* Minor whitespace cleanups.Dan Gohman2010-02-101-3/+1
| | | | llvm-svn: 95801
* Add a hook to AssemblyAnnotationWriter to allow custom info commentsDan Gohman2010-02-101-0/+5
| | | | | | to be printed, in place of the familiar "uses=" comments. llvm-svn: 95798
* Fix several comments which had previously been "the the" where aDan Gohman2010-02-101-1/+1
| | | | | | different word was intended. llvm-svn: 95795
* Fix "the the" and similar typos.Dan Gohman2010-02-101-1/+1
| | | | llvm-svn: 95781
* Canonicalize sizeof and alignof on pointer types to a canonicalDan Gohman2010-02-101-0/+19
| | | | | | pointer type. llvm-svn: 95769
* IntegerValType holds a uint32_t, so its constructor should take a uint32_t. ↵Kenneth Uildriks2010-02-101-1/+1
| | | | | | This allows it to be properly initialized with bit widths > 65535 llvm-svn: 95731
* Make the destructor for TypeMapBase protected. Spotted by Duncan Sands withNick Lewycky2010-02-071-2/+1
| | | | | | cppcheck! llvm-svn: 95527
* Reintroduce the InlineHint function attribute.Jakob Stoklund Olesen2010-02-061-0/+2
| | | | | | | | | | | | This time it's for real! I am going to hook this up in the frontends as well. The inliner has some experimental heuristics for dealing with the inline hint. When given a -respect-inlinehint option, functions marked with the inline keyword are given a threshold just above the default for -O3. We need some experiments to determine if that is the right thing to do. llvm-svn: 95466
* Adding missing methods for creating Add, Mul, Neg and Sub with NUW.Duncan Sands2010-02-022-2/+30
| | | | llvm-svn: 95086
* Factor out alignof expression folding into a separate function andDan Gohman2010-02-021-26/+69
| | | | | | generalize it to handle more cases. llvm-svn: 95045
* eliminate a bunch of pointless LLVMContext arguments.Chris Lattner2010-02-013-202/+148
| | | | llvm-svn: 95001
* Fix typo "of" -> "or" and change the way a line was formatted to fitDuncan Sands2010-02-011-2/+2
| | | | | | into 80 columns to match my artistic preferences. llvm-svn: 95000
* fix PR6195, a bug constant folding scalar -> vector compares.Chris Lattner2010-02-011-3/+5
| | | | llvm-svn: 94997
* fix PR6197 - infinite recursion in ipsccp due to block addressesChris Lattner2010-02-011-19/+47
| | | | | | evaluateICmpRelation wasn't handling blockaddress. llvm-svn: 94993
* Generalize target-independent folding rules for sizeof to handle moreDan Gohman2010-02-011-24/+169
| | | | | | | | | | | | | | | | | | | cases, and implement target-independent folding rules for alignof and offsetof. Also, reassociate reassociative operators when it leads to more folding. Generalize ScalarEvolution's isOffsetOf to recognize offsetof on arrays. Rename getAllocSizeExpr to getSizeOfExpr, and getFieldOffsetExpr to getOffsetOfExpr, for consistency with analagous ConstantExpr routines. Make the target-dependent folder promote GEP array indices to pointer-sized integers, to make implicit casting explicit and exposed to subsequent folding. And add a bunch of testcases for this new functionality, and a bunch of related existing functionality. llvm-svn: 94987
* Add a getNUWMul function.Dan Gohman2010-02-011-0/+5
| | | | llvm-svn: 94982
* Add a generalized form of ConstantExpr::getOffsetOf which works forDan Gohman2010-02-011-4/+9
| | | | | | | array types as well as struct types, and which accepts arbitrary Constant indicies. llvm-svn: 94981
* Print a comment next to "materializable" global values, to distinguishDan Gohman2010-01-291-0/+9
| | | | | | them from values that are not actually defined in the module. llvm-svn: 94854
* Convert some users of ftostr to raw_ostream.Benjamin Kramer2010-01-291-2/+4
| | | | llvm-svn: 94808
* Remove the folding ruleDan Gohman2010-01-281-22/+0
| | | | | | | | | | | | | | | | | getelementptr (i8* inttoptr (i64 1 to i8*), i32 -1) to inttoptr (i64 0 to i8*) from the VMCore constant folder. It didn't handle sign-extension properly in the case where the source integer is smaller than a pointer size. And, it relied on an assumption about sizeof(i8). The Analysis constant folder still folds these kinds of things; it has access to TargetData, so it can do them right. Add a testcase which tests that the VMCore constant folder doesn't miscompile this, and that the Analysis folder does fold it. llvm-svn: 94750
* Make getAlignOf return an i64, for consistency with getSizeOf andDan Gohman2010-01-281-2/+2
| | | | | | | getOffsetOf, and remove the comment about assuming i8 is byte-aligned, which is no longer applicable. llvm-svn: 94738
* Remove SCEVAllocSizeExpr and SCEVFieldOffsetExpr, and in their placeDan Gohman2010-01-282-4/+33
| | | | | | | | | | | | | | | | use plain SCEVUnknowns with ConstantExpr::getSizeOf and ConstantExpr::getOffsetOf constants. This eliminates a bunch of special-case code. Also add code for pattern-matching these expressions, for clients that want to recognize them. Move ScalarEvolution's logic for expanding array and vector sizeof expressions into an element count times the element size, to expose the multiplication to subsequent folding, into the regular constant folder. llvm-svn: 94737
* Update CMake build.Ted Kremenek2010-01-271-2/+2
| | | | llvm-svn: 94687
* Kill ModuleProvider and ghost linkage by inverting the relationship betweenJeffrey Yasskin2010-01-279-50/+95
| | | | | | | | | | | | | | | | | | | | | Modules and ModuleProviders. Because the "ModuleProvider" simply materializes GlobalValues now, and doesn't provide modules, it's renamed to "GVMaterializer". Code that used to need a ModuleProvider to materialize Functions can now materialize the Functions directly. Functions no longer use a magic linkage to record that they're materializable; they simply ask the GVMaterializer. Because the C ABI must never change, we can't remove LLVMModuleProviderRef or the functions that refer to it. Instead, because Module now exposes the same functionality ModuleProvider used to, we store a Module* in any LLVMModuleProviderRef and translate in the wrapper methods. The bindings to other languages still use the ModuleProvider concept. It would probably be worth some time to update them to follow the C++ more closely, but I don't intend to do it. Fixes http://llvm.org/PR5737 and http://llvm.org/PR5735. llvm-svn: 94686
* fix CastInst::castIsValid to reject aggregate types, fixing PR6153:Chris Lattner2010-01-262-31/+20
| | | | | | | | llvm-as: t.ll:1:25: error: invalid cast opcode for cast from '[4 x i8]' to '[1 x i32]' @x = constant [1 x i32] bitcast ([4 x i8] c"abcd" to [1 x i32]) ^ llvm-svn: 94595
* Fix ICmpInst::makeConstantRange to use ConstantRange's API properlyDan Gohman2010-01-261-2/+30
| | | | | | in the case of empty and full ranges. llvm-svn: 94548
* Add MDNode::getIfExists(), an efficient way to determine if a value is used ↵Victor Hernandez2010-01-261-28/+40
| | | | | | by metadata (since metadata does not appear in a value's use list) llvm-svn: 94492
* Change Value::getUnderlyingObject to have the MaxLookup value specified as aBob Wilson2010-01-251-4/+3
| | | | | | | | | | | | parameter with a default value, instead of just hardcoding it in the implementation. The limit of MaxLookup = 6 was introduced in r69151 to fix a performance problem with O(n^2) behavior in instcombine, but the scalarrepl pass is relying on getUnderlyingObject to go all the way back to an AllocaInst. Making the limit part of the method signature makes it clear that by default the result is limited and should help avoid similar problems in the future. This fixes pr6126. llvm-svn: 94433
* mark some libraries that currently require RTTI.Chris Lattner2010-01-241-1/+1
| | | | llvm-svn: 94377
OpenPOWER on IntegriCloud