summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
* Tidy up several unbeseeming casts from pointer to intptr_t.Dan Gohman2008-09-0415-21/+21
| | | | llvm-svn: 55779
* If a SCC has a node without a function, then the SCCDuncan Sands2008-09-031-9/+14
| | | | | | | | | | analysis would bail out without removing function records for other members of the SCC (which may exist if those functions read or wrote global variables). Since these are initialized to "readnone", this resulted in incorrect alias analysis results. llvm-svn: 55714
* Fix maxo bado thinko.Duncan Sands2008-09-031-1/+1
| | | | llvm-svn: 55700
* Since onlyReadsMemory returns true if in factDuncan Sands2008-09-031-2/+4
| | | | | | | | doesNotAccessMemory, check doesNotAccessMemory first, since otherwise functions may be marked readonly rather than readnone. llvm-svn: 55697
* Cleanup GlobalsModRef a bit. When analysing theDuncan Sands2008-09-031-104/+108
| | | | | | | | | | | 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). llvm-svn: 55696
* rename destroy -> releaseMemory to properly hook into passmgr.Chris Lattner2008-08-281-2/+2
| | | | llvm-svn: 55508
* Clear the intervals list in "destroy", patch by Chris Lattner2008-08-281-0/+1
| | | | | | Prakash Prabhu! llvm-svn: 55458
* Switch the asmprinter (.ll) and all the stuff it requires over toChris Lattner2008-08-231-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | use raw_ostream instead of std::ostream. Among other goodness, this speeds up llvm-dis of kc++ with a release build from 0.85s to 0.49s (88% faster). Other interesting changes: 1) This makes Value::print be non-virtual. 2) AP[S]Int and ConstantRange can no longer print to ostream directly, use raw_ostream instead. 3) This fixes a bug in raw_os_ostream where it didn't flush itself when destroyed. 4) This adds a new SDNode::print method, instead of only allowing "dump". A lot of APIs have both std::ostream and raw_ostream versions, it would be useful to go through and systematically anihilate the std::ostream versions. This passes dejagnu, but there may be minor fallout, plz let me know if so and I'll fix it. llvm-svn: 55263
* Temporarily reverting r55137. This was causing the bootstrap to go into anBill Wendling2008-08-211-7/+3
| | | | | | infinite loop. llvm-svn: 55149
* Fix ComputeMaskedBits to handle phis correctly. We need to take theDavid Greene2008-08-211-3/+7
| | | | | | minimum of the known zeros. llvm-svn: 55137
* Don't use the result of WriteAsOperand or WriteTypeSymbolic.Chris Lattner2008-08-192-5/+10
| | | | llvm-svn: 54977
* Remove GCSE, ValueNumbering, and LoadValueNumbering. These have been ↵Owen Anderson2008-08-152-816/+0
| | | | | | deprecated for almost a year; it's finally time for them to go away. llvm-svn: 54822
* Fix a bogus srem rule - a negative value srem'd by a power-of-2Dan Gohman2008-08-131-5/+3
| | | | | | | can have a non-negative result; for example, -16%16 is 0. Also, clarify the related comments. This fixes PR2670. llvm-svn: 54767
* Teach constant folding that an inttoptr of aDuncan Sands2008-08-131-0/+13
| | | | | | | ptrtoint can be turned into a bitcast if the integer is at least as wide as a pointer. llvm-svn: 54752
* Extend ScalarEvolution's executesAtLeastOnce logic to be able toDan Gohman2008-08-121-55/+57
| | | | | | | | 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. llvm-svn: 54697
* "This patch adds a virtual call to AbstractLatticeFunction to derive a Chris Lattner2008-08-091-1/+3
| | | | | | | | | type lattice value for an Argument*, giving clients the opportunity to use something other than Top for it if they choose to." Patch by John McCall! llvm-svn: 54589
* Canonicalize nested AddRecs in by nesting them in order of loop depth.Dan Gohman2008-08-081-0/+13
| | | | llvm-svn: 54545
* Don't call getAnalysisUsage unless -debug-pass is enabled. This speedsChris Lattner2008-08-082-8/+4
| | | | | | up the passmgr by avoiding useless work. llvm-svn: 54528
* PR2621: Improvements to the SCEV AddRec binomial expansion. This Eli Friedman2008-08-041-84/+111
| | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 54332
* Another SCEV issue from PR2607; essentially the same issue, but this Eli Friedman2008-07-301-4/+4
| | | | | | | | | | | 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. llvm-svn: 54194
* Fix for PR2607: SCEV miscomputing the loop count for loops with an Eli Friedman2008-07-301-3/+7
| | | | | | | | | | | | 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. llvm-svn: 54184
* Fix a subtle bug when removing instructions from memdep. In very specific Owen Anderson2008-07-281-0/+4
| | | | | | | | circumstances we could end up remapping a dependee to the same instruction that we're trying to remove. Handle this properly by just falling back to a conservative solution. llvm-svn: 54132
* Fix minor issues with VICmp/VFCmp constant expressionsNate Begeman2008-07-251-1/+3
| | | | llvm-svn: 54030
* Revert r53812 -- premature. LegalizeTypes isn't actually on yet!Nick Lewycky2008-07-211-8/+22
| | | | llvm-svn: 53816
* Switch on the use of arbitrary precision integers in scalar evolution. This willNick Lewycky2008-07-211-22/+8
| | | | | | | | | | bail after 256-bits to avoid producing code that the backends can't handle. Previously, we capped it at 64-bits, preferring to miscompile in those cases. This change also reverts much of r52248 because the invariants the code was expecting are now being met. llvm-svn: 53812
* This header isn't necessary now.Wojciech Matyjewicz2008-07-201-2/+0
| | | | llvm-svn: 53811
* Fix PR2088. Use modulo linear equation solver to compute loop iterationWojciech Matyjewicz2008-07-201-22/+71
| | | | | | count. llvm-svn: 53810
* Don't use ++idx_begin when I actually mean idx_begin + 1, especially since weMatthijs Kooijman2008-07-161-1/+1
| | | | | | | | also use *idx_begin in the same expression, giving unpredictable results. This fixes this bug: http://lists.cs.uiuc.edu/pipermail/llvmdev/2008-July/015877.html llvm-svn: 53670
* Correct this inversion!Nick Lewycky2008-07-151-1/+1
| | | | | | I swear that didn't show up in svn diff... llvm-svn: 53587
* Fix up comments.Nick Lewycky2008-07-151-5/+7
| | | | llvm-svn: 53586
* Stop creating extraneous smax/umax in SCEV. This removes a regression where weNick Lewycky2008-07-121-6/+79
| | | | | | started complicating many loops ('for' loops, in fact). llvm-svn: 53508
* Fix spelling of "hierarchy" in comments.Dan Gohman2008-07-111-1/+1
| | | | llvm-svn: 53489
* Use find instead of lower_bound.Dan Gohman2008-07-111-2/+2
| | | | llvm-svn: 53474
* Remove getValueRange from SCEV. It wasn't doing anything there anyways, and aNick Lewycky2008-07-091-31/+0
| | | | | | more complete version is now available from the LoopVR pass. llvm-svn: 53269
* Expand SCEVUDiv of power of 2 to a lshr instruction.Nick Lewycky2008-07-081-0/+14
| | | | llvm-svn: 53217
* Handle 'lshr' instruction with SCEVUDiv object.Nick Lewycky2008-07-071-2/+14
| | | | | | Comment the xor %x, -1 case. llvm-svn: 53167
* Keep track of inherited analysis (e.g. dominator tree).Devang Patel2008-07-031-0/+3
| | | | llvm-svn: 53088
* A better fix for PR2503 that doesn't pessimize GVN in the presence of ↵Owen Anderson2008-07-021-13/+0
| | | | | | unreachable blocks. llvm-svn: 53032
* Fix typos in comments. Devang Patel2008-07-011-1/+1
| | | | | | Thanks for the feedback! llvm-svn: 52978
* Add dom info verifier.Devang Patel2008-07-011-0/+3
| | | | llvm-svn: 52967
* Properly handle cases where a predecessor of the block being queried on is ↵Owen Anderson2008-07-011-0/+13
| | | | | | | | unreachable. This fixes PR2503, though we should also fix other passes not to emit this kind of code. llvm-svn: 52946
* - Re-apply 52748 and friends with fix. GetConstantStringInfo() returns an ↵Evan Cheng2008-06-301-0/+100
| | | | | | | | empty string for ConstantAggregateZero case which surprises selectiondag. - Correctly handle memcpy from constant string which is zero-initialized. llvm-svn: 52891
* Add a value range analysis that lazily computes ranges using ScalarEvolutions.Nick Lewycky2008-06-301-0/+289
| | | | llvm-svn: 52885
* Revert (52748 and friends):Anton Korobeynikov2008-06-291-100/+0
| | | | | | | | | | | | Move GetConstantStringInfo to lib/Analysis. Remove string output routine from Constant. Update all callers. Change debug intrinsic api slightly to accomodate move of routine, these now return values instead of strings. This unbreaks llvm-gcc bootstrap. llvm-svn: 52884
* Add back the capability to include nul characters in strings with Chris Lattner2008-06-281-5/+7
| | | | | | | GetConstantStringInfo. This will hopefully restore llvm-gcc to happy bootstrap land. llvm-svn: 52851
* Tighten up checking.Chris Lattner2008-06-281-4/+10
| | | | llvm-svn: 52850
* fix the regressions from Eric's patch by making GetConstantStringInfoChris Lattner2008-06-271-29/+34
| | | | | | | tolerate a non-nul-terminated string, and handling a direct global reference. llvm-svn: 52813
* Reserve the size we'll need in advance.Owen Anderson2008-06-261-0/+1
| | | | llvm-svn: 52763
* Move GetConstantStringInfo to lib/Analysis. RemoveEric Christopher2008-06-261-0/+86
| | | | | | | | | string output routine from Constant. Update all callers. Change debug intrinsic api slightly to accomodate move of routine, these now return values instead of strings. llvm-svn: 52748
* Generalize createSCEV to be able to form SCEV expressions fromDan Gohman2008-06-221-110/+117
| | | | | | ConstantExprs. llvm-svn: 52615
OpenPOWER on IntegriCloud