aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
* minor simplificationGabor Greif2009-01-141-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62232 91177308-0d34-0410-b5e6-96231b3b80d8
* Wind SCEV back in time, to Nov 18th. This 'fixes' PR3275, PR3294, PR3295,Nick Lewycky2009-01-132-211/+41
| | | | | | | PR3296 and PR3302. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62160 91177308-0d34-0410-b5e6-96231b3b80d8
* Add classof() methods to support isa<> and other related facilities.Devang Patel2009-01-121-8/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62104 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename getABITypeSize to getTypePaddedSize, asDuncan Sands2009-01-123-3/+3
| | | | | | | suggested by Chris. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62099 91177308-0d34-0410-b5e6-96231b3b80d8
* make tblgen autogenerate the nocapture intrinsics for Chris Lattner2009-01-121-4/+0
| | | | | | | | llvm.memcpy/memset/memmove. This allows removal of some hackish code from basicaa. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62071 91177308-0d34-0410-b5e6-96231b3b80d8
* Removed trailing whitespace from Makefiles.Misha Brukman2009-01-092-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61991 91177308-0d34-0410-b5e6-96231b3b80d8
* ValueTracker can't assume that an alloca with no specified alignment Chris Lattner2009-01-081-1/+1
| | | | | | | | | | will get its preferred alignment. It has to be careful and cautiously assume it will just get the ABI alignment. This prevents instcombine from rounding up the alignment of a load/store without adjusting the alignment of the alloca. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61934 91177308-0d34-0410-b5e6-96231b3b80d8
* When checking if an Argument escapes, check ifDuncan Sands2009-01-051-7/+13
| | | | | | | | | the argument is marked nocapture - no need to analyze the argument if the answer is already known! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61753 91177308-0d34-0410-b5e6-96231b3b80d8
* Add classof() methods so that dwarf writer can decide what DIDescriptor is ↵Devang Patel2009-01-051-0/+5
| | | | | | in its hand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61740 91177308-0d34-0410-b5e6-96231b3b80d8
* Construct array/vector type DIEs using DebugInfo.Devang Patel2009-01-051-1/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61724 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy up #includes, deleting a bunch of unnecessary #includes.Dan Gohman2009-01-052-0/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61715 91177308-0d34-0410-b5e6-96231b3b80d8
* We know it's always a SCEVConstant if it gets here, so just cast it andNick Lewycky2009-01-031-6/+2
| | | | | | | inline the only use of isNegative. Fixes warning reported by Mike Stump. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61600 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't try to analyze this "backward" case. This is overly conservative Nick Lewycky2009-01-021-0/+12
| | | | | | | 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-18/+28
| | | | | | | 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-6/+17
| | | | | | | | | | | 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 dead comments.Evan Cheng2008-12-181-3/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61201 91177308-0d34-0410-b5e6-96231b3b80d8
* Today the front-ends (llvm-gcc and clang) generate multiple ↵Devang Patel2008-12-171-13/+39
| | | | | | | | | | llvm.dbg.compile_units to identify source file for various debug entities. Each llvm.dbg.compile_unit matches one file on the disk. However, the backend only supports one DW_TAG_compile_unit per .o file. The backend selects first compile_unit from the vector to construct DW_TAG_compile_unit entry, which is not correct in all cases. First step to resolve this is, record file name and directory directly in debug info for various debug entities. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61164 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporarily revert r61019, r61030, and r61040. These were breaking LLVM ReleaseBill Wendling2008-12-161-17/+6
| | | | | | | builds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61094 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: Added DbgInfoPrinter.cpp to lib/Analysis/CMakeFiles.txt.Oscar Fuentes2008-12-161-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61087 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -print-dbginfo pass that prints LLVM IR with comments inserted to showEdwin Török2008-12-161-0/+145
| | | | | | | | which source/line a certain BB/instruction comes from, original variable names, and original (unmangled) C++ name of functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61085 91177308-0d34-0410-b5e6-96231b3b80d8
* Add utility functions to search for DbgStopPointInst corresponding to anEdwin Török2008-12-161-0/+73
| | | | | | | | instruction or BasicBlock, and to search for DbgDeclareInst corresponding to a variable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61084 91177308-0d34-0410-b5e6-96231b3b80d8
* use different name for parameter to make it clear that we set DIDescriptor::GVEdwin Török2008-12-161-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61083 91177308-0d34-0410-b5e6-96231b3b80d8
* Generalize support for analyzing loops to include SLE/SGE loop exit conditionsNick Lewycky2008-12-161-24/+23
| | | | | | | 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
* fix PR3217: fully cached queries need to be verified against the Chris Lattner2008-12-161-1/+21
| | | | | | | | | visited set before they are used. If used, their blocks need to be added to the visited set so that subsequent queries don't use conflicting pointer values in the cache result blocks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61080 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach basicaa to use the nocapture attribute when possible. When theChris Lattner2008-12-151-6/+17
| | | | | | | | 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
* if we have a phi translation failure of the start block,Chris Lattner2008-12-151-0/+1
| | | | | | | | return *just* a clobber of the start block, not other random stuff as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61026 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement initial support for PHI translation in memdep. This means thatChris Lattner2008-12-151-39/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | memdep keeps track of how PHIs affect the pointer in dep queries, which allows it to eliminate the load in cases like rle-phi-translate.ll, which basically end up being: BB1: X = load P br BB3 BB2: Y = load Q br BB3 BB3: R = phi [P] [Q] load R turning "load R" into a phi of X/Y. In addition to additional exposed opportunities, this makes memdep safe in many cases that it wasn't before (which is required for load PRE) and also makes it substantially more efficient. For example, consider: bb1: // has many predecessors. P = some_operator() load P In this example, previously memdep would scan all the predecessors of BB1 to see if they had something that would mustalias P. In some cases (e.g. test/Transforms/GVN/rle-must-alias.ll) it would actually find them and end up eliminating something. In many other cases though, it would scan and not find anything useful. MemDep now stops at a block if the pointer is defined in that block and cannot be phi translated to predecessors. This causes it to miss the (rare) cases like rle-must-alias.ll, but makes it faster by not scanning tons of stuff that is unlikely to be useful. For example, this speeds up GVN as a whole from 3.928s to 2.448s (60%)!. IMO, scalar GVN should be enhanced to simplify the rle-must-alias pointer base anyway, which would allow the loads to be eliminated. In the future, this should be enhanced to phi translate through geps and bitcasts as well (as indicated by FIXMEs) making memdep even more powerful. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61022 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix whitespace in comment.Nick Lewycky2008-12-151-2/+1
| | | | | | | | Remove TODO; icmp isn't a binary operator, so this function will never deal with them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61020 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix getFieldAs() to use the parameter instead of 6.Edwin Török2008-12-131-0/+8
| | | | | | | Add missing DIType constructor, needed by DIVariable::getType(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60976 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert my re-instated reverted commit, fixes the bootstrap build on x86-64 ↵Nick Lewycky2008-12-121-15/+15
| | | | | | 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-111-15/+15
| | | | | | | 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
* Don't dereference the end() iterator. This wasDuncan Sands2008-12-101-2/+3
| | | | | | | | causing a bunch of failures when running "make ENABLE_EXPENSIVE_CHECKS=1 check". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60832 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow basicaa to walk through geps with identical indices in Chris Lattner2008-12-101-18/+32
| | | | | | | | | | | | | 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
* loosen up an assertion that isn't valid when called fromChris Lattner2008-12-091-1/+1
| | | | | | | | invalidateCachedPointerInfo. Thanks to Bill for sending me a testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60805 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach GVN to invalidate some memdep information when it does an RAUWChris Lattner2008-12-091-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | of a pointer. This allows is to catch more equivalencies. For example, the type_lists_compatible_p function used to require two iterations of the gvn pass (!) to delete its 18 redundant loads because the first pass would CSE all the addressing computation cruft, which would unblock the second memdep/gvn passes from recognizing them. This change allows memdep/gvn to catch all 18 when run just once on the function (as is typical :) instead of just 3. On all of 403.gcc, this bumps up the # reundandancies found from: 63 gvn - Number of instructions PRE'd 153991 gvn - Number of instructions deleted 50069 gvn - Number of loads deleted to: 63 gvn - Number of instructions PRE'd 154137 gvn - Number of instructions deleted 50185 gvn - Number of loads deleted +120 loads deleted isn't bad. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60799 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach BasicAA::getModRefInfo(CallSite, CallSite) someChris Lattner2008-12-092-21/+52
| | | | | | | | | | | | | | | | | | | | | | | tricks based on readnone/readonly functions. Teach memdep to look past readonly calls when analyzing deps for a readonly call. This allows elimination of a few more calls from 403.gcc: before: 63 gvn - Number of instructions PRE'd 153986 gvn - Number of instructions deleted 50069 gvn - Number of loads deleted after: 63 gvn - Number of instructions PRE'd 153991 gvn - Number of instructions deleted 50069 gvn - Number of loads deleted 5 calls isn't much, but this adds plumbing for the next change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60794 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a fixme: allow memdep to see past read-only calls when doingChris Lattner2008-12-091-4/+13
| | | | | | | | | | | | | | | load dependence queries. This allows GVN to eliminate a few more instructions on 403.gcc: 152598 gvn - Number of instructions deleted 49240 gvn - Number of loads deleted after: 153986 gvn - Number of instructions deleted 50069 gvn - Number of loads deleted git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60786 91177308-0d34-0410-b5e6-96231b3b80d8
* rename getNonLocalDependency -> getNonLocalCallDependency, and removeChris Lattner2008-12-091-48/+22
| | | | | | | pointer stuff from it, simplifying the code a bit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60783 91177308-0d34-0410-b5e6-96231b3b80d8
* Back out 60748 for now. It's breaking SPASS, 254.gap, and 464.h264ref.Evan Cheng2008-12-091-5/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60776 91177308-0d34-0410-b5e6-96231b3b80d8
* fix typos gabor noticedChris Lattner2008-12-091-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60754 91177308-0d34-0410-b5e6-96231b3b80d8
* restructure the top level non-local ptr dep query to handle Chris Lattner2008-12-091-19/+26
| | | | | | | | | the first block of a query specially. This makes the "complete query caching" subsystem more effective, avoiding predecessor queries. This speeds up GVN another 4%. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60752 91177308-0d34-0410-b5e6-96231b3b80d8
* rename getNonLocalPointerDepInternal -> getNonLocalPointerDepFromBBChris Lattner2008-12-091-65/+83
| | | | | | | | and split its inner loop out into a new GetNonLocalInfoForBlock function. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60751 91177308-0d34-0410-b5e6-96231b3b80d8
* It's easy to handle SLE/SGE when the loop has a unit stride.Nick Lewycky2008-12-091-1/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60748 91177308-0d34-0410-b5e6-96231b3b80d8
* if we have two elements, insert both, don't use std::sort.Chris Lattner2008-12-091-3/+16
| | | | | | | This speeds up the new GVN by another 3% git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60747 91177308-0d34-0410-b5e6-96231b3b80d8
* If we're only adding one new element to 'Cache', insert it into its knownChris Lattner2008-12-091-1/+12
| | | | | | | | position instead of using a full sort. This speeds up GVN by ~4% with the new memdep stuff. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60746 91177308-0d34-0410-b5e6-96231b3b80d8
* convert a couple other places that use pred_iterator to use the cachingChris Lattner2008-12-091-2/+4
| | | | | | | pred iterator. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60745 91177308-0d34-0410-b5e6-96231b3b80d8
* use hte new pred cache to speed up the new non-local memdepChris Lattner2008-12-091-4/+24
| | | | | | | | queries. This speeds up GVN using the new queries (not yet checked in) by just over 10%. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60743 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix comment typo.Duncan Sands2008-12-081-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60697 91177308-0d34-0410-b5e6-96231b3b80d8
* add another level of caching for non-local pointer queries, keepingChris Lattner2008-12-081-7/+32
| | | | | | | | | | | track of whether the CachedNonLocalPointerInfo for a block is specific to a block. If so, just return it without any pred scanning. This is good for a 6% speedup on GVN (when it uses this lookup method, which it doesn't right now). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60695 91177308-0d34-0410-b5e6-96231b3b80d8
* Some minor optimizations for isObjectSmallerThan.Chris Lattner2008-12-081-7/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60687 91177308-0d34-0410-b5e6-96231b3b80d8