summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Enable a couple xforms for packed vectors (undef | v) -> -1 for packed.Chris Lattner2007-01-041-8/+9
| | | | llvm-svn: 32858
* Vectors are not supported by ConstantInt::getAllOnesValue.Jim Laskey2007-01-031-5/+10
| | | | llvm-svn: 32827
* Fix a typo.Reid Spencer2006-12-311-1/+1
| | | | llvm-svn: 32803
* For PR950:Reid Spencer2006-12-317-227/+158
| | | | | | | | | | | | | 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-2311-922/+1682
| | | | | | | | 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
* add a simple fast-path for dead allocasChris Lattner2006-12-221-1/+8
| | | | llvm-svn: 32750
* handle undef values much more carefully: generalize the resolveundefbranchesChris Lattner2006-12-201-32/+172
| | | | | | | | code to handle instructions as well, so that we properly fold things like X & undef -> 0. This fixes Transforms/SCCP/2006-12-19-UndefBug.ll llvm-svn: 32715
* Convert more Statistic's over to STATISTICChris Lattner2006-12-191-7/+4
| | | | llvm-svn: 32692
* Switch over Transforms/Scalar to use the STATISTIC macro. For each statisticChris Lattner2006-12-1921-102/+101
| | | | | | | 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
* re-enable a temporarily-reverted patchChris Lattner2006-12-151-53/+132
| | | | llvm-svn: 32595
* 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
* Change the interface to SCEVExpander::InsertCastOfTo to take a cast opcodeReid Spencer2006-12-131-12/+21
| | | | | | | so the decision of which opcode to use is pushed upward to the caller. Adjust the callers to pass the expected opcode. llvm-svn: 32535
* revert my recent int<->fp and vector union promotion changes, they exposeChris Lattner2006-12-131-132/+53
| | | | | | | obscure bugs affecting the X86 code generator. I will reenable this when fixed. llvm-svn: 32524
* Replace CastInst::createInferredCast calls with more accurate castReid Spencer2006-12-131-2/+1
| | | | | | creation calls. llvm-svn: 32521
* 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
* Change inferred getCast into specific getCast. Passes all tests.Reid Spencer2006-12-122-3/+9
| | | | llvm-svn: 32469
* Patch for PR1045 and Transforms/ScalarRepl/2006-12-11-SROA-Crash.llChris Lattner2006-12-121-0/+2
| | | | llvm-svn: 32468
* trunc to integer, not to FP.Chris Lattner2006-12-111-2/+11
| | | | llvm-svn: 32426
* implement promotion of unions containing two packed types of the same width.Chris Lattner2006-12-111-15/+30
| | | | | | This implements Transforms/ScalarRepl/union-packed.ll llvm-svn: 32422
* * Eliminate calls to CastInst::createInferredCast.Chris Lattner2006-12-101-40/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add support for promoting unions with fp values in them. This produces our new int<->fp bitcast instructions, implementing Transforms/ScalarRepl/union-fp-int.ll As an example, this allows us to compile this: union intfloat { int i; float f; }; float invsqrt(const float arg_x) { union intfloat x = { .f = arg_x }; const float xhalf = arg_x * 0.5f; x.i = 0x5f3759df - (x.i >> 1); return x.f * (1.5f - xhalf * x.f * x.f); } into: _invsqrt: movss 4(%esp), %xmm0 movd %xmm0, %eax sarl %eax movl $1597463007, %ecx subl %eax, %ecx movd %ecx, %xmm1 mulss LCPI1_0, %xmm0 mulss %xmm1, %xmm0 movss LCPI1_1, %xmm2 mulss %xmm1, %xmm0 subss %xmm0, %xmm2 movl 8(%esp), %eax mulss %xmm2, %xmm1 movss %xmm1, (%eax) ret instead of: _invsqrt: subl $4, %esp movss 8(%esp), %xmm0 movss %xmm0, (%esp) movl (%esp), %eax movl $1597463007, %ecx sarl %eax subl %eax, %ecx movl %ecx, (%esp) mulss LCPI1_0, %xmm0 movss (%esp), %xmm1 mulss %xmm1, %xmm0 mulss %xmm1, %xmm0 movss LCPI1_1, %xmm2 subss %xmm0, %xmm2 mulss %xmm2, %xmm1 movl 12(%esp), %eax movss %xmm1, (%eax) addl $4, %esp ret llvm-svn: 32418
* Incorporate any changes in the successor blocks into the result ofReid Spencer2006-12-081-1/+1
| | | | | | MarkAliveBlocks. llvm-svn: 32375
* Removing even more <iostream> includes.Bill Wendling2006-12-073-71/+60
| | | | llvm-svn: 32320
* Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, areBill Wendling2006-12-074-11/+10
| | | | | | 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
* add missing #includeChris Lattner2006-12-061-0/+1
| | | | llvm-svn: 32280
* Detemplatize the Statistic class. The only type it is instantiated withChris Lattner2006-12-0622-66/+66
| | | | | | is 'unsigned'. llvm-svn: 32279
* Remove the 'printname' argument to WriteAsOperand. It is always true, andChris Lattner2006-12-061-1/+1
| | | | | | passing false would make the asmprinter fail anyway. llvm-svn: 32264
* add an instcombine xform. This speeds up 462.libquantum from 9.78s toChris Lattner2006-12-051-0/+17
| | | | | | 7.48s. This regression is due to unforseen consequences of the cast patch. llvm-svn: 32209
* SCCP does not handle Packed Type properly. Disable Packed Type handlingDevang Patel2006-12-041-1/+17
| | | | | | for now. llvm-svn: 32208
* Update call to CastInst::getCastOpcode for its new signature.Reid Spencer2006-12-041-1/+2
| | | | llvm-svn: 32166
* Unbreak VC++ build.Jeff Cohen2006-12-021-7/+7
| | | | llvm-svn: 32113
* disable transformations that are invalid for fp vectors. This fixesChris Lattner2006-12-021-4/+4
| | | | | | Transforms/InstCombine/2006-12-01-BadFPVectorXform.ll llvm-svn: 32112
* Remove 4 FIXMEs to hack around cast-to-bool problems which no longer exist.Reid Spencer2006-11-301-46/+3
| | | | llvm-svn: 32051
* implement cast.ll:test35. With this, we recognize:Chris Lattner2006-11-291-0/+16
| | | | | | | | | | unsigned short swp(unsigned short a) { return ((a & 0xff00) >> 8 | (a & 0x00ff) << 8); } as an idiom for bswap. llvm-svn: 32011
* Teach instcombine to turn trunc(srl x, c) -> srl (trunc(x), c) when safe.Chris Lattner2006-11-291-1/+33
| | | | | | | This implements InstCombine/cast.ll:test34. It fires hundreds of times on 176.gcc. llvm-svn: 32009
* Implement Regression/Transforms/InstCombine/bswap-fold.ll,Chris Lattner2006-11-291-1/+24
| | | | | | folding seteq (bswap(x)), c -> seteq(x,bswap(c)) llvm-svn: 32006
OpenPOWER on IntegriCloud