summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Move some assertion checks so they can do more complete checking.Dan Gohman2009-04-211-6/+8
| | | | llvm-svn: 69643
* Convert ScalarEvolution to use raw_ostream instead of OStream.Dan Gohman2009-04-211-22/+32
| | | | llvm-svn: 69640
* Add a ScalarEvolution::getCouldNotCompute() function, and use itDan Gohman2009-04-181-12/+21
| | | | | | instead of allocating and leaking new SCEVCouldNotCompute objects. llvm-svn: 69452
* More const qualifiers.Dan Gohman2009-04-181-14/+14
| | | | llvm-svn: 69451
* Use more const qualifiers with SCEV interfaces.Dan Gohman2009-04-181-12/+12
| | | | llvm-svn: 69450
* Handle a pointer type correctly in SCEVExpander::visitAddRecExpr.Dan Gohman2009-04-161-0/+2
| | | | llvm-svn: 69310
* Fix a bug with inttoptr/ptrtoint casts where the pointer has a differentDan Gohman2009-04-162-5/+12
| | | | | | | | size from the integer, requiring zero extension or truncation. Don't create ZExtInsts with pointer types. This fixes a regression in consumer-jpeg. llvm-svn: 69307
* Fix SCEVExpander::visitSMaxExpr and SCEVExpander::visitUMaxExpr toDan Gohman2009-04-161-0/+8
| | | | | | | not create ICmpInsts with operands of different types. This fixes a regression in Applications/d/make_dparser. llvm-svn: 69294
* Teach SCEVExpander::InsertCastOfTo to avoid creating inttoptr-of-ptrtointDan Gohman2009-04-161-0/+8
| | | | | | and ptrtoint-of-inttoptr expressions. This fixes a regression in 300.twolf. llvm-svn: 69293
* Expand GEPs in ScalarEvolution expressions. SCEV expressions can nowDan Gohman2009-04-162-134/+330
| | | | | | | | | | | | | | | | | | | | | have pointer types, though in contrast to C pointer types, SCEV addition is never implicitly scaled. This not only eliminates the need for special code like IndVars' EliminatePointerRecurrence and LSR's own GEP expansion code, it also does a better job because it lets the normal optimizations handle pointer expressions just like integer expressions. Also, since LLVM IR GEPs can't directly index into multi-dimensional VLAs, moving the GEP analysis out of client code and into the SCEV framework makes it easier for clients to handle multi-dimensional VLAs the same way as other arrays. Some existing regression tests show improved optimization. test/CodeGen/ARM/2007-03-13-InstrSched.ll in particular improved to the point where if-conversion started kicking in; I turned it off for this test to preserve the intent of the test. llvm-svn: 69258
* Add a method to check that the subprogram holds debug info for the given ↵Devang Patel2009-04-151-0/+13
| | | | | | Function or not. llvm-svn: 69113
* use higher level APIs.Chris Lattner2009-04-031-8/+6
| | | | llvm-svn: 68351
* getEntryFor() may invalidate DenseMap iterator.Devang Patel2009-03-301-0/+1
| | | | | | Walking an invalidated iterator is not a good idea. llvm-svn: 68047
* now that you can put a PointerIntPair in a SmallPtrSet, remove someChris Lattner2009-03-291-17/+15
| | | | | | hackish workarounds from memdep llvm-svn: 67971
* Before deleting a basic block, give other loop passes a chance cleanup ↵Devang Patel2009-03-251-0/+7
| | | | | | analysis values, related to the instructions in the basic block. llvm-svn: 67719
* Do not ignore DW_TAG_class_type!Devang Patel2009-03-251-0/+1
| | | | llvm-svn: 67675
* simplify logic and get rid of the assumption that operand 0 is the calleeGabor Greif2009-03-241-3/+3
| | | | llvm-svn: 67642
* LoopVR is not CFGOnly.Dan Gohman2009-03-231-1/+1
| | | | llvm-svn: 67524
* Enhance LiveValues to work on PHI operands.Dan Gohman2009-03-231-13/+24
| | | | llvm-svn: 67523
* The last use in a block that doesn't have successorsDan Gohman2009-03-201-0/+5
| | | | | | (return or unreachable) is a kill. llvm-svn: 67357
* Fix the Win32 VS2008 build:Sebastian Redl2009-03-191-0/+1
| | | | | | | | | | - Make type declarations match the struct/class keyword of the definition. - Move AddSignalHandler into the namespace where it belongs. - Correctly call functions from template base. - Some other small changes. With this patch, LLVM and Clang should build properly and with far less noise under VS2008. llvm-svn: 67347
* Clear the cached cost when removing a function inDale Johannesen2009-03-191-1/+2
| | | | | | | | | the inliner; prevents nondeterministic behavior when the same address is reallocated. Don't build call graph nodes for debug intrinsic calls; they're useless, and there were typically a lot of them. llvm-svn: 67311
* Add a liveness analysis pass for LLVM IR values. This computesDan Gohman2009-03-191-0/+177
| | | | | | | | | the set of blocks in which values are used, the set in which values are live-through, and the set in which values are killed. For the live-through and killed sets, conservative approximations are used. llvm-svn: 67309
* Revert r66920. It was causing failures in the self-hosting buildbot (in releaseBill Wendling2009-03-132-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mode). Running /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/dg.exp ... FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll Failed with signal(SIGBUS) at line 1 while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll -bugpoint-crashcalls -silence-passes > /dev/null 0 bugpoint 0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85 1 bugpoint 0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706 2 libSystem.B.dylib 0x92f112bb _sigtramp + 43 3 libSystem.B.dylib 0xffffffff _sigtramp + 1829694831 4 bugpoint 0x00021d1c main + 92 5 bugpoint 0x00002106 start + 54 6 bugpoint 0x00000004 start + 18446744073709543220 Stack dump: 0. Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll -bugpoint-crashcalls -silence-passes FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll Failed with signal(SIGBUS) at line 1 while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll -dce -bugpoint-deletecalls -simplifycfg -silence-passes 0 bugpoint 0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85 1 bugpoint 0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706 2 libSystem.B.dylib 0x92f112bb _sigtramp + 43 3 libSystem.B.dylib 0xffffffff _sigtramp + 1829694831 4 bugpoint 0x00021d1c main + 92 5 bugpoint 0x00002106 start + 54 6 bugpoint 0x00000006 start + 18446744073709543222 Stack dump: 0. Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll -dce -bugpoint-deletecalls -simplifycfg -silence-passes FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll Failed with signal(SIGBUS) at line 1 while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll -bugpoint-crashcalls -silence-passes 0 bugpoint 0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85 1 bugpoint 0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706 2 libSystem.B.dylib 0x92f112bb _sigtramp + 43 3 libSystem.B.dylib 0xffffffff _sigtramp + 1829694831 4 bugpoint 0x00021d1c main + 92 5 bugpoint 0x00002106 start + 54 Stack dump: 0. Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll -bugpoint-crashcalls -silence-passes --- Reverse-merging (from foreign repository) r66920 into '.': U include/llvm/Support/CallSite.h U include/llvm/Instructions.h U lib/Analysis/IPA/GlobalsModRef.cpp U lib/Analysis/IPA/Andersens.cpp U lib/Bitcode/Writer/BitcodeWriter.cpp U lib/VMCore/Instructions.cpp U lib/VMCore/Verifier.cpp U lib/VMCore/AsmWriter.cpp U lib/Transforms/Utils/LowerInvoke.cpp U lib/Transforms/Scalar/SimplifyCFGPass.cpp U lib/Transforms/IPO/PruneEH.cpp U lib/Transforms/IPO/DeadArgumentElimination.cpp llvm-svn: 66953
* Second installment of "BasicBlock operands to the back"Gabor Greif2009-03-132-2/+2
| | | | | | | | | | | | | | | | | | changes. For InvokeInst now all arguments begin at op_begin(). The Callee, Cont and Fail are now faster to get by access relative to op_end(). This patch introduces some temporary uglyness in CallSite. Next I'll bring CallInst up to a similar scheme and then the uglyness will magically vanish. This patch also exposes all the reliance of the libraries on InvokeInst's operand ordering. I am thinking of taking care of that too. llvm-svn: 66920
* Oops...I committed too much.Bill Wendling2009-03-133-142/+101
| | | | llvm-svn: 66867
* Temporarily XFAIL this test.Bill Wendling2009-03-133-101/+142
| | | | llvm-svn: 66866
* Debug intriniscs should be skipped when lookingDale Johannesen2009-03-111-1/+1
| | | | | | for a dependency, not terminate the search. llvm-svn: 66709
* Make Print callable from a pass's print method: add const qualifier. NoTorok Edwin2009-03-111-1/+1
| | | | | | functionality change. llvm-svn: 66700
OpenPOWER on IntegriCloud