summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar
Commit message (Collapse)AuthorAgeFilesLines
* Patch to make some xforms preserve each other. Patch contributed byChris Lattner2006-05-094-2/+28
| | | | | | Domagoj Babic! llvm-svn: 28181
* Move some code around.Chris Lattner2006-05-061-124/+140
| | | | | | | | | | Make the "fold (and (cast A), (cast B)) -> (cast (and A, B))" transformation only apply when both casts really will cause code to be generated. If one or both doesn't, then this xform doesn't remove a cast. This fixes Transforms/InstCombine/2006-05-06-Infloop.ll llvm-svn: 28141
* Fix an infinite loop compiling oggenc last night.Chris Lattner2006-05-051-6/+9
| | | | llvm-svn: 28128
* Implement InstCombine/cast.ll:test29Chris Lattner2006-05-051-0/+40
| | | | llvm-svn: 28126
* Fix Transforms/InstCombine/2006-05-04-DemandedBitCrash.llChris Lattner2006-05-041-0/+4
| | | | llvm-svn: 28101
* Add pass ID's for various passes, so they can be AddRequiredID. Patch byChris Lattner2006-05-024-0/+8
| | | | | | Domagoj Babic! llvm-svn: 28048
* Fix InstCombine/2006-04-28-ShiftShiftLongLong.llChris Lattner2006-04-281-1/+1
| | | | llvm-svn: 28019
* Fix Transforms/Reassociate/2006-04-27-ReassociateVector.llChris Lattner2006-04-281-2/+3
| | | | llvm-svn: 28007
* Add support for inserting undef into a vector. This implementsChris Lattner2006-04-271-3/+14
| | | | | | Transforms/InstCombine/vec_insert_to_shuffle.ll llvm-svn: 27997
* Fix Transforms/ScalarRepl/2006-04-20-PromoteCrash.llChris Lattner2006-04-201-1/+1
| | | | llvm-svn: 27912
* Make code match cvs commit message :)Andrew Lenharth2006-04-201-1/+1
| | | | llvm-svn: 27881
* If we can convert the return pointer type into an integer that IntPtrTypeAndrew Lenharth2006-04-201-2/+4
| | | | | | can be converted to losslessly, we can continue the conversion to a direct call. llvm-svn: 27880
* Turn x86 unaligned load/store intrinsics into aligned load/store instructionsChris Lattner2006-04-171-1/+16
| | | | | | if the pointer is known aligned. llvm-svn: 27781
* Fix a bug in the 'shuffle(undef,x,mask) -> shuffle(x, undef,mask')' xformChris Lattner2006-04-161-17/+84
| | | | | | | | Make the insert/extract elt -> shuffle code more aggressive. This fixes CodeGen/PowerPC/vec_shuffle.ll llvm-svn: 27728
* Canonicalize shuffle(undef,x,mask) -> shuffle(x, undef,mask').Chris Lattner2006-04-161-2/+22
| | | | llvm-svn: 27727
* significant cleanups to code that uses insert/extractelt heavily. This buildsChris Lattner2006-04-151-0/+126
| | | | | | maximal shuffles out of them where possible. llvm-svn: 27717
* Teach scalarrepl to promote unions of vectors and floats, producingChris Lattner2006-04-141-46/+101
| | | | | | | insert/extractelement operations. This implements Transforms/ScalarRepl/vector_promote.ll llvm-svn: 27710
* Get rid of a signed/unsigned compare warning.Reid Spencer2006-04-121-1/+1
| | | | llvm-svn: 27625
* Turn casts into getelementptr's when possible. This enables SROA to be moreChris Lattner2006-04-121-0/+23
| | | | | | | | aggressive in some cases where LLVMGCC 4 is inserting casts for no reason. This implements InstCombine/cast.ll:test27/28. llvm-svn: 27620
* Implement vec_shuffle.ll:test3Chris Lattner2006-04-101-2/+17
| | | | llvm-svn: 27573
* Implement InstCombine/vec_shuffle.ll:test[12]Chris Lattner2006-04-101-0/+62
| | | | llvm-svn: 27571
* Add supprot for shufflevectorChris Lattner2006-04-081-0/+25
| | | | llvm-svn: 27513
* Lower vperm(x,y, mask) -> shuffle(x,y,mask) if mask is constant. This allowsChris Lattner2006-04-061-8/+58
| | | | | | | | | | | | | | | | us to compile oh-so-realistic stuff like this: vec_vperm(A, B, (vector unsigned char){14}); to: vspltb v0, v0, 14 instead of: vspltisb v0, 14 vperm v0, v2, v1, v0 llvm-svn: 27452
* vector casts of casts are eliminable. Transform this:Chris Lattner2006-04-021-0/+4
| | | | | | | | | | | %tmp = cast <4 x uint> %tmp to <4 x int> ; <<4 x int>> [#uses=1] %tmp = cast <4 x int> %tmp to <4 x float> ; <<4 x float>> [#uses=1] into: %tmp = cast <4 x uint> %tmp to <4 x float> ; <<4 x float>> [#uses=1] llvm-svn: 27355
* Allow transforming this:Chris Lattner2006-04-021-2/+4
| | | | | | | | | | | | %tmp = cast <4 x uint>* %testData to <4 x int>* ; <<4 x int>*> [#uses=1] %tmp = load <4 x int>* %tmp ; <<4 x int>> [#uses=1] to this: %tmp = load <4 x uint>* %testData ; <<4 x uint>> [#uses=1] %tmp = cast <4 x uint> %tmp to <4 x int> ; <<4 x int>> [#uses=1] llvm-svn: 27353
* Turn altivec lvx/stvx intrinsics into loads and stores. This allows theChris Lattner2006-04-021-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | elimination of one load from this: int AreSecondAndThirdElementsBothNegative( vector float *in ) { #define QNaN 0x7FC00000 const vector unsigned int testData = (vector unsigned int)( QNaN, 0, 0, QNaN ); vector float test = vec_ld( 0, (float*) &testData ); return ! vec_any_ge( test, *in ); } Now generating: _AreSecondAndThirdElementsBothNegative: mfspr r2, 256 oris r4, r2, 49152 mtspr 256, r4 li r4, lo16(LCPI1_0) lis r5, ha16(LCPI1_0) addi r6, r1, -16 lvx v0, r5, r4 stvx v0, 0, r6 lvx v1, 0, r3 vcmpgefp. v0, v0, v1 mfcr r3, 2 rlwinm r3, r3, 27, 31, 31 xori r3, r3, 1 cntlzw r3, r3 srwi r3, r3, 5 mtspr 256, r2 blr llvm-svn: 27352
* Fix InstCombine/2006-04-01-InfLoop.llChris Lattner2006-04-011-1/+2
| | | | llvm-svn: 27330
* Fold A^(B&A) -> (B&A)^AChris Lattner2006-04-011-7/+46
| | | | | | | | Fold (B&A)^A == ~B & A This implements InstCombine/xor.ll:test2[56] llvm-svn: 27328
* If we can look through vector operations to find the scalar version of anChris Lattner2006-03-311-0/+40
| | | | | | extract_element'd value, do so. llvm-svn: 27323
* extractelement(undef,x) -> undefChris Lattner2006-03-311-6/+8
| | | | llvm-svn: 27300
* Fix Transforms/InstCombine/2006-03-30-ExtractElement.llChris Lattner2006-03-301-3/+7
| | | | llvm-svn: 27261
* Don't crash on packed logical opsChris Lattner2006-03-251-3/+6
| | | | llvm-svn: 27125
* Fix spelloChris Lattner2006-03-241-2/+2
| | | | llvm-svn: 27052
* add the actual cost to the debug infoChris Lattner2006-03-241-2/+4
| | | | llvm-svn: 27051
* Can't combine anymore - we don't have a chain through llvm.dbg intrinsics.Jim Laskey2006-03-231-10/+0
| | | | llvm-svn: 26992
* silence a bogus gcc warningChris Lattner2006-03-221-2/+2
| | | | llvm-svn: 26953
* Teach cee to propagate through switch statements. This implementsChris Lattner2006-03-191-1/+21
| | | | | | | | Transforms/CorrelatedExprs/switch.ll Patch contributed by Eric Kidd! llvm-svn: 26872
* - Fixed a bogus if condition.Evan Cheng2006-03-181-19/+25
| | | | | | | - Added more debugging info. - Allow reuse of IV of negative stride. e.g. -4 stride == 2 * iv of -2 stride. llvm-svn: 26841
* Sort StrideOrder so we can process the smallest strides first. This allowsEvan Cheng2006-03-181-0/+27
| | | | | | for more IV reuses. llvm-svn: 26837
* Allow users of iv / stride to be rewritten with expression that is a multiplyEvan Cheng2006-03-171-41/+83
| | | | | | of a smaller stride even if they have a common loop invariant expression part. llvm-svn: 26828
* For each loop, keep track of all the IV expressions inserted indexed byEvan Cheng2006-03-161-36/+115
| | | | | | | | | | | | | | stride. For a set of uses of the IV of a stride which is a multiple of another stride, do not insert a new IV expression. Rather, reuse the previous IV and rewrite the uses as uses of IV expression multiplied by the factor. e.g. x = 0 ...; x ++ y = 0 ...; y += 4 then use of y can be rewritten as use of 4*x for x86. llvm-svn: 26803
* Implement a FIXME, recusively reassociatingChris Lattner2006-03-141-26/+65
| | | | | | | | A*A*B + A*A*C --> A*(A*B+A*C) --> A*(A*(B+C)) This implements Reassociate/mul-factor3.ll llvm-svn: 26757
* extract some code into a method, no functionality changeChris Lattner2006-03-141-50/+56
| | | | llvm-svn: 26755
* Promote shifts by a constant to multiplies so that we can reassociateChris Lattner2006-03-141-13/+17
| | | | | | | (x<<1)+(y<<1) -> (X+Y)<<1. This implements Transforms/Reassociate/shift-factor.ll llvm-svn: 26753
* Added target lowering hooks which LSR consults to make more intelligentEvan Cheng2006-03-131-25/+33
| | | | | | transformation decisions. llvm-svn: 26738
* Fix a miscompilation of 188.ammp with the new CFE. 188.ammp is accessingChris Lattner2006-03-081-3/+19
| | | | | | | arrays out of range in a horrible way, but we shouldn't break it anyway. Details in the comments. llvm-svn: 26606
* Teach the alignment handling code to look through constant expr casts and GEPsChris Lattner2006-03-071-4/+12
| | | | llvm-svn: 26580
* Teach instcombine to increase the alignment of memset/memcpy/memmove whenChris Lattner2006-03-061-3/+74
| | | | | | | | | | | | the pointer is known to come from either a global variable, alloca or malloc. This allows us to compile this: P = malloc(28); memset(P, 0, 28); into explicit stores on PPC instead of a memset call. llvm-svn: 26577
* Make vector narrowing more effective, implementingChris Lattner2006-03-051-22/+62
| | | | | | | Transforms/InstCombine/vec_narrow.ll. This add support for narrowing extract_element(insertelement) also. llvm-svn: 26538
* Add factoring of multiplications, e.g. turning A*A+A*B into A*(A+B).Chris Lattner2006-03-041-49/+186
| | | | | | Testcase here: Transforms/Reassociate/mulfactor.ll llvm-svn: 26524
OpenPOWER on IntegriCloud