summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
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-3129-453/+379
| | | | | | | | | | | | | 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-2321-1037/+1831
| | | | | | | | 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
* Remove isSigned calls via foreknowledge of main's argument types.Reid Spencer2006-12-211-7/+4
| | | | llvm-svn: 32730
* Get rid of a useless if statement whose then and else blocks were identical.Reid Spencer2006-12-211-4/+1
| | | | llvm-svn: 32729
* 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
* switch statistics over to not use static ctors.Chris Lattner2006-12-191-3/+3
| | | | llvm-svn: 32709
* eliminate static ctor from example.Chris Lattner2006-12-191-2/+3
| | | | llvm-svn: 32696
* remove dead statisticChris Lattner2006-12-191-4/+0
| | | | llvm-svn: 32695
* switch more statistics over to STATISTIC, eliminating static ctors. Also,Chris Lattner2006-12-199-39/+30
| | | | | | delete some dead ones. llvm-svn: 32694
* Eliminate static ctors due to Statistic objectsChris Lattner2006-12-1916-85/+71
| | | | llvm-svn: 32693
* 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-183-11/+33
| | | | | | | | 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
* Convert the last use of two-argument ConstantExpr::getCast into anotherReid Spencer2006-12-181-1/+3
| | | | | | form so we can remove that method from ConstantExpr. llvm-svn: 32652
* Added an automatic cast to "std::ostream*" etc. from OStream. We then canBill Wendling2006-12-171-1/+6
| | | | | | | rework the hacks that had us passing OStream in. We pass in std::ostream* instead, check for null, and then dispatch to the correct print() method. llvm-svn: 32636
* when inserting a dummy argument to work-around the CBE not supportingChris Lattner2006-12-161-3/+1
| | | | | | zero arg vararg functions, pass undef instead of 'int 0', which is cheaper. llvm-svn: 32634
* 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
* Fix some casts. isdigit(c) returns 0 or 1, not 0 or -1Reid Spencer2006-12-131-3/+3
| | | | llvm-svn: 32534
* 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-138-47/+49
| | | | | | creation calls. llvm-svn: 32521
* Replace inferred getCast(V,Ty) calls with more strict variants.Reid Spencer2006-12-122-36/+35
| | | | | | | 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
* Fix the casting for the computation of the Malloc size.Reid Spencer2006-12-121-3/+3
| | | | llvm-svn: 32477
* Change inferred getCast into specific getCast. Passes all tests.Reid Spencer2006-12-125-9/+20
| | | | 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
* What should be the last unnecessary <iostream>s in the library.Bill Wendling2006-12-071-6/+5
| | | | llvm-svn: 32333
* Removing even more <iostream> includes.Bill Wendling2006-12-074-90/+79
| | | | llvm-svn: 32320
* Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, areBill Wendling2006-12-0713-49/+46
| | | | | | now cerr, cout, and NullStream resp. llvm-svn: 32298
OpenPOWER on IntegriCloud