aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
AgeCommit message (Collapse)Author
2006-04-28Fix Transforms/Reassociate/2006-04-27-ReassociateVector.llChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28007 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-27Add support for inserting undef into a vector. This implementsChris Lattner
Transforms/InstCombine/vec_insert_to_shuffle.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27997 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-27Fix some nondeterminstic behavior in the mem2reg pass that (in addition toChris Lattner
nondeterminism being bad) could cause some trivial missed optimizations (dead phi nodes being left around for later passes to clean up). With this, llvm-gcc4 now bootstraps and correctly compares. I don't know why I never tried to do it before... :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27984 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-20Fix Transforms/ScalarRepl/2006-04-20-PromoteCrash.llChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27912 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-20Make code match cvs commit message :)Andrew Lenharth
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27881 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-20If we can convert the return pointer type into an integer that IntPtrTypeAndrew Lenharth
can be converted to losslessly, we can continue the conversion to a direct call. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27880 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-17Turn x86 unaligned load/store intrinsics into aligned load/store instructionsChris Lattner
if the pointer is known aligned. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27781 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-16Fix a bug in the 'shuffle(undef,x,mask) -> shuffle(x, undef,mask')' xformChris Lattner
Make the insert/extract elt -> shuffle code more aggressive. This fixes CodeGen/PowerPC/vec_shuffle.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27728 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-16Canonicalize shuffle(undef,x,mask) -> shuffle(x, undef,mask').Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27727 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-15significant cleanups to code that uses insert/extractelt heavily. This buildsChris Lattner
maximal shuffles out of them where possible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27717 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-14Teach scalarrepl to promote unions of vectors and floats, producingChris Lattner
insert/extractelement operations. This implements Transforms/ScalarRepl/vector_promote.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27710 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-13linear -> constant timeAndrew Lenharth
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27652 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-12Get rid of a signed/unsigned compare warning.Reid Spencer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27625 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-12Turn casts into getelementptr's when possible. This enables SROA to be moreChris Lattner
aggressive in some cases where LLVMGCC 4 is inserting casts for no reason. This implements InstCombine/cast.ll:test27/28. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27620 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-10Implement vec_shuffle.ll:test3Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27573 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-10Implement InstCombine/vec_shuffle.ll:test[12]Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27571 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-10Add a simple pass to make sure that all (non-library) calls to malloc and freeAndrew Lenharth
are visible to analysis as intrinsics. That is, make sure someone doesn't pass free around by address in some struct (as happens in say 176.gcc). This doesn't get rid of any indirect calls, just ensure calls to free and malloc are always direct. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27560 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-08Add supprot for shufflevectorChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27513 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-07Fix inlining of insert/extract element constantexprsChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27478 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-06Lower vperm(x,y, mask) -> shuffle(x,y,mask) if mask is constant. This allowsChris Lattner
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27452 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-02vector casts of casts are eliminable. Transform this:Chris Lattner
%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] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27355 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-02Allow transforming this:Chris Lattner
%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] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27353 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-02Turn altivec lvx/stvx intrinsics into loads and stores. This allows theChris Lattner
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27352 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-02Adjust to change in Intrinsics.gen interface.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27344 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-01add valuemapper support for inline asmChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27332 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-01Fix InstCombine/2006-04-01-InfLoop.llChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27330 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-01Fold A^(B&A) -> (B&A)^AChris Lattner
Fold (B&A)^A == ~B & A This implements InstCombine/xor.ll:test2[56] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27328 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-31If we can look through vector operations to find the scalar version of anChris Lattner
extract_element'd value, do so. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27323 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-31extractelement(undef,x) -> undefChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27300 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-30Fix Transforms/InstCombine/2006-03-30-ExtractElement.llChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27261 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-27teach the inliner to work with packed constantsChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27161 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-25Don't crash on packed logical opsChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27125 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-24Fix spelloChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27052 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-24add the actual cost to the debug infoChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27051 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-23Strip changes to llvm.dbg intrinsics.Jim Laskey
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26993 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-23Can't combine anymore - we don't have a chain through llvm.dbg intrinsics.Jim Laskey
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26992 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-22silence a bogus gcc warningChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26953 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-19Teach cee to propagate through switch statements. This implementsChris Lattner
Transforms/CorrelatedExprs/switch.ll Patch contributed by Eric Kidd! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26872 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-18- Fixed a bogus if condition.Evan Cheng
- Added more debugging info. - Allow reuse of IV of negative stride. e.g. -4 stride == 2 * iv of -2 stride. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26841 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-18Sort StrideOrder so we can process the smallest strides first. This allowsEvan Cheng
for more IV reuses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26837 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-17Allow users of iv / stride to be rewritten with expression that is a multiplyEvan Cheng
of a smaller stride even if they have a common loop invariant expression part. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26828 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-16For each loop, keep track of all the IV expressions inserted indexed byEvan Cheng
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26803 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-15Teach the strip pass to strip type names in addition to value names. ThisChris Lattner
is fallout from the type/value split in the symtab long long ago :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26785 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-14Implement a FIXME, recusively reassociatingChris Lattner
A*A*B + A*A*C --> A*(A*B+A*C) --> A*(A*(B+C)) This implements Reassociate/mul-factor3.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26757 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-14extract some code into a method, no functionality changeChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26755 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-14Promote shifts by a constant to multiplies so that we can reassociateChris Lattner
(x<<1)+(y<<1) -> (X+Y)<<1. This implements Transforms/Reassociate/shift-factor.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26753 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-13Added target lowering hooks which LSR consults to make more intelligentEvan Cheng
transformation decisions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26738 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-13Handle the removal of the debug chain.Jim Laskey
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26729 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-09use autogenerated side-effect informationChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26673 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-09fix a pastoChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26627 91177308-0d34-0410-b5e6-96231b3b80d8