aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore
Commit message (Collapse)AuthorAgeFilesLines
* Update InvokeInst to work like CallInstDavid Greene2007-08-271-22/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41506 91177308-0d34-0410-b5e6-96231b3b80d8
* Poison APFloat::operator==. Replace existing uses with bitwiseIsEqual.Dale Johannesen2007-08-241-10/+21
| | | | | | | | This means backing out the preceding change to Constants.cpp, alas. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41378 91177308-0d34-0410-b5e6-96231b3b80d8
* sink clone() down the class hierarchy from CmpInst into ICmpInst/FCmpInst.Chris Lattner2007-08-241-2/+5
| | | | | | | | This eliminates a conditional on that path, and ensures ICmpInst/FCmpInst both have an out-of-line virtual method to home the class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41371 91177308-0d34-0410-b5e6-96231b3b80d8
* Revised per review feedback from previous patch.Dale Johannesen2007-08-241-20/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41353 91177308-0d34-0410-b5e6-96231b3b80d8
* Change internal representation of ConstantFP to use APFloat.Dale Johannesen2007-08-241-33/+33
| | | | | | | | Interface to rest of the compiler unchanged, as yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41348 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix potentially N^2 behavior handling arrays with many of theChris Lattner2007-08-211-8/+35
| | | | | | | | same value which get RAUW'd. This speeds up reading the .bc file in PR1616 from 852s to 0.19s on my G5 with a debug build. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41209 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify code, improve a comment.Chris Lattner2007-08-211-6/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41205 91177308-0d34-0410-b5e6-96231b3b80d8
* Add Type::isIntOrIntVector, like Type::isFPOrFPVector.Dan Gohman2007-08-201-0/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41190 91177308-0d34-0410-b5e6-96231b3b80d8
* When Intrinsic::getName is constructing names for overloaded intrinsics,Dan Gohman2007-08-201-1/+2
| | | | | | | | | use the ValueType name instead of the llvm type name, to match what the verifier expects. For integers these are the same, but for floating-point values the intrinsics use f32/f64 instead of float/double. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41189 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify code and print visibility for declarations.Chris Lattner2007-08-191-25/+21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41173 91177308-0d34-0410-b5e6-96231b3b80d8
* Compute the argument list as lazily as possible. This ensures that clientsChris Lattner2007-08-181-7/+24
| | | | | | | | | that don't use it don't have to pay the memory cost for the arguments. This allows us to avoid creating Argument nodes for many prototypes and for clients who lazily deserialize code from a bytecode file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41166 91177308-0d34-0410-b5e6-96231b3b80d8
* use a nicer accessor.Chris Lattner2007-08-181-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41165 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the verification for overloaded intrinsic types. Check that they areDan Gohman2007-08-161-6/+19
| | | | | | | what they're supposed to be before using them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41130 91177308-0d34-0410-b5e6-96231b3b80d8
* Add MVT::fAny for overloading intrinsics on floating-point types.Dan Gohman2007-08-161-0/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41128 91177308-0d34-0410-b5e6-96231b3b80d8
* Assert sooner. Fix wordings.Devang Patel2007-08-141-3/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41075 91177308-0d34-0410-b5e6-96231b3b80d8
* Add methods to erase basic block entry.Devang Patel2007-08-131-0/+24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41052 91177308-0d34-0410-b5e6-96231b3b80d8
* Constant fold: getelementptr (i8* inttoptr (i64 1 to i8*), i32 -1)Chris Lattner2007-08-131-1/+23
| | | | | | | | | | | | | | | | | | | | | | Into: inttoptr (i64 0 to i8*) -> null This occurs in the example in PR1602. With this fixed, we now compile the example in PR1602 into fully "devirtualized" code: define void @_Z1g1S(%struct.S* noalias %s) { entry: %tmp131415 = getelementptr %struct.S* %s, i32 0, i32 0 ; <i32 (...)***> [#uses=1] %tmp16 = load i32 (...)*** %tmp131415, align 4 ; <i32 (...)**> [#uses=1] %tmp26277 = load i32 (...)** %tmp16 ; <i32 (...)*> [#uses=1] %tmp2829 = bitcast i32 (...)* %tmp26277 to void (%struct.S*)* ; <void (%struct.S*)*> [#uses=1] tail call void %tmp2829( %struct.S* %s ) ret void } This still has the vtable dispatch (as required) but does not have any pointer to method cruft left. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41046 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not overuse std::string. Pass around char * directly.Devang Patel2007-08-101-11/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41001 91177308-0d34-0410-b5e6-96231b3b80d8
* add Value::getNameStart/getNameLen() accessors.Chris Lattner2007-08-101-0/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40989 91177308-0d34-0410-b5e6-96231b3b80d8
* minor simplifications.Chris Lattner2007-08-101-10/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40981 91177308-0d34-0410-b5e6-96231b3b80d8
* avoid copying strings.Chris Lattner2007-08-101-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40980 91177308-0d34-0410-b5e6-96231b3b80d8
* Patch 10 for long double. Doing constants right needs expanding ConstantFPDale Johannesen2007-08-091-4/+15
| | | | | | | | | | | | | | to handle values bigger than double. If we assume host==target and host long double works correctly, this is not too bad, but we don't want to have that limitation longterm. I could implement accepting double constants as long double or something like that, which would lead to incorrect codegen with no errors; the more I think about that the worse it seems. Rather than do such a hack that would be backed out later, I'm settling for giving reasonable error messages, for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40974 91177308-0d34-0410-b5e6-96231b3b80d8
* Speed up updateDFSNumbers with two observations:Chris Lattner2007-08-081-22/+17
| | | | | | | | | | | | | 1. domtree is a tree, not a graph. There is no need to avoid revisiting nodes with a set. 2. the worklist can contain the child iterator pointers so we don't get N^2 rescanning of children. This speeds up updateDFSNumbers significantly, making it basically free. On the testcase in PR1432, this speeds up loopsimplify by another 3x, dropping it from the 12th most expensive pass to the to the 30th. :) It used to be #1. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40923 91177308-0d34-0410-b5e6-96231b3b80d8
* reimplement dfs number computation to be significantly faster. This speeds upChris Lattner2007-08-081-40/+33
| | | | | | | | natural loop canonicalization (which does many cfg xforms) by 4.3x, for example. This also fixes a bug in postdom dfnumber computation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40920 91177308-0d34-0410-b5e6-96231b3b80d8
* 1. Random tidiness cleanupsChris Lattner2007-08-061-47/+44
| | | | | | | | | | | | | | 2. Make domtree printing print dfin/dfout #'s 3. Fix the Transforms/LoopSimplify/2004-04-13-LoopSimplifyUpdateDomFrontier.ll failure from last night (in DominanceFrontier::splitBlock). w.r.t. #3, my patches last night happened to expose the bug, but this has been broken since Owen's r35839 patch to LoopSimplify. The code was subsequently moved over from LoopSimplify into Dominators, carrying the latent bug. Fun stuff. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40858 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix minor doxygen nits.Reid Spencer2007-08-051-0/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40854 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a doxygen directive.Reid Spencer2007-08-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40849 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an iterator invalidation bug I induced.Chris Lattner2007-08-051-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40830 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch some std::sets to SmallPtrSet. This speeds upChris Lattner2007-08-051-3/+3
| | | | | | | domtree by 10% and postdomtree by 17% git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40829 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch DomTreeNode::assignDFSNumber from using a std::set to usingChris Lattner2007-08-051-8/+8
| | | | | | | a smallptrset. This speeds up domtree by about 15% and postdomtree by 20%. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40828 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch the internal "Info" map from an std::map to a DenseMap. ThisChris Lattner2007-08-051-7/+5
| | | | | | | | | | speeds up idom by about 45% and postidom by about 33%. Some extra precautions must be taken not to invalidate densemap iterators. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40827 91177308-0d34-0410-b5e6-96231b3b80d8
* switch the DomTreeNodes and IDoms maps in idom/postidom to a Chris Lattner2007-08-041-16/+13
| | | | | | | | | | DenseMap instead of an std::map. This speeds up postdomtree by about 25% and domtree by about 23%. It also speeds up clients, for example, domfrontier by 11%, mem2reg by 4% and ADCE by 6%. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40826 91177308-0d34-0410-b5e6-96231b3b80d8
* This is the patch to provide clean intrinsic function overloading support in ↵Chandler Carruth2007-08-042-66/+264
| | | | | | | | | LLVM. It cleans up the intrinsic definitions and generally smooths the process for more complicated intrinsic writing. It will be used by the upcoming atomic intrinsics as well as vector and float intrinsics in the future. This also changes the syntax for llvm.bswap, llvm.part.set, llvm.part.select, and llvm.ct* intrinsics. They are automatically upgraded by both the LLVM ASM reader and the bitcode reader. The test cases have been updated, with special tests added to ensure the automatic upgrading is supported. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40807 91177308-0d34-0410-b5e6-96231b3b80d8
* long double patch 3 of N. Add to MVT.Dale Johannesen2007-08-031-50/+57
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40793 91177308-0d34-0410-b5e6-96231b3b80d8
* Long double, part 1 of N. Support in IR.Dale Johannesen2007-08-031-9/+26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40774 91177308-0d34-0410-b5e6-96231b3b80d8
* Update dominator info for the middle blocks created while splitingDevang Patel2007-08-021-1/+9
| | | | | | | | | | exit edge to preserve LCSSA. Fix dominance frontier update during loop unswitch. This fixes PR 1589, again git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40737 91177308-0d34-0410-b5e6-96231b3b80d8
* Undo previous check-in.Devang Patel2007-08-011-9/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40698 91177308-0d34-0410-b5e6-96231b3b80d8
* Update dominator info for the middle blocks created while splitingDevang Patel2007-08-011-1/+9
| | | | | | | | | | exit edge to preserve LCSSA. Fix dominance frontier update during loop unswitch. This fixes PR 1589. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40695 91177308-0d34-0410-b5e6-96231b3b80d8
* New CallInst interface to address GLIBCXX_DEBUG errors caused byDavid Greene2007-08-011-6/+7
| | | | | | | | | indexing an empty std::vector. Updates to all clients. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40660 91177308-0d34-0410-b5e6-96231b3b80d8
* After a discussion with Anton, it turns out that the InReg attribute is notReid Spencer2007-07-311-1/+2
| | | | | | | permitted on function results. So, revert the last patch to make it illegal. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40632 91177308-0d34-0410-b5e6-96231b3b80d8
* The InReg parameter attribute is valid on function results. The llvm-gcc-4.0Reid Spencer2007-07-311-2/+1
| | | | | | | | front end converts regparm attribute on the gcc function into InReg attribute on the llvm function. This fixes test/CFrontend/2002-07-30-SubrefSetAssertion.c git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40618 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix pastos in comments for doFinalization functions.Dan Gohman2007-07-301-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40588 91177308-0d34-0410-b5e6-96231b3b80d8
* Add facility to dump pass manager structure Devang Patel2007-07-271-0/+12
| | | | | | | to make it easier to understand failure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40567 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix edge cases in handling basic block split.Devang Patel2007-07-271-3/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40564 91177308-0d34-0410-b5e6-96231b3b80d8
* It seems logical that InReg should be incompatibleDuncan Sands2007-07-271-3/+2
| | | | | | | with StructReturn and ByVal, so make it so. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40554 91177308-0d34-0410-b5e6-96231b3b80d8
* As the number of parameter attributes increases,Duncan Sands2007-07-271-39/+55
| | | | | | | | | | | | | | | | | | | | | Verifier::visitFunction is suffering a combinatorial explosion due to the number of mutually incompatible attributes. This patch tidies the whole thing up using attribute masks. While there I fixed some small bugs: (1) the ByVal attribute tests cast a type to a pointer type, which can fail. Yes, the fact it is of a pointer type is checked before, but a failing check does not cause the program to exit, it continues on outputting further errors; (2) Nothing was checking that an sret attribute is on the first parameter; (3) nothing was checking that a function for which isStructReturn() is true has a parameter with the sret attribute and vice-versa (I don't think it is possible for this to go wrong, but it seems right to check it). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40553 91177308-0d34-0410-b5e6-96231b3b80d8
* Support for trampolines, except for X86 codegen which isDuncan Sands2007-07-272-0/+19
| | | | | | | still under discussion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40549 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the GET_SIDE_EFFECT_INFO logic from isInstructionTriviallyDeadDan Gohman2007-07-261-4/+12
| | | | | | | | to Instruction::mayWriteToMemory, fixing a FIXME, and helping various places that call mayWriteToMemory directly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40533 91177308-0d34-0410-b5e6-96231b3b80d8
* DummyInst's member functions don't need to be virtual.Dan Gohman2007-07-261-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40530 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for 3 element 32-bit vector ValueTypes.Christopher Lamb2007-07-261-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40506 91177308-0d34-0410-b5e6-96231b3b80d8