aboutsummaryrefslogtreecommitdiffstats
path: root/test/Analysis
Commit message (Collapse)AuthorAgeFilesLines
* Update this test for the LoopInfo::print changes.Dan Gohman2009-02-271-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65597 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename ScalarEvolution's getIterationCount to getBackedgeTakenCount,Dan Gohman2009-02-2415-15/+15
| | | | | | | | | | to more accurately describe what it does. Expand its doxygen comment to describe what the backedge-taken count is and how it differs from the actual iteration count of the loop. Adjust names and comments in associated code accordingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65382 91177308-0d34-0410-b5e6-96231b3b80d8
* BasicAA was making the assumption that a local allocation which hadn't escapedNick Lewycky2009-02-131-0/+196
| | | | | | | | | couldn't ever be the return of call instruction. However, it's quite possible that said local allocation is itself the return of a function call. That's what malloc and calloc are for, actually. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64442 91177308-0d34-0410-b5e6-96231b3b80d8
* Finish making AliasAnalysis aware of the fact that most atomic intrinsics ↵Owen Anderson2009-02-041-0/+14
| | | | | | | | | only dereference their arguments, and enhance BasicAA to make use of this fact when computing ModRef info. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63718 91177308-0d34-0410-b5e6-96231b3b80d8
* Wind SCEV back in time, to Nov 18th. This 'fixes' PR3275, PR3294, PR3295,Nick Lewycky2009-01-137-0/+7
| | | | | | | PR3296 and PR3302. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62160 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't try to analyze this "backward" case. This is overly conservative Nick Lewycky2009-01-021-0/+40
| | | | | | | pending a correct solution. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61589 91177308-0d34-0410-b5e6-96231b3b80d8
* Check that the function prototypes are correct before assuming that the Nick Lewycky2008-12-271-0/+19
| | | | | | | parameters are pointers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61451 91177308-0d34-0410-b5e6-96231b3b80d8
* Resubmit support for the 'nocapture' attribute.Nick Lewycky2008-12-191-0/+14
| | | | | | | | | | | The problematic part of this patch is that we were out of attribute bits, requiring some fancy bit hacking to make it fit (by shrinking alignment) without breaking existing users or the file format. This change will require users to rebuild llvm-gcc to match llvm. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61239 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove empty test.Bill Wendling2008-12-161-0/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61095 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporarily revert r61019, r61030, and r61040. These were breaking LLVM ReleaseBill Wendling2008-12-161-13/+0
| | | | | | | builds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61094 91177308-0d34-0410-b5e6-96231b3b80d8
* Generalize support for analyzing loops to include SLE/SGE loop exit conditionsNick Lewycky2008-12-164-2/+41
| | | | | | | and support for non-unit strides with signed exit conditions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61082 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach basicaa to use the nocapture attribute when possible. When theChris Lattner2008-12-151-0/+13
| | | | | | | | intrinsics are properly marked nocapture, the fixme should be addressed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61040 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert my re-instated reverted commit, fixes the bootstrap build on x86-64 ↵Nick Lewycky2008-12-122-0/+2
| | | | | | linux. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60951 91177308-0d34-0410-b5e6-96231b3b80d8
* Sneaky, sneaky: move the -1 to the outside of the SMax. Reinstate theNick Lewycky2008-12-112-1/+27
| | | | | | | optimization of SGE/SLE with unit stride, now that it works properly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60881 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow basicaa to walk through geps with identical indices in Chris Lattner2008-12-101-0/+16
| | | | | | | | | | | | | parallel, allowing it to decide that P/Q must alias if A/B must alias in things like: P = gep A, 0, i, 1 Q = gep B, 0, i, 1 This allows GVN to delete 62 more instructions out of 403.gcc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60820 91177308-0d34-0410-b5e6-96231b3b80d8
* xfail this for now.Evan Cheng2008-12-091-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60777 91177308-0d34-0410-b5e6-96231b3b80d8
* It's easy to handle SLE/SGE when the loop has a unit stride.Nick Lewycky2008-12-091-0/+24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60748 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend the 'noalias' attribute to function return values. This is intended toNick Lewycky2008-11-241-0/+12
| | | | | | | | | | indicate functions that allocate, such as operator new, or list::insert. The actual definition is slightly less strict (for now). No changes to the bitcode reader/writer, asm printer or verifier were needed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59934 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a utility function that detects whether a loop is guaranteed to be finite.Nick Lewycky2008-11-183-0/+91
| | | | | | | | | | | | Use it to safely handle less-than-or-equals-to exit conditions in loops. These also occur when the loop exit branch is exit on true because SCEV inverses the icmp predicate. Use it again to handle non-zero strides, but only with an unsigned comparison in the exit condition. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59528 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't brute-force analyze cubic or higher polynomials.Nick Lewycky2008-11-161-0/+19
| | | | | | | | If this patch causes a performance regression for anyone, please let me know, and it can be fixed in a different way with much more effort. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59384 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't crash analyzing certain quadratics (addrec of {X,+,Y,+,1}).Nick Lewycky2008-11-031-0/+21
| | | | | | | We're still waiting on code that actually analyzes them properly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58592 91177308-0d34-0410-b5e6-96231b3b80d8
* Rationalize the names of passes that print information:Duncan Sands2008-09-232-2/+4
| | | | | | | | | | | | | | | | | | -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
* Remove the MarkModRef pass (use AddReadAttrs instead).Duncan Sands2008-09-191-1104/+0
| | | | | | | | | Unfortunately this means removing one regression test of GlobalsModRef because I couldn't work out how to perform it without MarkModRef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56342 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new pass AddReadAttrs which works out which functionsDuncan Sands2008-09-194-38/+0
| | | | | | | | | | 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
* Teach -callgraph to always print the callgraph (as theDuncan Sands2008-09-192-2/+2
| | | | | | | | | description says it does), not just when -analyze is used as well. This means printing to stderr, so adjust some tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56337 91177308-0d34-0410-b5e6-96231b3b80d8
* Finally re-apply r46959. This is made feasible by the combinationDan Gohman2008-09-162-3/+4
| | | | | | | of r56230, r56232, and r56246. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56247 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix spacing in the grep line for this test, following the recentDan Gohman2008-09-161-1/+1
| | | | | | | SCEV-whitespace changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56234 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach ScalarEvolution to consider loop preheaders in the search forDan Gohman2008-09-152-0/+234
| | | | | | | | an if statement that guards a loop, to allow indvars to avoid smax operations in more situations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56232 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix WriteAsOperand to not emit a leading space character. AdjustDan Gohman2008-09-1410-10/+10
| | | | | | | | | | | | | | | | | | | its callers to emit a space character before calling it when a space is needed. This fixes several spurious whitespace issues in ScalarEvolution's debug dumps. See the test changes for examples. This also fixes odd space-after-tab indentation in the output for switch statements, and changes calls from being printed like this: call void @foo( i32 %x ) to this: call void @foo(i32 %x) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56196 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR2792: treat volatile loads as writing memory somewhere.Duncan Sands2008-09-131-0/+9
| | | | | | | Treat stores as reading memory, just to play safe. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56188 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct callgraph construction. It has two problems:Duncan Sands2008-09-093-0/+22
| | | | | | | | | | | | | | | | | | | | (1) code left over from the days of ConstantPointerRef: if a use of a function is a GlobalValue then that is not considered a reason to add an edge from the external node, even though the use may be as an initializer for an externally visible global! There might be some point to this behaviour when the use is by an alias (though the code predated aliases by some centuries), but I think PR2782 is a better way of handling that. (2) If function F calls function G, and also G is a parameter to the call, then an F->G edge is not added to the callgraph. While this doesn't seem to matter much, adding such an edge makes the callgraph more regular. In addition, the new code should be faster as well as simpler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55987 91177308-0d34-0410-b5e6-96231b3b80d8
* Testcase for commits 55700 and 55714.Duncan Sands2008-09-031-0/+1104
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55715 91177308-0d34-0410-b5e6-96231b3b80d8
* Since onlyReadsMemory returns true if in factDuncan Sands2008-09-031-0/+9
| | | | | | | | | doesNotAccessMemory, check doesNotAccessMemory first, since otherwise functions may be marked readonly rather than readnone. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55697 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleanup GlobalsModRef a bit. When analysing theDuncan Sands2008-09-033-0/+38
| | | | | | | | | | | | callgraph, when one member of a SCC calls another then the analysis would drop to mod-ref because there is (usually) no function info for the callee yet; fix this. Teach the analysis about function attributes, in particular the readonly attribute (which requires being careful about globals). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55696 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove GCSE and LoadVN from the testsuite.Owen Anderson2008-08-1628-186/+18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54832 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend ScalarEvolution's executesAtLeastOnce logic to be able toDan Gohman2008-08-121-0/+35
| | | | | | | | | continue past the first conditional branch when looking for a relevant test. This helps it avoid using MAX expressions in loop trip counts in more cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54697 91177308-0d34-0410-b5e6-96231b3b80d8
* PR2621: Improvements to the SCEV AddRec binomial expansion. This Eli Friedman2008-08-042-0/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | version uses a new algorithm for evaluating the binomial coefficients which is significantly more efficient for AddRecs of more than 2 terms (see the comments in the code for details on how the algorithm works). It also fixes some bugs: it removes the arbitrary length restriction for AddRecs, it fixes the silent generation of incorrect code for AddRecs which require a wide calculation width, and it fixes an issue where we were incorrectly truncating the iteration count too far when evaluating an AddRec expression narrower than the induction variable. There are still a few related issues I know of: I think there's still an issue with the SCEVExpander expansion of AddRec in terms of the width of the induction variable used. The hack to avoid generating too-wide integers shouldn't be necessary; instead, the callers should be considering the cost of the expansion before expanding it (in addition to not expanding too-wide integers, we might not want to expand expressions that are really expensive, especially when optimizing for size; calculating an length-17 32-bit AddRec currently generates about 250 instructions of straight-line code on X86). Also, for long 32-bit AddRecs on X86, CodeGen really sucks at scheduling the code. I'm planning on filing follow-up PRs for these issues. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54332 91177308-0d34-0410-b5e6-96231b3b80d8
* Another SCEV issue from PR2607; essentially the same issue, but this Eli Friedman2008-07-301-0/+24
| | | | | | | | | | | | | time applying to the implicit comparison in smin expressions. The correct way to transform an inequality into the opposite inequality, either signed or unsigned, is with a not expression. I looked through the SCEV code, and I don't think there are any more occurrences of this issue. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54194 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix for PR2607: SCEV miscomputing the loop count for loops with an Eli Friedman2008-07-301-0/+27
| | | | | | | | | | | | | | SGT exit condition. Essentially, the correct way to flip an inequality in 2's complement is the not operator, not the negation operator. That said, the difference only affects cases involving INT_MIN. Also, enhance the pre-test search logic to be a bit smarter about inequalities flipped with a not operator, so it can eliminate the smax from the iteration count for simple loops. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54184 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR2088. Use modulo linear equation solver to compute loop iterationWojciech Matyjewicz2008-07-203-1/+30
| | | | | | | count. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53810 91177308-0d34-0410-b5e6-96231b3b80d8
* XFAIL this test.Nick Lewycky2008-07-191-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53793 91177308-0d34-0410-b5e6-96231b3b80d8
* While testing particular algorithms to compute loop iteration count the bruteWojciech Matyjewicz2008-07-195-7/+10
| | | | | | | | | | | | | | | force evaluation (ComputeIterationCountExhaustively) should be turned off. It doesn't apply to trip-count2.ll because this file tests the brute force evaluation. The test for PR2364 (2008-05-25-NegativeStepToZero.ll) currently fails showing that the patch for this bug doesn't work. I'll fix it in a few hours with a patch for PR2088. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53792 91177308-0d34-0410-b5e6-96231b3b80d8
* Stop creating extraneous smax/umax in SCEV. This removes a regression where weNick Lewycky2008-07-123-1/+67
| | | | | | | started complicating many loops ('for' loops, in fact). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53508 91177308-0d34-0410-b5e6-96231b3b80d8
* If we are checking to see if the result of a call aliases aChris Lattner2008-06-161-0/+23
| | | | | | | | pointer derived from a local allocation, if the local allocation never escapes, the pointers can't alias. This implements PR2436 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52301 91177308-0d34-0410-b5e6-96231b3b80d8
* Crash less. The i64 restriction in BinomialCoefficient caused some problemsNick Lewycky2008-06-131-0/+43
| | | | | | | | | with code that was expecting different bit widths for different values. Make getTruncateOrZeroExtend a method on ScalarEvolution, and use it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52248 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing whitespace after line continuations in test cases to them work.Matthijs Kooijman2008-06-102-2/+2
| | | | | | | This fixes two test cases that were not being run properly before. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52179 91177308-0d34-0410-b5e6-96231b3b80d8
* Suppress the (stderr) output of -aa-eval, this fixes 5 tests.Matthijs Kooijman2008-06-105-5/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52173 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixes PR2395. Looking for a constant in a GEP tail (when the first GEP Wojciech Matyjewicz2008-06-021-0/+15
| | | | | | | | | is longer than the second one) should stop after finding one. Added break instruction guarantees it. It also changes difference between offsets to absolute value of this difference in the condition. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51875 91177308-0d34-0410-b5e6-96231b3b80d8
* Move these tests into the proper directory.Owen Anderson2008-05-293-0/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51685 91177308-0d34-0410-b5e6-96231b3b80d8
* Whoops -- forgot PR reference on this test.Nick Lewycky2008-05-261-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51569 91177308-0d34-0410-b5e6-96231b3b80d8