summaryrefslogtreecommitdiff
path: root/test/Analysis
Commit message (Collapse)AuthorAge
* Make LLVM Assembly dramatically easier to read by aligning the comments,Dan Gohman2009-08-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | using formatted_raw_ostream's PadToColumn. Before: bb1: ; preds = %bb %2 = sext i32 %i.01 to i64 ; <i64> [#uses=1] %3 = getelementptr double* %p, i64 %2 ; <double*> [#uses=1] %4 = load double* %3, align 8 ; <double> [#uses=1] %5 = fmul double %4, 1.100000e+00 ; <double> [#uses=1] %6 = sext i32 %i.01 to i64 ; <i64> [#uses=1] %7 = getelementptr double* %p, i64 %6 ; <double*> [#uses=1] After: bb1: ; preds = %bb %2 = sext i32 %i.01 to i64 ; <i64> [#uses=1] %3 = getelementptr double* %p, i64 %2 ; <double*> [#uses=1] %4 = load double* %3, align 8 ; <double> [#uses=1] %5 = fmul double %4, 1.100000e+00 ; <double> [#uses=1] %6 = sext i32 %i.01 to i64 ; <i64> [#uses=1] %7 = getelementptr double* %p, i64 %6 ; <double*> [#uses=1] Several tests required whitespace adjustments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78816 91177308-0d34-0410-b5e6-96231b3b80d8
* Add another Strong-SIV testcase.Andreas Bolka2009-08-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78446 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Strong-SIV testcase.Andreas Bolka2009-08-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78384 91177308-0d34-0410-b5e6-96231b3b80d8
* ZIV tester for LDA.Andreas Bolka2009-08-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78157 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix LDA testcases.Andreas Bolka2009-08-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78153 91177308-0d34-0410-b5e6-96231b3b80d8
* Expand LDA testcases.Andreas Bolka2009-08-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77926 91177308-0d34-0410-b5e6-96231b3b80d8
* Slightly reformat LDA tests to ease grepping.Andreas Bolka2009-07-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77398 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the assembly syntax for nsw, nuw, and exact, putting themDan Gohman2009-07-27
| | | | | | | | after their associated opcodes rather than before. This makes them a little easier to read. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77194 91177308-0d34-0410-b5e6-96231b3b80d8
* When attempting to sign-extend an addrec by interpretingDan Gohman2009-07-25
| | | | | | | | the step value as unsigned, the start value and the addrec itself still need to be treated as signed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77078 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach ScalarEvolution to make use of no-overflow flags whenDan Gohman2009-07-25
| | | | | | | analyzing add recurrences. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77034 91177308-0d34-0410-b5e6-96231b3b80d8
* FileCheck'ize and expand LDA testcases.Andreas Bolka2009-07-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76880 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace the original ad-hoc code for determining whether (v pred w) impliesDan Gohman2009-07-21
| | | | | | | | | (x pred y) with more thorough code that does more complete canonicalization before resorting to range checks. This helps it find more cases where the canonicalized expressions match. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76671 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a testcase for PR4569, which is now fixed.Dan Gohman2009-07-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76526 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce a pointertracking pass.Torok Edwin2009-07-14
| | | | | | | | | For now this only computes the allocated size of the memory pointed to by a pointer, and offset a pointer from allocated pointer. The actual checkLimits part will come later, after another round of review. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75657 91177308-0d34-0410-b5e6-96231b3b80d8
* Add testcases for PR4538, PR4537, and PR4534.Dan Gohman2009-07-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75533 91177308-0d34-0410-b5e6-96231b3b80d8
* When comparing constants, consider a less wide constant to be "less complex"Nick Lewycky2009-07-04
| | | | | | | | than a wider one, before trying to compare their contents which will crash if their sizes are different. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74792 91177308-0d34-0410-b5e6-96231b3b80d8
* Array accesses are independent if the underlying arrays differ.Andreas Bolka2009-06-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74499 91177308-0d34-0410-b5e6-96231b3b80d8
* Print pairwise dependence results, add testcases.Andreas Bolka2009-06-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74402 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a testcase demoing some of ScalarEvolution's new trip count logic.Dan Gohman2009-06-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74049 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug in the trip-count computation with And/Or. If either of theDan Gohman2009-06-22
| | | | | | | sides is CouldNotCompute, the resulting exact count must be CouldNotCompute. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73920 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix llvm::ComputeNumSignBits to handle pointer typesDan Gohman2009-06-22
| | | | | | | conservatively correctly, instead of aborting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73908 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach ScalarEvolution how to analyze loops with multiple exitDan Gohman2009-06-22
| | | | | | | | | | blocks, and also exit blocks with multiple conditions (combined with (bitwise) ands and ors). It's often infeasible to compute an exact trip count in such cases, but a useful upper bound can often be found. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73866 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix ScalarEvolution's backedge-taken count computations to check forDan Gohman2009-06-21
| | | | | | | | | overflow when computing a integer division to round up. Thanks to Nick Lewycky for noticing this! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73862 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach ScalarEvolution how to recognize another xor(and(x, C), C) case.Dan Gohman2009-06-18
| | | | | | | | If C is a single bit and the and gets analyzed as a truncate and zero-extend, the xor can be represnted as an add. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73664 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -disable-output to a bunch of tests that don't care about the output.Dan Gohman2009-06-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73633 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix ScalarEvolution's Xor handling to not assume that an AndDan Gohman2009-06-17
| | | | | | | | that gets recognized with a SCEVZeroExtendExpr must be an And with a low-bits mask. With r73540, this is no longer the case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73594 91177308-0d34-0410-b5e6-96231b3b80d8
* Split the Add, Sub, and Mul instruction opcodes into separateDan Gohman2009-06-04
| | | | | | | | | | | | | | | | integer and floating-point opcodes, introducing FAdd, FSub, and FMul. For now, the AsmParser, BitcodeReader, and IRBuilder all preserve backwards compatability, and the Core LLVM APIs preserve backwards compatibility for IR producers. Most front-ends won't need to change immediately. This implements the first step of the plan outlined here: http://nondot.org/sabre/LLVMNotes/IntegerOverflow.txt git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72897 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach BasicAliasAnalysis to understand constant gep indices that fallDan Gohman2009-05-27
| | | | | | | | | | | | | | beyond their associated static array type. I believe that this fixes a legitimate bug, because BasicAliasAnalysis already has code to check for this condition that works for non-constant indices, however it was missing the case of constant indices. With this change, it checks for both. This fixes PR4267, and miscompiles of SPEC 188.ammp and 464.h264.href. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72451 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach ScalarEvolution to recognize x^-1 in the case where non-demandedDan Gohman2009-05-18
| | | | | | | bits have been stripped out by instcombine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72010 91177308-0d34-0410-b5e6-96231b3b80d8
* Make ScalarEvolution::isLoopGuardedByCond work even when the edgeDan Gohman2009-05-18
| | | | | | | entering a loop is a non-split critical edge. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72004 91177308-0d34-0410-b5e6-96231b3b80d8
* Add nounwind to a few tests.Dan Gohman2009-05-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72002 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow scalar evolution to compute iteration counts for loops with a Eli Friedman2009-05-09
| | | | | | | | pointer-based condition. This fixes PR3171. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71354 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bogus overflow checks by replacing them with actualDan Gohman2009-05-08
| | | | | | | overflow checks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71284 91177308-0d34-0410-b5e6-96231b3b80d8
* Fold trunc casts into add-recurrence expressions, allowing theDan Gohman2009-05-08
| | | | | | | | add-recurrence to be exposed. Add a new SCEV folding rule to help simplify expressions in the presence of these extra truncs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71264 91177308-0d34-0410-b5e6-96231b3b80d8
* When printing a SCEVUnknown with pointer type, don't print anDan Gohman2009-05-01
| | | | | | | | | artificial "ptrtoint", as it tends to clutter up complicated expressions. The cast operators now print both source and destination types, which is usually sufficient. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70554 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend ScalarEvolution's getBackedgeTakenCount to be able toDan Gohman2009-04-30
| | | | | | | | | | | | | compute an upper-bound value for the trip count, in addition to the actual trip count. Use this to allow getZeroExtendExpr and getSignExtendExpr to fold casts in more cases. This may eventually morph into a more general value-range analysis capability; there are certainly plenty of places where more complete value-range information would allow more folding. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70509 91177308-0d34-0410-b5e6-96231b3b80d8
* Generalize the cast-of-addrec folding to handle folding of SCEVs likeDan Gohman2009-04-29
| | | | | | | | | (sext i8 {-128,+,1} to i64) to i64 {-128,+,1}, where the iteration crosses from negative to positive, but is still safe if the trip count is within range. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70421 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix this test to match the new output from scalar-evolution.Dan Gohman2009-04-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70410 91177308-0d34-0410-b5e6-96231b3b80d8
* Include the source type in SCEV cast expression debug output, andDan Gohman2009-04-29
| | | | | | | | print sext, zext, and trunc, instead of signextend, zeroextend, and truncate, respectively, for consistency with the main IR. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70405 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a grammaro in a comment.Dan Gohman2009-04-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70331 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify trunc(extend(x)) in SCEVs, just for completeness. Also fix some oddNick Lewycky2009-04-23
| | | | | | | whitespace in the same file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69870 91177308-0d34-0410-b5e6-96231b3b80d8
* Testcase for PR3909.Owen Anderson2009-04-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69868 91177308-0d34-0410-b5e6-96231b3b80d8
* When turning (ashr(shl(x, n), n)) into sext(trunc(x)), the width of theDan Gohman2009-04-21
| | | | | | | | | type to truncate to should be the number of bits of the value that are preserved, not the number that are clobbered with sign-extension. This fixes regressions in ldecod. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69704 91177308-0d34-0410-b5e6-96231b3b80d8
* change this to test for an alias result more directly.Chris Lattner2009-03-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67046 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a replacement for 2009-02-12-GEPNoalias.ll that works without -debug.Nick Lewycky2009-03-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67011 91177308-0d34-0410-b5e6-96231b3b80d8
* remove a buggy test, it is not ok to use -debug in RUN line.Chris Lattner2009-03-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66918 91177308-0d34-0410-b5e6-96231b3b80d8
* Update this test for the LoopInfo::print changes.Dan Gohman2009-02-27
| | | | 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-24
| | | | | | | | | | 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-13
| | | | | | | | | 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-04
| | | | | | | | | 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