summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Constants.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* Change the PointerType api for creating pointer types. The old functionality ↵Christopher Lamb2007-12-171-1/+1
| | | | | | of PointerType::get() has become PointerType::getUnqual(), which returns a pointer in the generic address space. The new prototype of PointerType::get() requires both a type and an address space. llvm-svn: 45082
* Implement address space attribute for LLVM pointer types. Address spaces are Christopher Lamb2007-12-111-1/+2
| | | | | | | | | | | | | | | | | regions of memory that have a target specific relationship, as described in the Embedded C Technical Report. This also implements the 2007-12-11-AddressSpaces test, which demonstrates how address space attributes can be used in LLVM IR. In addition, this patch changes the bitcode signature for stores (in a backwards compatible manner), such that the pointer type, rather than the pointee type, is encoded. This permits type information in the pointer (e.g. address space) to be preserved for stores. LangRef updates are forthcoming. llvm-svn: 44858
* Reverting dtor devirtualization patch.Gordon Henriksen2007-12-101-59/+114
| | | | | | | _sabre_: it has a major problem: by the time ~Value is run, all of the "parts" of the derived classes have been destroyed _sabre_: the vtable lives to fight another day llvm-svn: 44760
* Devirtualizing Value destructor (PR889). Patch by Pawel Kunio!Gordon Henriksen2007-12-091-114/+59
| | | | llvm-svn: 44747
* Add support for vectors to int <-> float casts.Nate Begeman2007-11-171-7/+19
| | | | llvm-svn: 44204
* Fix InstCombine/2007-10-31-StringCrash.ll by removing an obviousChris Lattner2007-11-011-12/+8
| | | | | | (in hindsight) infinite recursion. Simplify the code. llvm-svn: 43597
* this doesn't need dynamic_cast.Chris Lattner2007-10-181-1/+1
| | | | llvm-svn: 43133
* Define a helper function ConstantVector::getSplatValue for testing forDan Gohman2007-10-171-0/+11
| | | | | | and working with broadcasted constants. llvm-svn: 43076
* Next PPC long double bits. First cut at constants.Dale Johannesen2007-10-111-0/+9
| | | | | | | | | No compile-time support for constant operations yet, just format transformations. Make readers and writers work. Split constants into 2 doubles in Legalize. llvm-svn: 42865
* Adding C and Ocaml bindings for ConstantExpr.Gordon Henriksen2007-10-061-2/+2
| | | | llvm-svn: 42696
* Merge DenseMapKeyInfo & DenseMapValueInfo into DenseMapInfoChris Lattner2007-09-171-1/+7
| | | | | | | Add a new DenseMapInfo::isEqual method to allow clients to redefine the equality predicate used when probing the hash table. llvm-svn: 42042
* Remove the assumption that FP's are either float orDale Johannesen2007-09-141-10/+15
| | | | | | | | | | | | | double from some of the many places in the optimizers it appears, and do something reasonable with x86 long double. Make APInt::dump() public, remove newline, use it to dump ConstantSDNode's. Allow APFloats in FoldingSet. Expand X86 backend handling of long doubles (conversions to/from int, mostly). llvm-svn: 41967
* Revise previous patch per review comments.Dale Johannesen2007-09-121-5/+20
| | | | | | | Next round of x87 long double stuff. Getting close now, basically works. llvm-svn: 41875
* Next round of APFloat changes.Dale Johannesen2007-09-061-29/+8
| | | | | | | | | | | | | | Use APFloat in UpgradeParser and AsmParser. Change all references to ConstantFP to use the APFloat interface rather than double. Remove the ConstantFP double interfaces. Use APFloat functions for constant folding arithmetic and comparisons. (There are still way too many places APFloat is just a wrapper around host float/double, but we're getting there.) llvm-svn: 41747
* Update GEP constructors to use an iterator interface to fixDavid Greene2007-09-041-2/+2
| | | | | | GLIBCXX_DEBUG issues. llvm-svn: 41697
* Change LegalFPImmediates to use APFloat.Dale Johannesen2007-08-301-7/+38
| | | | | | | | | Add APFloat interfaces to ConstantFP, SelectionDAG. Fix integer bit in double->APFloat conversion. Convert LegalizeDAG to use APFloat interface in ConstantFPSDNode uses. llvm-svn: 41587
* 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. llvm-svn: 41378
* Revised per review feedback from previous patch.Dale Johannesen2007-08-241-20/+9
| | | | llvm-svn: 41353
* Change internal representation of ConstantFP to use APFloat.Dale Johannesen2007-08-241-33/+33
| | | | | | Interface to rest of the compiler unchanged, as yet. llvm-svn: 41348
* 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. llvm-svn: 41209
* 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. llvm-svn: 40974
* add a Constant::getAllOnesValue helper function, which works on integersChris Lattner2007-06-151-0/+5
| | | | | | AND vectors. llvm-svn: 37586
* Minor comment cleanups.Dan Gohman2007-05-241-5/+5
| | | | llvm-svn: 37321
* Allow ConstantInt::get(Ty, uint64_t) to interpret the 64-bit values as aReid Spencer2007-03-191-2/+2
| | | | | | negative number. This is needed to fix test/Assembler/2007-03-19-NegValue.ll llvm-svn: 35181
* Added ContainsRelocations() to check if a constant might only be resolvable ↵Evan Cheng2007-03-081-0/+11
| | | | | | at load time. llvm-svn: 35014
* Drop the ConstantInt(const Type&, const APInt&) constructor. It isReid Spencer2007-03-011-14/+9
| | | | | | redundant and more verbose than the ConstantInt(const APInt&) constructor. llvm-svn: 34792
* Implement a convenience method to construct a ConstantInt directly from anReid Spencer2007-02-281-0/+4
| | | | | | | APInt. The implied type is the integer type that corresponds to the bit width of the APInt. llvm-svn: 34757
* Remove some redundancy.Reid Spencer2007-02-271-4/+1
| | | | llvm-svn: 34702
* Correct the implelmentation of ConstantInt::getAllOnesValue() for bitReid Spencer2007-02-271-1/+1
| | | | | | widths > 64 bits. llvm-svn: 34663
* ConstantFolding.cpp/h -> ConstantFold.cpp/h to avoid confusion withChris Lattner2007-02-271-1/+1
| | | | | | lib/Analysis/ConstantFolding. llvm-svn: 34653
* For PR1205:Reid Spencer2007-02-261-16/+49
| | | | | | | | | | Implement the first step towards arbitrary precision integer support in LLVM. The APInt class provides arbitrary precision arithmetic and value representation. This patch changes ConstantInt to use APInt as its value representation without supporting bit widths > 64 yet. That change will come after ConstantFolding handles bit widths > 64 bits. llvm-svn: 34647
* This cast broke lots of tests.Evan Cheng2007-02-201-1/+1
| | | | llvm-svn: 34457
* switch ConstantFP's from ValueMap to DenseMap, which is much faster to queryChris Lattner2007-02-201-51/+59
| | | | | | and is more memory efficient. llvm-svn: 34446
* cleanup ConstantInt to use a single DenseMap for uniquing instead of theChris Lattner2007-02-201-50/+63
| | | | | | | heavy-weight ValueMap class. This reduces mem usage bc reading kc++ by 29K, even though it only creates 2955 constant ints! llvm-svn: 34445
* Make ConstantInt::getTrue/getFalse be llvm_shutdown safe.Chris Lattner2007-02-201-5/+24
| | | | llvm-svn: 34443
* Clean up the internals of the ConstantInt machineryChris Lattner2007-02-201-9/+6
| | | | llvm-svn: 34441
* simplify some code that was not llvm_shutdown safeChris Lattner2007-02-201-36/+5
| | | | llvm-svn: 34440
* llvm-gcc issue fixed, revert reversal :)Chris Lattner2007-02-191-20/+15
| | | | llvm-svn: 34425
* Temporarily reverting the patch. It's breaking llvm-gcc build.Evan Cheng2007-02-191-15/+20
| | | | llvm-svn: 34423
* remove dead methodsChris Lattner2007-02-191-20/+15
| | | | llvm-svn: 34419
* For PR1195:Reid Spencer2007-02-151-6/+6
| | | | | | | Change use of "packed" term to "vector" in comments, strings, variable names, etc. llvm-svn: 34300
* For PR1195:Reid Spencer2007-02-151-39/+39
| | | | | | | Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and PackedTyID -> VectorTyID. No functional changes. llvm-svn: 34293
* A value of 64 or fewer bits is valid if the ConstantInt has more then 64 bits.Reid Spencer2007-02-051-4/+2
| | | | llvm-svn: 33942
* For PR411:Reid Spencer2007-02-051-1/+1
| | | | | | | | | | This patch replaces the SymbolTable class with ValueSymbolTable which does not support types planes. This means that all symbol names in LLVM must now be unique. The patch addresses the necessary changes to deal with this and removes code no longer needed as a result. This completes the bulk of the changes for this PR. Some cleanup patches will follow. llvm-svn: 33918
* Changes to support making the shift instructions be true BinaryOperators.Reid Spencer2007-02-021-35/+2
| | | | | | | | | | | | This feature is needed in order to support shifts of more than 255 bits on large integer types. This changes the syntax for llvm assembly to make shl, ashr and lshr instructions look like a binary operator: shl i32 %X, 1 instead of shl i32 %X, i8 1 Additionally, this should help a few passes perform additional optimizations. llvm-svn: 33776
* Revise APIs for creating constantexpr GEPs to not require the use of vectors.Chris Lattner2007-01-311-22/+19
| | | | | | This allows us to eliminate many temporary vectors, and theirassociated malloc/free pairs. llvm-svn: 33692
* Clean up comments and assert messages that still refer to the old type names.Reid Spencer2007-01-261-12/+12
| | | | llvm-svn: 33520
* Whoops, fix typo in last commit.Reid Spencer2007-01-211-6/+6
| | | | llvm-svn: 33417
* For PR970:Reid Spencer2007-01-211-4/+17
| | | | | | | Clean up handling of isFloatingPoint() and dealing with PackedType. Patch by Gordon Henriksen! llvm-svn: 33415
OpenPOWER on IntegriCloud