summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Instcombile optimization: extractelement(cast) -> cast(extractelement)Nadav Rotem2011-03-311-0/+27
| | | | llvm-svn: 128683
* InstCombine: APFloat can't perform arithmetic on PPC double doubles, don't ↵Benjamin Kramer2011-03-311-0/+9
| | | | | | | | even try. Thanks Eli! llvm-svn: 128676
* InstCombine: Fix transform to use the swapped predicate.Benjamin Kramer2011-03-311-1/+1
| | | | | | Thanks Frits! llvm-svn: 128628
* InstCombine: fold fcmp (fneg x), (fneg y) -> fcmp x, yBenjamin Kramer2011-03-311-0/+9
| | | | llvm-svn: 128627
* InstCombine: fold fcmp pred (fneg x), C -> fcmp swap(pred) x, -CBenjamin Kramer2011-03-311-0/+8
| | | | llvm-svn: 128626
* InstCombine: Shrink "fcmp (fpext x), C" to "fcmp x, C" if C can be ↵Benjamin Kramer2011-03-311-0/+23
| | | | | | | | losslessly converted to the type of x. Fixes PR9592. llvm-svn: 128625
* InstCombine: fold fcmp (fpext x), (fpext y) -> fcmp x, y.Benjamin Kramer2011-03-311-0/+11
| | | | llvm-svn: 128624
* * The DSE code that tested for overlapping needed to take into account the factBill Wendling2011-03-301-0/+1
| | | | | | | | | | | | that one of the numbers is signed while the other is unsigned. This could lead to a wrong result when the signed was promoted to an unsigned int. * Add the data layout line to the testcase so that it will test the appropriate thing. Patch by David Terei! llvm-svn: 128577
* Avoid turning a floating point division with a constant power of two into a ↵Benjamin Kramer2011-03-301-1/+1
| | | | | | | | | denormal multiplication. Some platforms may treat denormals as zero, on other platforms multiplication with a subnormal is slower than dividing by a normal. llvm-svn: 128555
* InstCombine: If the divisor of an fdiv has an exact inverse, turn it into an ↵Benjamin Kramer2011-03-301-0/+25
| | | | | | | | fmul. Fixes PR9587. llvm-svn: 128546
* InstCombine: Add a few missing combines for ANDs and ORs of sign bit tests.Benjamin Kramer2011-03-291-0/+79
| | | | | | | | On x86 we now compile "if (a < 0 && b < 0)" into testl %edi, %esi js IF.THEN llvm-svn: 128496
* Do some simple copy propagation through integer loads and stores when promotingCameron Zwarich2011-03-292-1/+54
| | | | | | | vector types. This helps a lot with inlined functions when using the ARM soft float ABI. Fixes <rdar://problem/9184212>. llvm-svn: 128453
* Teach the transformation that moves binary operators around selects to preserveNick Lewycky2011-03-271-0/+12
| | | | | | the subclass optional data. llvm-svn: 128388
* Constant folding support for calls to umul.with.overflow(), basically ↵Frits van Bommel2011-03-271-8/+33
| | | | | | identical to the smul.with.overflow() code. llvm-svn: 128379
* Add a small missed optimization: turn X == C ? X : Y into X == C ? C : Y. ThisNick Lewycky2011-03-271-0/+13
| | | | | | | | | | removes one use of X which helps it pass the many hasOneUse() checks. In my analysis, this turns up very often where X = A >>exact B and that can't be simplified unless X has one use (except by increasing the lifetime of A which is generally a performance loss). llvm-svn: 128373
* Fix a typo and add a test.Cameron Zwarich2011-03-261-0/+15
| | | | llvm-svn: 128331
* PR9561: A store with a negative offset (via GEP) could erroniously say that itBill Wendling2011-03-261-0/+22
| | | | | | | completely overlaps a previous store, thus mistakenly deleting that store. Check for this condition. llvm-svn: 128319
* Fix PR9464 by correcting some math that just happened to be right in most casesCameron Zwarich2011-03-231-0/+16
| | | | | | that were hit in practice. llvm-svn: 128146
* Add an optimization to GlobalOpt that eliminates calls to __cxa_atexit, if ↵Anders Carlsson2011-03-201-0/+31
| | | | | | the function passed is empty. llvm-svn: 127970
* Avoid creating canonical induction variables for non-native types.Andrew Trick2011-03-1818-18/+22
| | | | | | | | For example, on 32-bit architecture, don't promote all uses of the IV to 64-bits just because one use is a 64-bit cast. Alternate implementation of the patch by Arnaud de Grandmaison. llvm-svn: 127884
* FileCheck-ize and update test.Eli Friedman2011-03-181-6/+9
| | | | llvm-svn: 127845
* Try to not lose variable's debug info during instcombine.Devang Patel2011-03-171-0/+57
| | | | | | | This is done by lowering dbg.declare intrinsic into dbg.value intrinsic. Radar 9143931. llvm-svn: 127834
* Only convert allocas to scalars if it is profitable. The profitability metric ICameron Zwarich2011-03-161-0/+27
| | | | | | | | | | | chose is having a non-memcpy/memset use and being larger than any native integer type. Originally I chose having an access of a size smaller than the total size of the alloca, but this caused some minor issues on the spirit benchmark where SRoA runs again after some inlining. This fixes <rdar://problem/8613163>. llvm-svn: 127718
* Add native integer type TargetData to some existing tests.Cameron Zwarich2011-03-162-2/+2
| | | | llvm-svn: 127717
* Do not add PHIs with no users when creating LCSSA form. Patch by Andrew Clinton.Cameron Zwarich2011-03-152-2/+38
| | | | llvm-svn: 127674
* PR9450: Make switch optimization in SimplifyCFG not dependent on the orderingEli Friedman2011-03-151-8/+48
| | | | | | of pointers in an std::map. llvm-svn: 127650
* If we don't know how long a string is we can't fold an _chk version to theEric Christopher2011-03-151-0/+18
| | | | | | | | normal version. Fixes rdar://9123638 llvm-svn: 127636
* Teach ComputeMaskedBits about sub nsw.Benjamin Kramer2011-03-121-0/+23
| | | | llvm-svn: 127548
* Roll r127459 back in:Cameron Zwarich2011-03-111-1/+2
| | | | | | | | | | | Optimize trivial branches in CodeGenPrepare, which often get created from the lowering of objectsize intrinsics. Unfortunately, a number of tests were relying on llc not optimizing trivial branches, so I had to add an option to allow them to continue to test what they originally tested. This fixes <rdar://problem/8785296> and <rdar://problem/9112893>. llvm-svn: 127498
* Revert r127459, "Optimize trivial branches in CodeGenPrepare, which often getDaniel Dunbar2011-03-111-2/+1
| | | | | | created from the", it broke some GCC test suite tests. llvm-svn: 127477
* ComputeMaskedBits: sub falls through to add, and sub doesn't have the same ↵Benjamin Kramer2011-03-111-0/+10
| | | | | | | | overflow semantics as add. Should fix the selfhost failures that started with r127463. llvm-svn: 127465
* InstCombine: Fix a thinko where transform an icmp under the assumption that ↵Benjamin Kramer2011-03-111-0/+10
| | | | | | | | it's a zero comparison when it's not. Fixes PR9454. llvm-svn: 127464
* Teach ComputeMaskedBits about nsw on add. I don't think there's anything we canNick Lewycky2011-03-111-0/+10
| | | | | | | do with nuw here, but sub and mul should be given similar treatment. Fixes PR9343 #15! llvm-svn: 127463
* Optimize trivial branches in CodeGenPrepare, which often get created from theCameron Zwarich2011-03-111-1/+2
| | | | | | | | | | lowering of objectsize intrinsics. Unfortunately, a number of tests were relying on llc not optimizing trivial branches, so I had to add an option to allow them to continue to test what they originally tested. This fixes <rdar://problem/8785296> and <rdar://problem/9112893>. llvm-svn: 127459
* Fix reassociate to postpone certain instruction deletions untilDan Gohman2011-03-101-0/+25
| | | | | | | | | | after it has finished all of its reassociations, because its habit of unlinking operands and holding them in a datastructure while working means that it's not easy to determine when an instruction is really dead until after all its regular work is done. rdar://9096268. llvm-svn: 127424
* InstCombine: Turn umul_with_overflow into mul nuw if we can prove that it ↵Benjamin Kramer2011-03-101-0/+27
| | | | | | | | | | cannot overflow. This happens a lot in clang-compiled C++ code because it adds overflow checks to operator new[]: unsigned *foo(unsigned n) { return new unsigned[n]; } We can optimize away the overflow check on 64 bit targets because (uint64_t)n*4 cannot overflow. llvm-svn: 127418
* Fix mistyped CHECK lines.Benjamin Kramer2011-03-093-3/+3
| | | | llvm-svn: 127366
* Preserve line number information while simplifying libcalls.Devang Patel2011-03-091-0/+24
| | | | llvm-svn: 127362
* Add a test case for r127320.Cameron Zwarich2011-03-091-0/+14
| | | | llvm-svn: 127321
* Add another micro-optimization. Apologies for the lack of refactoring, but INick Lewycky2011-03-091-0/+8
| | | | | | | | | gave up when I realized I couldn't come up with a good name for what the refactored function would be, to describe what it does. This is PR9343 test12, which is test3 with arguments reordered. Whoops! llvm-svn: 127318
* Add support to scalar replacement for partial vector accesses of an alloca, e.g.Cameron Zwarich2011-03-091-0/+59
| | | | | | | | | | | | | | | | | a union of a float, <2 x float>, and <4 x float>. This mostly comes up with the use of vector intrinsics, especially in NEON when programmers know the layout of the register file. This enables codegen to eliminate a lot of the subregister traffic it would otherwise generate. This commit only enables this for a small number of floating-point cases, but a lot more integer cases. I assume this is okay for all ports, but I did not do extensive testing of the quality of code involving i512 vectors and the like. If there is a use case where this generates worse code than before, let me know and we can scale it back. This fixes <rdar://problem/9036264>. llvm-svn: 127317
* PR9346: Prevent SimplifyDemandedBits from incorrectly introducingEli Friedman2011-03-091-0/+12
| | | | | | INT_MIN % -1. llvm-svn: 127306
* PR9420; an instruction before an unreachable is guaranteed not to have anyEli Friedman2011-03-091-0/+31
| | | | | | | | reachable uses, but there still might be uses in dead blocks. Use the standard solution of replacing all the uses with undef. This is a rare case because it's very sensitive to phase ordering in SimplifyCFG. llvm-svn: 127299
* Fix PR9331. Simplified version of a patch by Jakub Staszak.Duncan Sands2011-03-081-0/+50
| | | | llvm-svn: 127243
* While sinking an instruction, do not lose llvm.dbg.value intrinsic.Devang Patel2011-03-081-0/+62
| | | | llvm-svn: 127214
* Preserve line no. info.Devang Patel2011-03-071-0/+49
| | | | | | Radar 9097659 llvm-svn: 127182
* Add test for r127138.Rafael Espindola2011-03-071-0/+16
| | | | llvm-svn: 127172
* Tweak this test. We can analyze what happens and show that we still do theNick Lewycky2011-03-071-2/+2
| | | | | | | right thing, instead of merely being unable to analyze and the transform doesn't occur. llvm-svn: 127149
* Add more analysis of the sign bit of an srem instruction. If the LHS is negativeNick Lewycky2011-03-071-0/+19
| | | | | | | then the result could go either way. If it's provably positive then so is the srem. Fixes PR9343 #7! llvm-svn: 127146
* ConstantInt has some getters which return ConstantInt's or ConstantVector's ofNick Lewycky2011-03-061-0/+10
| | | | | | | | the value splatted into every element. Extend this to getTrue and getFalse which by providing new overloads that take Types that are either i1 or <N x i1>. Use it in InstCombine to add vector support to some code, fixing PR8469! llvm-svn: 127116
OpenPOWER on IntegriCloud