summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert r70876 and add a testcase (@c7) showing the problem:Duncan Sands2009-05-071-47/+30
| | | | | | | | | | | bits captured, but the pointer marked nocapture. In fact I now recall that this problem is why only readnone functions returning void were considered before! However keep a small fix that was also in r70876: a readnone function returning void can result in bits being captured if it unwinds, so test for this. llvm-svn: 71168
* Temporarily revert r71158. It was causing a failure during a full bootstrap:Bill Wendling2009-05-072-37/+35
| | | | | | | | | | | | | | | | | | | | | checking for bcopy... no checking for getc_unlocked... Assertion failed: (0 && "Unknown SCEV kind!"), function operator(), file /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore.roots/llvmCore~obj/src/lib/Analysis/ScalarEvolution.cpp, line 511. /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~obj/src/libdecnumber/decUtility.c:360: internal compiler error: Abort trap Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://developer.apple.com/bugreporter> for instructions. make[4]: *** [decUtility.o] Error 1 make[4]: *** Waiting for unfinished jobs.... Assertion failed: (0 && "Unknown SCEV kind!"), function operator(), file /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore.roots/llvmCore~obj/src/lib/Analysis/ScalarEvolution.cpp, line 511. /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~obj/src/libdecnumber/decNumber.c:5591: internal compiler error: Abort trap Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://developer.apple.com/bugreporter> for instructions. make[4]: *** [decNumber.o] Error 1 make[3]: *** [all-stage2-libdecnumber] Error 2 make[3]: *** Waiting for unfinished jobs.... llvm-svn: 71165
* Make ScalarEvolution's GroupByComplexity more thorough. In additionDan Gohman2009-05-071-9/+85
| | | | | | | | to sorting SCEVs by their kind, sort SCEVs of the same kind according to their operands. This helps avoid things like (a+b) being a distinct expression from (b+a). llvm-svn: 71160
* Trim unnecessary headers. Code in Analysis shouldn't use TransformsDan Gohman2009-05-071-3/+0
| | | | | | headers due to library dependencies. llvm-svn: 71159
* Constant-fold ptrtoint+add+inttoptr to gep when the pointer is anDan Gohman2009-05-071-4/+36
| | | | | | | array and the add is within range. This helps simplify expressions expanded by ScalarEvolutionExpander. llvm-svn: 71158
* Factor out a common base class between SCEVCommutativeExpr andDan Gohman2009-05-071-10/+1
| | | | | | | SCEVAddRecExpr. This eliminates redundant code for visiting all the operands of an expression. llvm-svn: 71157
* Use stable_sort instead of plain sort to avoid the risk of generatingDan Gohman2009-05-061-1/+1
| | | | | | | trivially different code on different hosts (due to differing std::sort implementations). llvm-svn: 71124
* Add dump method to DIDescriptor.Bill Wendling2009-05-051-1/+5
| | | | llvm-svn: 71028
* Do not require variable debug info nodes to have a compile unit.Chris Lattner2009-05-051-2/+1
| | | | | | | For implicit decls like "self" and "_cmd" in ObjC, these decls should not have a location. llvm-svn: 70964
* Re-apply 70645, converting ScalarEvolution to useDan Gohman2009-05-041-80/+114
| | | | | | | | | | | | CallbackVH, with fixes. allUsesReplacedWith need to walk the def-use chains and invalidate all users of a value that is replaced. SCEVs of users need to be recalcualted even if the new value is equivalent. Also, make forgetLoopPHIs walk def-use chains, since any SCEV that depends on a PHI should be recalculated when more information about that PHI becomes available. llvm-svn: 70927
* Fix an 80-column violation.Dan Gohman2009-05-041-1/+2
| | | | llvm-svn: 70925
* Fix doxygen comment syntax.Dan Gohman2009-05-041-1/+1
| | | | llvm-svn: 70924
* Constify a bunch of SCEV-using code.Dan Gohman2009-05-041-59/+61
| | | | llvm-svn: 70919
* Teach capture tracking that readonly functions canDuncan Sands2009-05-041-28/+47
| | | | | | | | only capture their arguments by returning them or throwing an exception or not based on the argument value. Patch essentially by Frits van Bommel. llvm-svn: 70876
* -Move the DwarfWriter::ValidDebugInfo check to a static ↵Argyrios Kyrtzidis2009-05-031-0/+44
| | | | | | | | DIDescriptor::ValidDebugInfo -Create DebugLocs without the need to have a DwarfWriter around llvm-svn: 70682
* Revert r70645 for now; it's causing a variety of regressions.Dan Gohman2009-05-031-25/+33
| | | | llvm-svn: 70661
* Convert ScalarEvolution to use CallbackVH for its internal map. ThisDan Gohman2009-05-021-33/+25
| | | | | | | | | makes ScalarEvolution::deleteValueFromRecords, and it's code that subtly needed to be called before ReplaceAllUsesWith, unnecessary. It also makes ValueDeletionListener unnecessary. llvm-svn: 70645
* When ScalarEvolution is told to forget the trip count for a loop, haveDan Gohman2009-05-021-3/+11
| | | | | | | it also forget any SCEVs associated with loop-header PHIs in the loop, as they may be dependent on trip count information. llvm-svn: 70633
* Change the description string of the LoopInfo pass.Dan Gohman2009-05-011-1/+1
| | | | | | | "Construction" makes it sound like a pass that might modify the CFG to construct natural loops. llvm-svn: 70580
* Actually insert inserted instructions into the InsertedValues map.Dan Gohman2009-05-011-11/+33
| | | | llvm-svn: 70557
* When printing a SCEVUnknown with pointer type, don't print anDan Gohman2009-05-011-4/+0
| | | | | | | | artificial "ptrtoint", as it tends to clutter up complicated expressions. The cast operators now print both source and destination types, which is usually sufficient. llvm-svn: 70554
* Short-circuit inttoptr-ptrtoint constant expressions; these aren'tDan Gohman2009-05-011-1/+8
| | | | | | | always folded by the regular constant folder because it doesn't have TargetData information. llvm-svn: 70553
* Fix an 80-column violation.Dan Gohman2009-05-011-1/+2
| | | | llvm-svn: 70550
* When creating cast scevs, canonicalize the destination type. ThisDan Gohman2009-05-011-0/+9
| | | | | | avoids duplicate scevs that differ only in type. llvm-svn: 70549
* hasSCEV() was declared in ScalarEvolution.h, but never defined. This must haveTorok Edwin2009-05-011-0/+6
| | | | | | gone lost during the pImpl conversion. llvm-svn: 70536
* Add some comments, and tidy up some whitespace.Dan Gohman2009-04-301-5/+7
| | | | llvm-svn: 70510
* Extend ScalarEvolution's getBackedgeTakenCount to be able toDan Gohman2009-04-301-65/+127
| | | | | | | | | | | | 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. llvm-svn: 70509
* Don't try to mix integers and pointers in an icmp instructionDan Gohman2009-04-301-12/+19
| | | | | | in getSCEVAtScope. llvm-svn: 70495
* Fix ScalarEvolution::print to print a value for any Instruction withDan Gohman2009-04-301-1/+1
| | | | | | a SCEVable type, not just integer types. llvm-svn: 70463
* Implement getSCEVAtScope for SCEV cast expressions.Dan Gohman2009-04-291-2/+25
| | | | llvm-svn: 70422
* Generalize the cast-of-addrec folding to handle folding of SCEVs likeDan Gohman2009-04-291-46/+33
| | | | | | | | (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. llvm-svn: 70421
* Include the source type in SCEV cast expression debug output, andDan Gohman2009-04-291-3/+3
| | | | | | | print sext, zext, and trunc, instead of signextend, zeroextend, and truncate, respectively, for consistency with the main IR. llvm-svn: 70405
* Fix recent regression in gcc.dg/pr26719.c (6835035).Dale Johannesen2009-04-291-2/+5
| | | | llvm-svn: 70386
* Update comments to reflect the current code.Dan Gohman2009-04-291-4/+4
| | | | llvm-svn: 70357
* Teach getZeroExtendExpr and getSignExtendExpr to use trip-countDan Gohman2009-04-271-9/+133
| | | | | | | | | | | | | | | | | information to simplify [sz]ext({a,+,b}) to {zext(a),+,[zs]ext(b)}, as appropriate. These functions and the trip count code each call into the other, so this requires careful handling to avoid infinite recursion. During the initial trip count computation, conservative SCEVs are used, which are subsequently discarded once the trip count is actually known. Among other benefits, this change lets LSR automatically eliminate some unnecessary zext-inreg and sext-inreg operation where the operand is an induction variable. llvm-svn: 70241
* Handle ands with ~0 correctly too. This fixes PR4052.Dan Gohman2009-04-271-0/+2
| | | | llvm-svn: 70176
* Handle ands with 0 and shifts by 0 correctly. These aren'tDan Gohman2009-04-251-2/+9
| | | | | | common, but indvars shouldn't crash on them. This fixes PR4054. llvm-svn: 70051
* Change SCEVExpander's expandCodeFor to provide more flexibilityDan Gohman2009-04-231-3/+1
| | | | | | | | | | | with the persistent insertion point, and change IndVars to make use of it. This fixes a bug where IndVars was holding on to a stale insertion point and forcing the SCEVExpander to continue to use it. This fixes PR4038. llvm-svn: 69892
* Simplify trunc(extend(x)) in SCEVs, just for completeness. Also fix some oddNick Lewycky2009-04-231-4/+12
| | | | | | whitespace in the same file. llvm-svn: 69870
* Fix cut-n-pasto.Devang Patel2009-04-221-2/+2
| | | | llvm-svn: 69816
* Simplify trivial cast-of-cast SCEVs.Dan Gohman2009-04-221-0/+12
| | | | llvm-svn: 69809
* SCEVExpander's InsertCastOfTo knows how to move existing castDan Gohman2009-04-221-0/+5
| | | | | | | | | | | instructions in order to avoid inserting new ones. However, if the cast instruction is the SCEVExpander's InsertPt, this causes subsequently emitted instructions to be inserted near the cast, and not at the location of the original insert point. Fix this by adjusting the insert point in such cases. This fixes PR4009. llvm-svn: 69808
* Use BasicBlock::iterator instead of Instruction* for insert points,Dan Gohman2009-04-221-7/+7
| | | | | | to better handle inserting instructions at the end of a block. llvm-svn: 69807
* De-pImpl-ify ScalarEvolution. The pImpl pattern doesn't provide muchDan Gohman2009-04-211-452/+165
| | | | | | | practical benefit in the case of ScalarEvolution, and it's otherwise a nuisance. llvm-svn: 69749
* When turning (ashr(shl(x, n), n)) into sext(trunc(x)), the width of theDan Gohman2009-04-211-1/+1
| | | | | | | | 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. llvm-svn: 69704
* Teach ScalarEvolution how to recognize zext-inreg and sext-inreg,Dan Gohman2009-04-211-0/+27
| | | | | | | as they appear in LLVM IR. This isn't particularly interesting on its own; this is just setting up some infrastructure. llvm-svn: 69655
* This FIXME is fixed, now that SCEV understands pointers.Dan Gohman2009-04-211-3/+0
| | | | llvm-svn: 69651
* Factor out a common base class from SCEVTruncateExpr, SCEVZeroExtendExpr,Dan Gohman2009-04-211-15/+13
| | | | | | and SCEVSignExtendExpr. llvm-svn: 69649
* Usage getAnalysisToUpdate for TargetData, per PR760.Dan Gohman2009-04-211-2/+1
| | | | llvm-svn: 69645
* Introduce encapsulation for ScalarEvolution's TargetData object, and refactorDan Gohman2009-04-212-118/+171
| | | | | | the code to minimize dependencies on TargetData. llvm-svn: 69644
OpenPOWER on IntegriCloud