summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/IndVarSimplify
Commit message (Collapse)AuthorAgeFilesLines
...
* Convert all tests using TCL-style quoting to use shell-style quoting.Chandler Carruth2012-07-027-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | This was done through the aid of a terrible Perl creation. I will not paste any of the horrors here. Suffice to say, it require multiple staged rounds of replacements, state carried between, and a few nested-construct-parsing hacks that I'm not proud of. It happens, by luck, to be able to deal with all the TCL-quoting patterns in evidence in the LLVM test suite. If anyone is maintaining large out-of-tree test trees, feel free to poke me and I'll send you the steps I used to convert things, as well as answer any painful questions etc. IRC works best for this type of thing I find. Once converted, switch the LLVM lit config to use ShTests the same as Clang. In addition to being able to delete large amounts of Python code from 'lit', this will also simplify the entire test suite and some of lit's architecture. Finally, the test suite runs 33% faster on Linux now. ;] For my 16-hardware-thread (2x 4-core xeon e5520): 36s -> 24s llvm-svn: 159525
* Teach SCEV's icmp simplification logic that a-b == 0 is equivalent to a == b.Benjamin Kramer2012-05-301-0/+42
| | | | | | | | | | | | | | | This also required making recursive simplifications until nothing changes or a hard limit (currently 3) is hit. With the simplification in place indvars can canonicalize loops of the form for (unsigned i = 0; i < a-b; ++i) into for (unsigned i = 0; i != a-b; ++i) which used to fail because SCEV created a weird umax expr for the backedge taken count. llvm-svn: 157701
* Convert -indvars tests that rely on SCEV expansion to -loop-reduce tests.Andrew Trick2012-03-222-120/+0
| | | | llvm-svn: 153259
* Remove tests: indvars trivially preserves GEPs now.Andrew Trick2012-03-224-203/+0
| | | | llvm-svn: 153258
* Remove test: trivial canonical IV test which is covered by other SCEV tests.Andrew Trick2012-03-221-31/+0
| | | | llvm-svn: 153257
* Remove redundant -enable-iv-rewrite=false flags from test cases.Andrew Trick2012-03-2210-13/+7
| | | | llvm-svn: 153255
* Replace all instances of dg.exp file with lit.local.cfg, since all tests are ↵Eli Bendersky2012-02-162-3/+1
| | | | | | | | run with LIT now and now Dejagnu. dg.exp is no longer needed. Patch reviewed by Daniel Dunbar. It will be followed by additional cleanup patches. llvm-svn: 150664
* Extended replaceCongruentPhis to handle mixed phi types.Andrew Trick2012-01-071-2/+2
| | | | llvm-svn: 147707
* Reenable this IndVars unit test.Andrew Trick2011-11-291-4/+1
| | | | | | SCEV can't optimize undef in all cases, which is a separate issue from this test case. llvm-svn: 145343
* Upgrade syntax of tests using volatile instructions to use 'load volatile' ↵Chris Lattner2011-11-273-4/+4
| | | | | | instead of 'volatile load', which is archaic. llvm-svn: 145171
* XFAIL this test until I figure out what indvars is doing here (or find ↵Benjamin Kramer2011-11-201-0/+3
| | | | | | someone who does) llvm-svn: 145008
* Fix an overly general check in SimplifyIndvar to handle useless phi cycles.Andrew Trick2011-11-171-0/+29
| | | | | | | | | | | | | | The right way to check for a binary operation is cast<BinaryOperator>. The original check: cast<Instruction> && numOperands() == 2 would match phi "instructions", leading to an infinite loop in extreme corner case: a useless phi with operands [self, constant] that prior optimization passes failed to remove, being used in the loop by another useless phi, in turn being used by an lshr or udiv. Fixes PR11350: runaway iteration assertion. llvm-svn: 144935
* Fix SCEV overly optimistic back edge taken count for multi-exit loops.Andrew Trick2011-11-163-2/+53
| | | | | | Fixes PR11375: Different results for 'clang++ huh.cpp'... llvm-svn: 144746
* Rewrite LinearFunctionTestReplace to handle pointer-type IVs.Andrew Trick2011-11-021-11/+115
| | | | | | | | We've been hitting asserts in this code due to the many supported combintions of modes (iv-rewrite/no-iv-rewrite) and IV types. This second rewrite of the code attempts to deal with these cases systematically. llvm-svn: 143546
* Broaden an assert to handle enable-iv-rewrite=true following r143183.Andrew Trick2011-11-021-0/+38
| | | | | | Narrowest possible fix for PR11279. llvm-svn: 143522
* LFTR should avoid a type mismatch with null pointer IVs.Andrew Trick2011-10-281-0/+59
| | | | | | Fixes rdar://10359193 Indvar LinearFunctionTestReplace assertion llvm-svn: 143183
* It is not safe to sink an alloca into a stacksave/stackrestore pair, so ↵Eli Friedman2011-10-271-9/+34
| | | | | | don't do that. <rdar://problem/10352360> llvm-svn: 143093
* Removed colons from some target datalayout strings in test, since they don't ↵Lang Hames2011-10-1212-12/+12
| | | | | | match the required format. llvm-svn: 141825
* Move replaceCongruentIVs into SCEVExapander and bias toward "expanded"Andrew Trick2011-10-111-0/+1
| | | | | | | | | | | IVs. Indvars previously chose randomly between congruent IVs. Now it will bias the decision toward IVs that SCEVExpander likes to create. This was not done to fix any problem, it's just a welcome side effect of factoring code. llvm-svn: 141633
* Test case for r140670: indvars should hoist sext.Andrew Trick2011-09-281-0/+28
| | | | llvm-svn: 140671
* Stop emitting instructions with the name "tmp" they eat up memory and have ↵Benjamin Kramer2011-09-271-1/+1
| | | | | | | | to be uniqued, without any benefit. If someone prefers %tmp42 to %42, run instnamer. llvm-svn: 140634
* [indvars] Fix PR10946: SCEV cannot handle Vector IVs.Andrew Trick2011-09-191-0/+16
| | | | llvm-svn: 140026
* Reapply r139759. Disable IV rewriting by default. See PR10916.Andrew Trick2011-09-151-1/+1
| | | | llvm-svn: 139842
* [indvars] Revert r139579 until 401.bzip -arch i386 miscompilation is fixed. ↵Andrew Trick2011-09-131-1/+1
| | | | | | PR10920. llvm-svn: 139583
* Disable IV rewriting by default. See PR10916.Andrew Trick2011-09-131-1/+1
| | | | llvm-svn: 139579
* [indvars] Fix bugs in floating point IV range checks noticed by inspection.Andrew Trick2011-09-131-3/+3
| | | | llvm-svn: 139574
* Conditionalize indvars test that relies on SCEV expansion of geps,Andrew Trick2011-09-121-4/+13
| | | | | | which is only relevant with canonical IVs llvm-svn: 139556
* indvars test only relevant for -enable-iv-rewrite.Andrew Trick2011-09-121-1/+3
| | | | | | Otherwise this case is now covered by no-iv-rewrite.ll. llvm-svn: 139552
* Conditionalize indvars tests that rely on SCEV expansion of geps,Andrew Trick2011-09-125-25/+26
| | | | | | | which is relevant with canonical IVs. Anything else being checked by these tests is already covered by early CSE. llvm-svn: 139535
* Removing indvars tests that directly test canonical IVs and nothing else.Andrew Trick2011-09-126-137/+0
| | | | llvm-svn: 139518
* Rename -disable-iv-rewrite to -enable-iv-rewrite=false in preparation for ↵Andrew Trick2011-09-129-9/+9
| | | | | | default change. llvm-svn: 139517
* Test case for r139453, WidenIV::GetExtendedOperandRecurrence.Andrew Trick2011-09-121-0/+30
| | | | llvm-svn: 139504
* Update to new EH scheme.Bill Wendling2011-09-015-3/+27
| | | | llvm-svn: 138927
* Don't sink landingpad instructions during ind-var simplification.Bill Wendling2011-08-261-0/+32
| | | | llvm-svn: 138651
* Made SCEV's UDiv expressions more canonical. When dividing aAndrew Trick2011-08-061-0/+56
| | | | | | | | | | | | | | | | | | | | | | | recurrence, the initial values low bits can sometimes be ignored. To take advantage of this, added FoldIVUser to IndVarSimplify to fold an IV operand into a udiv/lshr if the operator doesn't affect the result. -indvars -disable-iv-rewrite now transforms i = phi i4 i1 = i0 + 1 idx = i1 >> (2 or more) i4 = i + 4 into i = phi i4 idx = i0 >> ... i4 = i + 4 llvm-svn: 137013
* indvars: Added getInsertPointForUses to find a valid place to truncate the IV.Andrew Trick2011-07-201-0/+39
| | | | llvm-svn: 135568
* indvars test case for r135558.Andrew Trick2011-07-201-0/+7
| | | | llvm-svn: 135559
* indvars -disable-iv-rewrite fix: derived GEP IVsAndrew Trick2011-07-201-6/+29
| | | | llvm-svn: 135558
* indvars: LinearFunctionTestReplace for non-canonical IVs.Andrew Trick2011-07-182-3/+232
| | | | | | | | | | For -disable-iv-rewrite, perform LFTR without generating a new "canonical" induction variable. Instead find the "best" existing induction variable for use in the loop exit test and compute the final value of that IV for use in the new loop exit test. In short, convert to a simple eq/ne exit test as long as it's cheap to do so. llvm-svn: 135420
* indvars -disable-iv-rewrite: Added SimplifyCongruentIVs.Andrew Trick2011-07-062-4/+55
| | | | llvm-svn: 134530
* indvars -disable-iv-rewrite: bug fix involving weird geps and related cleanup.Andrew Trick2011-07-022-4/+30
| | | | llvm-svn: 134306
* indvars -disable-iv-rewrite: handle cloning binary operators that cannot ↵Andrew Trick2011-06-301-4/+38
| | | | | | overflow. llvm-svn: 134177
* indvars -disable-iv-rewrite: handle an edge case involving identity phis.Andrew Trick2011-06-301-7/+32
| | | | llvm-svn: 134124
* indvars -disable-iv-rewrite: insert new trunc instructions carefully.Andrew Trick2011-06-291-2/+31
| | | | llvm-svn: 134112
* indvars -disable-iv-rewrite: just because SCEV ignores casts doesn'tAndrew Trick2011-06-291-0/+37
| | | | | | mean they can be removed. llvm-svn: 134054
* FileCheckify and prepare for -disable-iv-rewrite.Andrew Trick2011-06-281-7/+11
| | | | llvm-svn: 133998
* indvars -disable-iv-rewrite: Adds support for eliminating identityAndrew Trick2011-06-211-0/+1
| | | | | | | | | | | | | | | | | | | ops. This is a rewrite of the IV simplification algorithm used by -disable-iv-rewrite. To avoid perturbing the default mode, I temporarily split the driver and created SimplifyIVUsersNoRewrite. The idea is to avoid doing opcode/pattern matching inside IndVarSimplify. SCEV already does it. We want to optimize with the full generality of SCEV, but optimize def-use chains top down on-demand rather than rewriting the entire expression bottom-up. This was easy to do for operations that SCEV can prove are identity function. So we're now eliminating bitmasks and zero extends this way. A result of this rewrite is that indvars -disable-iv-rewrite no longer requires IVUsers. llvm-svn: 133502
* manually upgrade a bunch of tests to modern syntax, and remove some thatChris Lattner2011-06-171-1/+1
| | | | | | are either unreduced or only test old syntax. llvm-svn: 133228
* Test case pasto (failed when run with IR verifier).Andrew Trick2011-06-021-2/+2
| | | | llvm-svn: 132516
* scev: Better sign-extend removal. Normalize postincrement recurrencesAndrew Trick2011-05-311-17/+12
| | | | | | so that their sign extended forms are congruent when no overflow occurs. llvm-svn: 132360
OpenPOWER on IntegriCloud