summaryrefslogtreecommitdiff
path: root/lib/Analysis
Commit message (Collapse)AuthorAge
* Teach AliasAnalysis that a bunch of the atomic intrinsics only dereference ↵Owen Anderson2009-02-03
| | | | | | their arguments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63616 91177308-0d34-0410-b5e6-96231b3b80d8
* Move isIdentifiedObject and isNoAliasCall into AliasAnalysis.cpp sinceDan Gohman2009-02-03
| | | | | | | | | they are useful to analyses other than BasicAliasAnalysis.cpp. Include the full comment for isIdentifiedObject in the header file. Thanks to Chris for suggeseting this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63589 91177308-0d34-0410-b5e6-96231b3b80d8
* Each input file is encoded as a separate compile unit in LLVM debuggingDevang Patel2009-01-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | information output. However, many target specific tool chains prefer to encode only one compile unit in an object file. In this situation, the LLVM code generator will include debugging information entities in the compile unit that is marked as main compile unit. The code generator accepts maximum one main compile unit per module. If a module does not contain any main compile unit then the code generator will emit multiple compile units in the output object file. [Part 1] Update DebugInfo APIs to accept optional boolean value while creating DICompileUnit to mark the unit as "main" unit. By defaults all units are considered non-main. Update SourceLevelDebugging.html to document "main" compile unit. Update DebugInfo APIs to not accept and encode separate source file/directory entries while creating various llvm.dbg.* entities. There was a recent, yet to be documented, change to include this additional information so no documentation changes are required here. Update DwarfDebug to handle "main" compile unit. If "main" compile unit is seen then all DIEs are inserted into "main" compile unit. All other compile units are used to find source location for llvm.dbg.* values. If there is not any "main" compile unit then create unique compile unit DIEs for each llvm.dbg.compile_unit. [Part 2] Create separate llvm.dbg.compile_unit for each input file. Mark compile unit create for main_input_filename as "main" compile unit. Use appropriate compile unit, based on source location information collected from the tree node, while creating llvm.dbg.* values using DebugInfo APIs. --- This is Part 1. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63400 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a post-RA scheduling dependency bug.Dan Gohman2009-01-30
| | | | | | | | | | | | | | | | If a MachineInstr doesn't have a memoperand but has an opcode that is known to load or store, assume its memory reference may alias *anything*, including stack slots which the compiler completely controls. To partially compensate for this, teach the ScheduleDAG building code to do basic getUnderlyingValue analysis. This greatly reduces the number of instructions that require restrictive dependencies. This code will need to be revisited when we start doing real alias analysis, but it should suffice for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63370 91177308-0d34-0410-b5e6-96231b3b80d8
* Add dump() routines to help debug debug info :)Devang Patel2009-01-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63353 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR3415 (infinite loop in EscapeAnalysis) byDuncan Sands2009-01-28
| | | | | | | deleting the escape analysis pass. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63197 91177308-0d34-0410-b5e6-96231b3b80d8
* Start generating arbitrary precision integer SCEVs. This removes the temporaryNick Lewycky2009-01-25
| | | | | | | code that rounded up and capped the size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62958 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce two DWARF attribute extentions DW_AT_APPLE_optimized, ↵Devang Patel2009-01-23
| | | | | | | | | | | | | DW_AT_APPLE_flags. DW_AT_APPLE_optimized flag is set when a compile_unit is optimized. The debugger takes advantage of this information some way. DW_AT_APPLE_flags encodes command line options when certain env. variable is set. This is used by build engineers to track various gcc command lines used by by a project, irrespective of whether the project used makefile, Xcode or something else. llvm-gcc patch is next. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62888 91177308-0d34-0410-b5e6-96231b3b80d8
* fix two more cases where we could let the NLPDI cache get unsorted.Chris Lattner2009-01-23
| | | | | | | With this, sqlite3 now passes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62839 91177308-0d34-0410-b5e6-96231b3b80d8
* Unconditionally reset 'cache' to zero, even if we don't need to resort it.Chris Lattner2009-01-23
| | | | | | | | | | This avoids using a dangling pointer. Reset NumSortedEntries after restoring Cache to avoid extraneous sorts. This fixes the reduced sqlite3 testcase, but apparently not the whole app. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62838 91177308-0d34-0410-b5e6-96231b3b80d8
* a minor tweak to my previous patch, handle the invalidation caseChris Lattner2009-01-23
| | | | | | | when there are multiple iterations of the loop. This fixes PR3375. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62822 91177308-0d34-0410-b5e6-96231b3b80d8
* introduce a useful abstraction to find out if a Use is in the call position ↵Gabor Greif2009-01-22
| | | | | | of an instruction git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62788 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR3358, a really nasty bug where recursive phi translated Chris Lattner2009-01-22
| | | | | | | | | analyses could be run without the caches properly sorted. This can fix all sorts of weirdness. Many thanks to Bill for coming up with the 'issorted' verification idea. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62757 91177308-0d34-0410-b5e6-96231b3b80d8
* Need only one set of debug info versions enum.Devang Patel2009-01-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62602 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate use of uint32_t to improve compatibility with cygwinChris Lattner2009-01-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62590 91177308-0d34-0410-b5e6-96231b3b80d8
* Verify debug info.Devang Patel2009-01-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62545 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: Add lib/Analysis/CaptureTracking.cppOscar Fuentes2009-01-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62462 91177308-0d34-0410-b5e6-96231b3b80d8
* BasicAliasAnalysis and FunctionAttrs were bothDuncan Sands2009-01-18
| | | | | | | | | | doing very similar pointer capture analysis. Factor out the common logic. The new version is from FunctionAttrs since it does a better job than the version in BasicAliasAnalysis git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62461 91177308-0d34-0410-b5e6-96231b3b80d8
* add a commentGabor Greif2009-01-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62436 91177308-0d34-0410-b5e6-96231b3b80d8
* switch over some other methods from indices to iteratorsGabor Greif2009-01-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62430 91177308-0d34-0410-b5e6-96231b3b80d8
* speed up iterative loop by using iterators. changes direction, but ↵Gabor Greif2009-01-17
| | | | | | | | functionally equivalent if this works out, I'll change the others next. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62385 91177308-0d34-0410-b5e6-96231b3b80d8
* Reinstate r60509 from Dale:Nick Lewycky2009-01-16
| | | | | | | Make the debugging dump be a full line. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62325 91177308-0d34-0410-b5e6-96231b3b80d8
* Add the private linkage.Rafael Espindola2009-01-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62279 91177308-0d34-0410-b5e6-96231b3b80d8
* minor simplificationGabor Greif2009-01-14
| | | | 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-13
| | | | | | | 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-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62104 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename getABITypeSize to getTypePaddedSize, asDuncan Sands2009-01-12
| | | | | | | 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-12
| | | | | | | | 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-09
| | | | 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-08
| | | | | | | | | | 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-05
| | | | | | | | | 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-05
| | | | | | 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-05
| | | | 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-05
| | | | 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-03
| | | | | | | 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-02
| | | | | | | 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-27
| | | | | | | 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-19
| | | | | | | | | | | 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-18
| | | | 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-17
| | | | | | | | | | 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-16
| | | | | | | 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-16
| | | | 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 showTorok Edwin2008-12-16
| | | | | | | | 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 anTorok Edwin2008-12-16
| | | | | | | | 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::GVTorok Edwin2008-12-16
| | | | 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-16
| | | | | | | 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-16
| | | | | | | | | 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-15
| | | | | | | | 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-15
| | | | | | | | 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-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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