summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix test/Transforms/InstCombine/2007-01-27-AndICmp.ll, a miscompilation ofChris Lattner2007-01-271-1/+2
| | | | | | Mozilla that Anton tracked down. llvm-svn: 33591
* Cleanup checks in the load and store of casted pointer transforms. TwoReid Spencer2007-01-221-8/+7
| | | | | | | | changes: (1) don't special case for i1 any more, (2) use the new TargetData::getTypeSizeInBits method to ensure source and dest are the same bit width. llvm-svn: 33427
* Revise the store V, (cast P) -> store (cast V) -> P transform.Reid Spencer2007-01-201-9/+4
| | | | | | | | | We only want to do this if the src and destination types have the same bit width. This patch uses TargetData::getTypeSizeInBits() instead of making a special case for integer types and avoiding the transform if they don't match. llvm-svn: 33414
* Teach TargetData to handle 'preferred' alignment for each target, and useChris Lattner2007-01-201-9/+15
| | | | | | these alignment amounts to align scalars when we can. Patch by Scott Michel! llvm-svn: 33409
* For this transform: store V, (cast P) -> store (cast V), PReid Spencer2007-01-191-3/+4
| | | | | | | don't allow the transform if V and the pointer's element type are different width integer types. llvm-svn: 33371
* For PR1043:Reid Spencer2007-01-191-38/+38
| | | | | | | | | | | | | | 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
* Fix InstCombine/2007-01-18-VectorInfLoop.ll, a case where instcombineChris Lattner2007-01-181-3/+9
| | | | | | infinitely loops. llvm-svn: 33343
* Clean up some code around the store V, (cast P) -> store (cast V), PReid Spencer2007-01-181-8/+14
| | | | | | | | | transform. Change some variable names so it is clear what is source and what is dest of the cast. Also, add an assert to ensure that the integer to integer case is asserting if the bitwidths are different. This prevents illegal casts from being formed and catches bitwidth bugs sooner. llvm-svn: 33337
* Fix a regression in my isIntegral patch that broke 471.omnetpp. This isChris Lattner2007-01-151-6/+8
| | | | | | | | because TargetData::getTypeSize() returns the same for i1 and i8. This fix is not right for the full generality of bitwise types, but it fixes the regression. llvm-svn: 33237
* Implement InstCombine/phi.ll:test7, deletion of trivial value loops forChris Lattner2007-01-151-2/+16
| | | | | | induction variables. llvm-svn: 33234
* simplify some code now that types are signlessChris Lattner2007-01-151-46/+12
| | | | llvm-svn: 33232
* delete stores to allocas with one use. This is a trivial form of DSE whichChris Lattner2007-01-151-0/+18
| | | | | | often kicks in for ?: expressions. llvm-svn: 33231
* rename Type::isIntegral to Type::isInteger, eliminating the old Type::isInteger.Chris Lattner2007-01-151-54/+54
| | | | | | | | | 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
* Eliminate calls to isInteger, generalizing code and tightening checks as needed.Chris Lattner2007-01-151-12/+12
| | | | llvm-svn: 33218
* instcombine has always been miscompiling fcmp x, x, disregarding possibleChris Lattner2007-01-141-15/+39
| | | | | | NANs. This fixes PR1111 and Transforms/InstCombine/2007-01-14-FcmpSelf.ll llvm-svn: 33208
* Fix Transforms/InstCombine/2007-01-13-ExtCompareMiscompile.ll, which is partChris Lattner2007-01-131-3/+13
| | | | | | of PR1107 llvm-svn: 33185
* For PR1064:Reid Spencer2007-01-121-19/+14
| | | | | | | | | | | | | | | | | | | | | | | 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-19/+28
| | | | | | | | 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-15/+15
| | | | llvm-svn: 33076
* Remove unnecessary boolean type check.Zhou Sheng2007-01-111-2/+1
| | | | llvm-svn: 33075
* For PR1043:Zhou Sheng2007-01-111-110/+108
| | | | | | | Merge ConstantIntegral and ConstantBool into ConstantInt. Remove ConstantIntegral and ConstantBool from LLVM. llvm-svn: 33073
* Unbreak VC++ build.Jeff Cohen2007-01-081-1/+1
| | | | llvm-svn: 33021
* Comparison of primitive type sizes should now be done in bits, not bytes.Reid Spencer2007-01-081-8/+9
| | | | | | | This patch converts getPrimitiveSize to getPrimitiveSizeInBits where it is appropriate to do so (comparison of integer primitive types). llvm-svn: 33012
* relax some typesChris Lattner2007-01-071-3/+2
| | | | llvm-svn: 32980
* Fix regressions in InstCombine/call-cast-target.ll and ↵Chris Lattner2007-01-061-1/+5
| | | | | | InstCombine/2003-11-13-ConstExprCastCall.ll llvm-svn: 32959
* this final call to canLosslesslyBitCastTo is dead, because ValueRequiresCastChris Lattner2007-01-061-4/+0
| | | | | | is only called on integers. llvm-svn: 32949
* simplify some more code now that there are not multiple different integerChris Lattner2007-01-061-8/+4
| | | | | | types of the same size llvm-svn: 32948
* eliminate some uses of canLosslesslyBitCastTo, this actually makes the code ↵Chris Lattner2007-01-061-15/+14
| | | | | | | | stronger, by nuking relational pointer comparisons with casts. llvm-svn: 32947
* Implement InstCombine/vec_shuffle.ll:%test7, simplifying shuffles withChris Lattner2007-01-051-1/+23
| | | | | | undef operands. llvm-svn: 32899
* fold things like a^b != c^a -> b != c. This implements ↵Chris Lattner2007-01-051-12/+33
| | | | | | InstCombine/xor.ll:test27 llvm-svn: 32893
* Compile X + ~X to -1. This implements Instcombine/add.ll:test34Chris Lattner2007-01-051-1/+7
| | | | llvm-svn: 32890
* Death to useless bitcast instructions!Reid Spencer2007-01-041-33/+3
| | | | llvm-svn: 32866
* For PR950:Reid Spencer2006-12-311-175/+116
| | | | | | | | | | | | | This patch replaces signed integer types with signless ones: 1. [US]Byte -> Int8 2. [U]Short -> Int16 3. [U]Int -> Int32 4. [U]Long -> Int64. 5. Removal of isSigned, isUnsigned, getSignedVersion, getUnsignedVersion and other methods related to signedness. In a few places this warranted identifying the signedness information from other sources. llvm-svn: 32785
* For PR1066:Reid Spencer2006-12-241-2/+8
| | | | | | | | Fix this by ensuring that a bitcast is inserted to do sign switching. This is only temporarily needed as the merging of signed and unsigned is next on the SignlessTypes plate. llvm-svn: 32757
* Shut up some compilers that can't accurately analyze variable usageReid Spencer2006-12-231-2/+2
| | | | | | correctly and emit "may be used uninitialized" warnings. llvm-svn: 32756
* For PR1065:Reid Spencer2006-12-231-12/+7
| | | | | | | Don't allow CmpInst instances to be processed in FoldSelectOpOp because you can't easily swap their operands. llvm-svn: 32753
* For PR950:Reid Spencer2006-12-231-681/+1023
| | | | | | | | 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
* Switch over Transforms/Scalar to use the STATISTIC macro. For each statisticChris Lattner2006-12-191-6/+6
| | | | | | | converted, we lose a static initializer. This also allows GCC to emit warnings about unused statistics. llvm-svn: 32690
* Convert the last uses of CastInst::createInferredCast to a normal castReid Spencer2006-12-181-3/+10
| | | | | | | | creation. These changes are still temporary but at least this pushes knowledge of signedness out closer to where it can be determined properly and allows signedness to be removed from VMCore. llvm-svn: 32654
* Fix a bug in EvaluateInDifferentType. The type of operand should not beReid Spencer2006-12-131-20/+17
| | | | | | | | | used to determine whether a ZExt or SExt cast is performed. Instead, pass an "isSigned" bool to the function and determine its value from the opcode of the cast involved. Also, clean up some cruft from previous patches. llvm-svn: 32548
* Implement review feedback. Most of this has to do with removing unnecessaryReid Spencer2006-12-131-43/+16
| | | | | | cast instructions. A few are bug fixes. llvm-svn: 32544
* For mul transforms, when checking for a cast from bool as either operand,Reid Spencer2006-12-131-2/+4
| | | | | | | make sure to also check that it is a zext from bool, not any other cast operation type. llvm-svn: 32539
* Fix and/or/xor (cast A), (cast B) --> cast (and/or/xor A, B)Reid Spencer2006-12-131-41/+40
| | | | | | | | The cast patch introduced the possibility that the wrong cast opcode could be used and that this transform could trigger on different kinds of cast operations. This patch rectifies that. llvm-svn: 32538
* Replace inferred getCast(V,Ty) calls with more strict variants.Reid Spencer2006-12-121-31/+31
| | | | | | | Rename getZeroExtend and getSignExtend to getZExt and getSExt to match the the casting mnemonics in the rest of LLVM. llvm-svn: 32514
* this can be trunc or bitcast, per line 3092.Chris Lattner2006-12-121-1/+1
| | | | llvm-svn: 32487
* Fix regression on 400.perlbench last night.Chris Lattner2006-12-121-1/+1
| | | | llvm-svn: 32486
* Fix numerous inferred casts.Reid Spencer2006-12-121-77/+121
| | | | llvm-svn: 32479
* Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, areBill Wendling2006-12-071-2/+2
| | | | | | now cerr, cout, and NullStream resp. llvm-svn: 32298
* Update ConstantIntegral Max/Min tests for new interface.Reid Spencer2006-12-061-4/+4
| | | | llvm-svn: 32288
* Detemplatize the Statistic class. The only type it is instantiated withChris Lattner2006-12-061-5/+5
| | | | | | is 'unsigned'. llvm-svn: 32279
OpenPOWER on IntegriCloud