aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Add PR number.Devang Patel2008-11-051-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58765 91177308-0d34-0410-b5e6-96231b3b80d8
* New test case.Devang Patel2008-11-051-0/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58745 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new pass to simplify specific half_powr function calls. This isDan Gohman2008-11-041-0/+41
| | | | | | | a specialized pass that it not likely to be generally useful. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58732 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix tests not to emit IR outputAnton Korobeynikov2008-11-042-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58729 91177308-0d34-0410-b5e6-96231b3b80d8
* Ignore conditions that are outside the loop.Devang Patel2008-11-031-0/+47
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58631 91177308-0d34-0410-b5e6-96231b3b80d8
* Turn floating point IVs into integer IVs where possible.Devang Patel2008-11-031-0/+17
| | | | | | | | | This allows SCEV users to effectively calculate trip count. LSR later on transforms back integer IVs to floating point IVs later on to avoid int-to-float casts inside the loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58625 91177308-0d34-0410-b5e6-96231b3b80d8
* Changes from Duncan's review:Nick Lewycky2008-11-021-0/+11
| | | | | | | | | * merge two weak functions by making them both alias a third non-weak fn * don't reimplement CallSite::hasArgument * whitelist the safe linkage types git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58568 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new MergeFunctions pass. It finds identical functions and merges them.Nick Lewycky2008-11-023-0/+61
| | | | | | | | | This triggers only 60 times in llvm-test (look at .llvm.bc, not .linked.rbc) and so it probably wont be turned on by default. Also, may of those are likely to go away when PR2973 is fixed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58557 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix demanded bits analysis with srem by negative number. Based on a patchNick Lewycky2008-11-021-0/+8
| | | | | | | by Richard Osborne. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58555 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix this recently moved code to use the correct type. CI is now aDan Gohman2008-11-021-0/+12
| | | | | | | | ConstantInt, and SI is the original cast instruction. This fixes PR2996. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58549 91177308-0d34-0410-b5e6-96231b3b80d8
* Canonicalize sext(i1) to i1?-1:0, and update various instcombineDan Gohman2008-10-301-1/+25
| | | | | | | optimizations accordingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58457 91177308-0d34-0410-b5e6-96231b3b80d8
* Add InlineCost class for represent the estimated cost of inlining aDaniel Dunbar2008-10-301-0/+14
| | | | | | | | | | function. - This explicitly models the costs for functions which should "always" or "never" be inlined. This fixes bugs where such costs were not previously respected. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58450 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR2967 by not deleting volatile load/stores that occur before unreachable.Chris Lattner2008-10-291-0/+19
| | | | | | | | I don't really see this as being needed, but there is little harm from doing it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58385 91177308-0d34-0410-b5e6-96231b3b80d8
* (A & sext(C)) | (B & ~sext(C) -> C ? A : BDan Gohman2008-10-281-0/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58351 91177308-0d34-0410-b5e6-96231b3b80d8
* no need to print outputChris Lattner2008-10-271-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58228 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't try to create a mask when we don't need one. Fixes a crash.Nick Lewycky2008-10-241-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58075 91177308-0d34-0410-b5e6-96231b3b80d8
* apply Eli's patch for PR2165 and provide a testcase.Chris Lattner2008-10-161-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57625 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach instcombine's visitLoad to scan back several instructionsDan Gohman2008-10-152-0/+22
| | | | | | | | | | | | | | | to find opportunities for store-to-load forwarding or load CSE, in the same way that visitStore scans back to do DSE. Also, define a new helper function for testing whether the addresses of two memory accesses are known to have the same value, and use it in both visitStore and visitLoad. These two changes allow instcombine to eliminate loads in code produced by front-ends that frequently emit obviously redundant addressing for memory references. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57608 91177308-0d34-0410-b5e6-96231b3b80d8
* Combine (fcmp cc0 x, y) | (fcmp cc1 x, y) into a single fcmp when possible.Evan Cheng2008-10-141-0/+34
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57515 91177308-0d34-0410-b5e6-96231b3b80d8
* - Somehow I forgot about one / une.Evan Cheng2008-10-141-1/+9
| | | | | | | | - Renumber fcmp predicates to match their icmp counterparts. - Try swapping operands to expose more optimization opportunities. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57513 91177308-0d34-0410-b5e6-96231b3b80d8
* Optimize anding of two fcmp into a single fcmp if the operands are the same. ↵Evan Cheng2008-10-141-0/+26
| | | | | | | | | | e.g. uno && ueq -> ueq ord && olt -> olt ord && ueq -> oeq git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57507 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR2697 by rewriting the '(X / pos) op neg' logic. This also changesChris Lattner2008-10-111-0/+8
| | | | | | | | | | a couple other cases for clarity, but shouldn't affect correctness. Patch by Eli Friedman! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57387 91177308-0d34-0410-b5e6-96231b3b80d8
* Check loop exit predicate properly while eliminating one iteration loop.Devang Patel2008-10-101-0/+66
| | | | | | | This patch fixes PR 2869 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57369 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typo, fix PR 2865.Devang Patel2008-10-061-0/+31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57221 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow scalarrepl to treat an all-zero GEP just as bitcast.Matthijs Kooijman2008-10-061-0/+24
| | | | | | | | This includes not marking a GEP involving a vector as unsafe, but only when it has all zero indices. This allows scalarrepl to work in a few more cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57177 91177308-0d34-0410-b5e6-96231b3b80d8
* rewrite bswap matching to be more general, allowing arbitraryChris Lattner2008-10-051-1/+16
| | | | | | | | | | shifting and masking inside a bswap expr. This allows it to handle the cases from PR2842, which involve the intermediate 'or' expressions being shifted, not just the input value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57095 91177308-0d34-0410-b5e6-96231b3b80d8
* Ignore loads from and stores to local memory (i.e. allocas)Duncan Sands2008-10-041-0/+10
| | | | | | | | | when deciding whether to mark a function readnone/readonly. Since the pass is currently run before SROA, this may be quite helpful. Requested by Chris on IRC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57050 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow the construction of SCEVs with SCEVCouldNotCompute operands, byNick Lewycky2008-10-041-0/+32
| | | | | | | implementing folding. Fixes PR2857. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57049 91177308-0d34-0410-b5e6-96231b3b80d8
* Nick Lewycky's patch.Devang Patel2008-10-031-0/+36
| | | | | | | | While hosting instruction check PHI node. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57025 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix misoptimization of: xor i1 (icmp eq (X, C1), icmp s[lg]t (X, C2))Nick Lewycky2008-09-301-0/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56834 91177308-0d34-0410-b5e6-96231b3b80d8
* Support inreg, zext and sext as return value attributes.Devang Patel2008-09-291-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56801 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a testcase showing that scalarrepl supports first class structs.Matthijs Kooijman2008-09-291-0/+30
| | | | | | | | I originally made this script to show that scalarrepl didn't support them, but it turned out it does. Better to still add the testcase then. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56781 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement function notes as function attributes. Devang Patel2008-09-262-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56716 91177308-0d34-0410-b5e6-96231b3b80d8
* Rationalize the names of passes that print information:Duncan Sands2008-09-233-4/+5
| | | | | | | | | | | | | | | | | | -callgraph => print-callgraph -callscc => print-callgraph-sccs -cfgscc => print-cfg-sccs -externalfnconstants => print-externalfnconstants -print => print-function -print-alias-sets (no change) -print-callgraph => dot-callgraph -print-cfg => dot-cfg -print-cfg-only => dot-cfg-only -print-dom-info (no change) -printm => print-module -printusedtypes => print-used-types git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56487 91177308-0d34-0410-b5e6-96231b3b80d8
* Add test for improvement of readonly to readnone,Duncan Sands2008-09-191-3/+12
| | | | | | | and non-demotion of readnone to readonly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56344 91177308-0d34-0410-b5e6-96231b3b80d8
* Turn on these tests!Duncan Sands2008-09-191-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56343 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new pass AddReadAttrs which works out which functionsDuncan Sands2008-09-194-0/+38
| | | | | | | | | | can get the readnone/readonly attributes, and gives them it. The plan is to remove markmodref (which did the same thing by querying GlobalsModRef) and delete the analogous functionality from GlobalsModRef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56341 91177308-0d34-0410-b5e6-96231b3b80d8
* Test the callgraph directly for the missing edge.Duncan Sands2008-09-191-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56338 91177308-0d34-0410-b5e6-96231b3b80d8
* splitLoop does not handle split condition EQ.Devang Patel2008-09-181-0/+38
| | | | | | | Fixes PR 2805 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56321 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not hoist instruction above branch condition. The instruction may use ↵Devang Patel2008-09-171-0/+18
| | | | | | branch condition. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56286 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not ignore iv uses outside the loop.Devang Patel2008-09-173-4/+80
| | | | | | | This one slipped through cracks very well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56284 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve instcombine's handling of integer min and max in two ways:Dan Gohman2008-09-162-0/+107
| | | | | | | | | | | | | | | | | - Recognize expressions like "x > -1 ? x : 0" as min/max and turn them into expressions like "x < 0 ? 0 : x", which is easily recognizable as a min/max operation. - Refrain from folding expression like "y/2 < 1" to "y < 2" when the comparison is being used as part of a min or max idiom, like "y/2 < 1 ? 1 : y/2". In that case, the division has another use, so folding doesn't eliminate it, and obfuscates the min/max, making it harder to recognize as a min/max operation. These benefit ScalarEvolution, CodeGen, and anything else that wants to recognize integer min and max. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56246 91177308-0d34-0410-b5e6-96231b3b80d8
* On 64-bit targets, change 32-bit getelementptr indices to be 64-bitDan Gohman2008-09-111-0/+58
| | | | | | | | getelementptr indices, inserting an explicit cast if necessary. This helps expose the sign-extension operation to other optimizations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56133 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a vectorshuffle instcombine bug introduced by r55995.Dan Gohman2008-09-112-0/+39
| | | | | | | Patch by Nicolas Capens! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56129 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an icmp+sdiv optimization to check for and handle an overflowDan Gohman2008-09-101-0/+8
| | | | | | | condition. This fixes PR2740. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56076 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove. Devang Patel2008-09-091-58/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56018 91177308-0d34-0410-b5e6-96231b3b80d8
* if loop induction variable is always sign or zero extended then Devang Patel2008-09-091-0/+58
| | | | | | | extend the type of induction variable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56017 91177308-0d34-0410-b5e6-96231b3b80d8
* fix overflow check.Devang Patel2008-09-091-0/+48
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56011 91177308-0d34-0410-b5e6-96231b3b80d8
* Resolve aliases, when possibleAnton Korobeynikov2008-09-091-0/+19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56001 91177308-0d34-0410-b5e6-96231b3b80d8
* Make SimplifyDemandedVectorElts simplify vectors with multipleDan Gohman2008-09-091-0/+33
| | | | | | | | | | | | | users, and teach it about shufflevector instructions. Also, fix a subtle bug in SimplifyDemandedVectorElts' insertelement code. This is a patch that was originally written by Eli Friedman, with some fixes and cleanup by me. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55995 91177308-0d34-0410-b5e6-96231b3b80d8