summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/IndVarSimplify
Commit message (Collapse)AuthorAgeFilesLines
* Tests: rewrite 'opt ... %s' to 'opt ... < %s' so that opt does not emit a ↵Dmitri Gribenko2012-12-301-1/+1
| | | | | | | | ModuleID This is done to avoid odd test failures, like the one fixed in r171243. llvm-svn: 171250
* Tests: rewrite 'opt ... %s' to 'opt ... < %s' so that opt does not emit a ↵Dmitri Gribenko2012-12-301-1/+1
| | | | | | | | ModuleID This is done to avoid odd test failures, like the one fixed in r171243. llvm-svn: 171246
* Follow up to 168711: It's safe to base this analysis on the found compare, ↵Benjamin Kramer2012-11-291-0/+49
| | | | | | | | just return the value for the right predicate. Thanks to Andy for catching this. llvm-svn: 168921
* SCEV: Even if the latch terminator is foldable we can't deduce the result of ↵Benjamin Kramer2012-11-271-0/+54
| | | | | | | | an unrelated condition with it. Fixes PR14432. llvm-svn: 168711
* Disallow the undocumented practice of starting the datalayout string with '-'.Patrik Hägglund2012-11-231-1/+1
| | | | | | Update some test cases accordingly. llvm-svn: 168516
* Fix SCEV cache invalidation in LCSSA and LoopSimplify.Benjamin Kramer2012-10-261-0/+421
| | | | | | | | | | | | | | The LoopSimplify bug is pretty harmless because the loop goes from unanalyzable to analyzable but the LCSSA bug is very nasty. It only comes into play with a specific order of the LoopPassManager worklist and can cause actual miscompilations, when a SCEV refers to a value that has been replaced with PHI node. SCEVExpander may then insert code into the wrong place, either violating domination or randomly miscompiling stuff. Comes with an extensive test case reduced from the test-suite with bugpoint+SCEVValidator. llvm-svn: 166787
* Indvars: Don't recursively delete instruction during BB iteration.Benjamin Kramer2012-10-191-0/+18
| | | | | | | This can invalidate the iterators leading to use after frees and crashes. Fixes PR12536. llvm-svn: 166291
* SCEVExpander: Don't crash when trying to merge two constant phis.Benjamin Kramer2012-10-192-1/+27
| | | | | | Just constant fold them so they can't cause any trouble. Fixes PR12627. llvm-svn: 166286
* Move TargetData to DataLayout.Micah Villmow2012-10-081-2/+2
| | | | llvm-svn: 165403
* Fix PR13967.Jakub Staszak2012-10-031-0/+26
| | | | llvm-svn: 165187
* indvars: Linear function test replace should avoid reusing undef.Andrew Trick2012-07-182-4/+29
| | | | | | | | | | | | | | | | | | | | | | | Fixes PR13371: indvars pass incorrectly substitutes 'undef' values. I do not like this fix. It's needed until/unless the meaning of undef changes. It attempts to be complete according to the IR spec, but I don't have much confidence in the implementation given the difficulty testing undefined behavior. Worse, this invalidates some of my hard-fought work on indvars and LSR to optimize pointer induction variables. It results benchmark regressions, which I'll track internally. On x86_64 no LTO I see: -3% huffbench -3% 400.perlbench -8% fhourstones My only suggestion for recovering is to change the meaning of undef. If we could trust an arbitrary instruction to produce a some real value that can be manipulated (e.g. incremented) according to non-undef rules, then this case could be easily handled with SCEV. llvm-svn: 160421
* Fix the remaining TCL-style quotes found in the testsuite. This isChandler Carruth2012-07-025-6/+6
| | | | | | | | | | | | | | | | | another mechanical change accomplished though the power of terrible Perl scripts. I have manually switched some "s to 's to make escaping simpler. While I started this to fix tests that aren't run in all configurations, the massive number of tests is due to a really frustrating fragility of our testing infrastructure: things like 'grep -v', 'not grep', and 'expected failures' can mask broken tests all too easily. Essentially, I'm deeply disturbed that I can change the testsuite so radically without causing any change in results for most platforms. =/ llvm-svn: 159547
* 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
OpenPOWER on IntegriCloud