summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Constants.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* For PR1043:Reid Spencer2007-01-191-2/+2
| | | | | | | | | | | | | | This is the final patch for this PR. It implements some minor cleanup in the use of IntegerType, to wit: 1. Type::getIntegerTypeMask -> IntegerType::getBitMask 2. Type::Int*Ty changed to IntegerType* from Type* 3. ConstantInt::getType() returns IntegerType* now, not Type* This also fixes PR1120. Patch by Sheng Zhou. llvm-svn: 33370
* rename Type::isIntegral to Type::isInteger, eliminating the old Type::isInteger.Chris Lattner2007-01-151-24/+24
| | | | | | | | | rename Type::getIntegralTypeMask to Type::getIntegerTypeMask. This makes naming much more consistent. For example, there are now no longer any instances of IntegerType that are not considered isInteger! :) llvm-svn: 33225
* don't discriminate against i1Chris Lattner2007-01-151-9/+9
| | | | llvm-svn: 33213
* Allow isAllOnesValue testing on packed constantsJim Laskey2007-01-121-0/+16
| | | | llvm-svn: 33146
* For PR1064:Reid Spencer2007-01-121-45/+50
| | | | | | | | | | | | | | | | | | | | | | | Implement the arbitrary bit-width integer feature. The feature allows integers of any bitwidth (up to 64) to be defined instead of just 1, 8, 16, 32, and 64 bit integers. This change does several things: 1. Introduces a new Derived Type, IntegerType, to represent the number of bits in an integer. The Type classes SubclassData field is used to store the number of bits. This allows 2^23 bits in an integer type. 2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and 64-bit integers. These are replaced with just IntegerType which is not a primitive any more. 3. Adjust the rest of LLVM to account for this change. Note that while this incremental change lays the foundation for arbitrary bit-width integers, LLVM has not yet been converted to actually deal with them in any significant way. Most optimization passes, for example, will still only deal with the byte-width integer types. Future increments will rectify this situation. llvm-svn: 33113
* Implement review feedback for the ConstantBool->ConstantInt merge. ChrisReid Spencer2007-01-121-2/+6
| | | | | | | | recommended that getBoolValue be replaced with getZExtValue and that get(bool) be replaced by get(const Type*, uint64_t). This implements those changes. llvm-svn: 33110
* Rename BoolTy as Int1Ty. Patch by Sheng Zhou.Reid Spencer2007-01-111-12/+12
| | | | llvm-svn: 33076
* For PR1043:Zhou Sheng2007-01-111-31/+12
| | | | | | | Merge ConstantIntegral and ConstantBool into ConstantInt. Remove ConstantIntegral and ConstantBool from LLVM. llvm-svn: 33073
* Add a new ConstantPacked::getAllOnesValue methodChris Lattner2007-01-041-0/+12
| | | | llvm-svn: 32856
OpenPOWER on IntegriCloud