summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Constants.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* For PR950:Reid Spencer2006-12-311-75/+36
| | | | | | Change signed integer type names to unsigned equivalents. llvm-svn: 32780
* Fix some comments.Reid Spencer2006-12-241-2/+2
| | | | llvm-svn: 32758
* For PR950:Reid Spencer2006-12-231-40/+25
| | | | | | | | This patch removes the SetCC instructions and replaces them with the ICmp and FCmp instructions. The SetCondInst instruction has been removed and been replaced with ICmpInst and FCmpInst. llvm-svn: 32751
* Make ConstantInt not care about sign any more. To ensure the AsmParser canReid Spencer2006-12-191-14/+19
| | | | | | | still check the validity of signed values an overload to isValueValidForType was added to allow passing in an int64_t to check. llvm-svn: 32663
* Remove the two-argument (inferred cast) form of ConstantExpr::getCast nowReid Spencer2006-12-181-7/+0
| | | | | | that its last uses have been removed. llvm-svn: 32653
* Partial unbreak of VC++ (stream stuff has no easy fix).Jeff Cohen2006-12-151-0/+1
| | | | llvm-svn: 32614
* Replace inferred getCast(V,Ty) calls with more strict variants.Reid Spencer2006-12-121-6/+6
| | | | | | | Rename getZeroExtend and getSignExtend to getZExt and getSExt to match the the casting mnemonics in the rest of LLVM. llvm-svn: 32514
* Don't create usless casts for same-bith-width floating point casts.Reid Spencer2006-12-121-2/+3
| | | | llvm-svn: 32475
* Implement getIntegerCast and getFPCast for ConstantExpr. These are similarReid Spencer2006-12-121-0/+23
| | | | | | to the createIntegerCast and createFPCast for CastInst instructions. llvm-svn: 32457
* Packed StructuresAndrew Lenharth2006-12-081-3/+2
| | | | llvm-svn: 32361
* Provide a getOpcode() method on CmpInst to ensure the opcode is returnedReid Spencer2006-12-071-2/+1
| | | | | | as the right type. Use this to shorten some code. llvm-svn: 32300
* For PR950:Reid Spencer2006-12-061-47/+0
| | | | | | | | | Remove the getMaxValue and getMinValue functions from ConstantIntegral. They don't make sense for a signless type. Also, for isMaxValue and isMinValue, have the caller provided the signedness rather than obtaining it from the constant's type. llvm-svn: 32287
* Bail on the getInferredCast idea. Remove the function and convertReid Spencer2006-12-051-8/+8
| | | | | | remaining uses to more specific casts. llvm-svn: 32231
* Implement getPointerCast.Reid Spencer2006-12-051-0/+10
| | | | llvm-svn: 32211
* Separate getCompare from get and getCompareTy from getTy.Reid Spencer2006-12-041-16/+17
| | | | llvm-svn: 32200
* Implement new cast creation functions for both instructions and constantReid Spencer2006-12-041-2/+20
| | | | | | | expressions. These will get used to reduce clutter as we replace various calls to createInferredCast and getCast. llvm-svn: 32191
* Reduce the size of the ExprMapKeyType class.Reid Spencer2006-12-041-3/+3
| | | | llvm-svn: 32186
* For PR950: Fix constant expressions to properly support ICmp and FCmp type ↵Reid Spencer2006-12-041-59/+127
| | | | | | expressions. llvm-svn: 32170
* Take a baby step towards getting rid of inferred casts. Provide methods onReid Spencer2006-12-041-6/+7
| | | | | | | | CastInst and ConstantExpr that allow the signedness to be explicitly passed in and reliance on signedness removed from getCastOpcode. These are temporary measures useful during the conversion of inferred casts. llvm-svn: 32164
* Implement creation of ICmp and FCmp constant expressions.Reid Spencer2006-12-031-26/+57
| | | | llvm-svn: 32147
* add a new ConstantIntegral::get method. Simplify the implementation ofChris Lattner2006-12-011-3/+6
| | | | | | ConstantInt::get llvm-svn: 32080
* For PR950:Reid Spencer2006-11-271-35/+180
| | | | | | | | | | The long awaited CAST patch. This introduces 12 new instructions into LLVM to replace the cast instruction. Corresponding changes throughout LLVM are provided. This passes llvm-test, llvm/test, and SPEC CPUINT2000 with the exception of 175.vpr which fails only on a slight floating point output difference. llvm-svn: 31931
* Removed iostream #includes. Replaced std::cerr with DOUT.Bill Wendling2006-11-171-6/+6
| | | | llvm-svn: 31814
* For PR950:Reid Spencer2006-11-081-20/+17
| | | | | | | | This patch converts the old SHR instruction into two instructions, AShr (Arithmetic) and LShr (Logical). The Shr instructions now are not dependent on the sign of their operands. llvm-svn: 31542
* For PR950:Reid Spencer2006-11-021-9/+29
| | | | | | Replace the REM instruction with UREM, SREM and FREM. llvm-svn: 31369
* Speed up isCString()Evan Cheng2006-10-261-4/+14
| | | | llvm-svn: 31206
* Add isCString() - returns true if a ConstantArray is a CString.Evan Cheng2006-10-261-0/+13
| | | | llvm-svn: 31201
* For PR950:Reid Spencer2006-10-261-4/+26
| | | | | | | | Make necessary changes to support DIV -> [SUF]Div. This changes llvm to have three division instructions: signed, unsigned, floating point. The bytecode and assembler are bacwards compatible, however. llvm-svn: 31195
* For PR950:Reid Spencer2006-10-201-79/+43
| | | | | | | | This patch implements the first increment for the Signless Types feature. All changes pertain to removing the ConstantSInt and ConstantUInt classes in favor of just using ConstantInt. llvm-svn: 31063
* add a method to determine whether evaluation of a constant can trap.Chris Lattner2006-10-201-0/+27
| | | | llvm-svn: 31059
* Eliminate ConstantBool::True and ConstantBool::False. Instead, provideChris Lattner2006-09-281-8/+18
| | | | | | ConstantBool::getTrue() and ConstantBool::getFalse(). llvm-svn: 30666
* remove reference to dead methodChris Lattner2006-09-281-1/+0
| | | | llvm-svn: 30641
* Use the new ManagedStatic class to explicitly manage static variables, ↵Chris Lattner2006-09-281-71/+47
| | | | | | eliminating static ctors/dtors llvm-svn: 30639
* Add new SetCondInst::isRelational/isEquality methods. RenameChris Lattner2006-09-171-2/+2
| | | | | | Instruction::isRelational to Instruction::isComparison. llvm-svn: 30444
OpenPOWER on IntegriCloud