summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
* Add explicit keywords, and fix a minor typo that they uncovered.Dan Gohman2007-12-141-1/+1
| | | | llvm-svn: 45034
* Make these loops follow GetGEPOperands() behavior.Wojciech Matyjewicz2007-12-131-11/+13
| | | | | | | Let: %q = GEP %p, X, ... If %p is a GEP, we can chase baseptr further, only if X==0. llvm-svn: 44999
* Revert r44626, which turned off the use of readonlyDuncan Sands2007-12-121-12/+4
| | | | | | | | | | and readnone for functions with bodies because it broke llvm-gcc-4.2 bootstrap. It turns out that, because of LLVM's array_ref hack, gcc was computing pure/const attributes wrong (now fixed by turning off the gcc ipa-pure-const pass). llvm-svn: 44937
* Fix a bug in my previous patch, thanks to Jay Foad forChris Lattner2007-12-121-2/+2
| | | | | | pointing this out and correcting the patch! llvm-svn: 44907
* Changes from Curtis Dunham implementing lazy cycle detection algorithm.Daniel Berlin2007-12-121-125/+287
| | | | | | | Changes from me implementing different way of representing points-to anything. Changes from me that improve slightly on LCD. llvm-svn: 44895
* Implement constant folding if vector<->vector bitcasts where the numberChris Lattner2007-12-111-2/+122
| | | | | | | of source/dest elements changes. This implements test/Transforms/InstCombine/bitcast-vector-fold.ll llvm-svn: 44855
* Fix PR1850 by removing an unsafe transformation from VMCore/ConstantFold.cpp.Chris Lattner2007-12-102-21/+95
| | | | | | | | Reimplement the xform in Analysis/ConstantFolding.cpp where we can use targetdata to validate that it is safe. While I'm in there, fix some const correctness issues and generalize the interface to the "operand folder". llvm-svn: 44817
* Fix PR1782, patch by Wojtek Matyjewicz!Chris Lattner2007-12-091-4/+4
| | | | llvm-svn: 44733
* Fix several cache coherence bugs in MemDep/GVN that were found. Also add ↵Owen Anderson2007-12-081-23/+67
| | | | | | | | some (disabled) debugging code to make such problems easier to diagnose in the future, written by Duncan Sands. llvm-svn: 44695
* Commit 44487 broke bootstrap of llvm-gcc-4.2. It isDuncan Sands2007-12-051-4/+12
| | | | | | | not yet clear why, but in the meantime work around the problem by making less use of readnone/readonly info. llvm-svn: 44626
* Rather than having special rules like "intrinsics cannotDuncan Sands2007-12-033-42/+5
| | | | | | | | | throw exceptions", just mark intrinsics with the nounwind attribute. Likewise, mark intrinsics as readnone/readonly and get rid of special aliasing logic (which didn't use anything more than this anyway). llvm-svn: 44544
* Integrate the readonly/readnone logic more deeplyDuncan Sands2007-12-017-43/+58
| | | | | | | | | | | | | | | into alias analysis. This meant updating the API which now has versions of the getModRefBehavior, doesNotAccessMemory and onlyReadsMemory methods which take a callsite parameter. These should be used unless the callsite is not known, since in general they can do a better job than the versions that take a function. Also, users should no longer call the version of getModRefBehavior that takes both a function and a callsite. To reduce the chance of misuse it is now protected. llvm-svn: 44487
* chain update requests properly.Chris Lattner2007-11-301-0/+3
| | | | llvm-svn: 44460
* Add some convenience methods for querying attributes, andDuncan Sands2007-11-281-3/+2
| | | | | | use them. llvm-svn: 44403
* Fix PR1146: parameter attributes are longer part ofDuncan Sands2007-11-271-2/+2
| | | | | | | | | | | | the function type, instead they belong to functions and function calls. This is an updated and slightly corrected version of Reid Spencer's original patch. The only known problem is that auto-upgrading of bitcode files doesn't seem to work properly (see test/Bitcode/AutoUpgradeIntrinsics.ll). Hopefully a bitcode guru (who might that be? :) ) will fix it. llvm-svn: 44359
* Make LoopInfoBase more generic, in preparation for having MachineLoopInfo. ↵Owen Anderson2007-11-271-1/+1
| | | | | | This involves a small interface change. llvm-svn: 44348
* Fix a silly bug that Nicholas noticed.Owen Anderson2007-11-261-1/+2
| | | | llvm-svn: 44324
* Allow GVN to eliminate read-only function calls when it can detect that they ↵Owen Anderson2007-11-261-4/+5
| | | | | | are redundant. llvm-svn: 44323
* Add new SCEV, SCEVSMax. This allows LLVM to analyze do-while loops.Nick Lewycky2007-11-252-80/+140
| | | | llvm-svn: 44319
* simplify some code.Chris Lattner2007-11-231-5/+1
| | | | llvm-svn: 44295
* splice some lines together, no functionality change.Chris Lattner2007-11-231-11/+7
| | | | llvm-svn: 44292
* Ding dong, the DoesntAccessMemoryFns andDuncan Sands2007-11-231-113/+0
| | | | | | | | | OnlyReadsMemoryFns tables are dead! We get more, and more accurate, information from gcc via the readnone and readonly function attributes. llvm-svn: 44288
* Fix a bug where we'd try to find a scev value for a bitcast operand,Chris Lattner2007-11-231-0/+8
| | | | | | | even though the bitcast operand did not have integer type. This fixes PR1814. llvm-svn: 44286
* Teach alias analysis about readnone/readonly functions.Duncan Sands2007-11-221-0/+6
| | | | | | Based on a patch by Török Edwin. llvm-svn: 44279
* Instead of calculating constant factors, calculate the number of trailingNick Lewycky2007-11-221-54/+47
| | | | | | bits. Patch from Wojciech Matyjewicz. llvm-svn: 44268
* Create nodes for inline asm so that we don't crash looking for the node later.Nick Lewycky2007-11-221-0/+8
| | | | llvm-svn: 44267
* Small cleanup. Use APInt::getHighBitsSet method instead of shift left.Nick Lewycky2007-11-201-5/+4
| | | | | | "setcc" -> "icmp op" in comments. No functionality change. llvm-svn: 44249
* Be more careful when transforming | to +. Patch from Wojciech Matyjewicz.Nick Lewycky2007-11-201-6/+8
| | | | llvm-svn: 44248
* Fix for PR1801Tanya Lattner2007-11-161-0/+3
| | | | llvm-svn: 44193
* Reverted r44163 per requestAnton Korobeynikov2007-11-151-52/+4
| | | | llvm-svn: 44177
* Fix handling of overflow in loop calculation by adding new UDiv SCEV. This SCEVNick Lewycky2007-11-151-4/+51
| | | | | | | is disabled in the sense that it will refuse to create one from a UDiv instruction, until the code is better tested. llvm-svn: 44163
* More templatization.Owen Anderson2007-11-151-230/+1
| | | | llvm-svn: 44158
* Start the process of making MachineLoopInfo possible by templating Loop.Owen Anderson2007-11-141-396/+0
| | | | llvm-svn: 44097
* Fix PR1774 and BasicAA/2007-11-05-SizeCrash.llChris Lattner2007-11-061-7/+11
| | | | llvm-svn: 43756
* Executive summary: getTypeSize -> getTypeStoreSize / getABITypeSize.Duncan Sands2007-11-017-25/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The meaning of getTypeSize was not clear - clarifying it is important now that we have x86 long double and arbitrary precision integers. The issue with long double is that it requires 80 bits, and this is not a multiple of its alignment. This gives a primitive type for which getTypeSize differed from getABITypeSize. For arbitrary precision integers it is even worse: there is the minimum number of bits needed to hold the type (eg: 36 for an i36), the maximum number of bits that will be overwriten when storing the type (40 bits for i36) and the ABI size (i.e. the storage size rounded up to a multiple of the alignment; 64 bits for i36). This patch removes getTypeSize (not really - it is still there but deprecated to allow for a gradual transition). Instead there is: (1) getTypeSizeInBits - a number of bits that suffices to hold all values of the type. For a primitive type, this is the minimum number of bits. For an i36 this is 36 bits. For x86 long double it is 80. This corresponds to gcc's TYPE_PRECISION. (2) getTypeStoreSizeInBits - the maximum number of bits that is written when storing the type (or read when reading it). For an i36 this is 40 bits, for an x86 long double it is 80 bits. This is the size alias analysis is interested in (getTypeStoreSize returns the number of bytes). There doesn't seem to be anything corresponding to this in gcc. (3) getABITypeSizeInBits - this is getTypeStoreSizeInBits rounded up to a multiple of the alignment. For an i36 this is 64, for an x86 long double this is 96 or 128 depending on the OS. This is the spacing between consecutive elements when you form an array out of this type (getABITypeSize returns the number of bytes). This is TYPE_SIZE in gcc. Since successive elements in a SequentialType (arrays, pointers and vectors) need to be aligned, the spacing between them will be given by getABITypeSize. This means that the size of an array is the length times the getABITypeSize. It also means that GEP computations need to use getABITypeSize when computing offsets. Furthermore, if an alloca allocates several elements at once then these too need to be aligned, so the size of the alloca has to be the number of elements multiplied by getABITypeSize. Logically speaking this doesn't have to be the case when allocating just one element, but it is simpler to also use getABITypeSize in this case. So alloca's and mallocs should use getABITypeSize. Finally, since gcc's only notion of size is that given by getABITypeSize, if you want to output assembler etc the same as gcc then getABITypeSize is the size you want. Since a store will overwrite no more than getTypeStoreSize bytes, and a read will read no more than that many bytes, this is the notion of size appropriate for alias analysis calculations. In this patch I have corrected all type size uses except some of those in ScalarReplAggregates, lib/Codegen, lib/Target (the hard cases). I will get around to auditing these too at some point, but I could do with some help. Finally, I made one change which I think wise but others might consider pointless and suboptimal: in an unpacked struct the amount of space allocated for a field is now given by the ABI size rather than getTypeStoreSize. I did this because every other place that reserves memory for a type (eg: alloca) now uses getABITypeSize, and I didn't want to make an exception for unpacked structs, i.e. I did it to make things more uniform. This only effects structs containing long doubles and arbitrary precision integers. If someone wants to pack these types more tightly they can always use a packed struct. llvm-svn: 43620
* Add explicit keywords.Dan Gohman2007-10-291-1/+1
| | | | llvm-svn: 43464
* Make a comment better.Owen Anderson2007-10-261-1/+3
| | | | llvm-svn: 43379
* Silenced a VC++ warning.Hartmut Kaiser2007-10-251-1/+1
| | | | llvm-svn: 43374
* Fix for PR1741.Owen Anderson2007-10-251-2/+3
| | | | llvm-svn: 43326
* Make DomTree and PostDomTree thin wrappers around DomTreeBase, rather than ↵Owen Anderson2007-10-231-19/+1
| | | | | | inheriting from it. llvm-svn: 43259
* Move the SCEV object factors from being static members of the individualDan Gohman2007-10-222-177/+193
| | | | | | | SCEV subclasses to being non-static member functions of the ScalarEvolution class. llvm-svn: 43224
* Template DominatorTreeBase by node type. This is the next major step towardsOwen Anderson2007-10-161-1/+1
| | | | | | having dominator information on MBB's. llvm-svn: 43036
* Bindings for the verifier.Gordon Henriksen2007-10-061-0/+38
| | | | llvm-svn: 42707
* Completely merge the implementation details of DomTree and PostDomTree.Owen Anderson2007-10-032-101/+2
| | | | | | Also, add a FIXME for a bug in PostDomTree calculation I noticed while writing this, llvm-svn: 42593
* Use empty() member functions when that's what's being tested for insteadDan Gohman2007-10-032-3/+3
| | | | | | of comparing begin() and end(). llvm-svn: 42585
* Factor some code from the DomTree and PostDomTree calculate methods up into Owen Anderson2007-10-032-18/+23
| | | | | | each one's runOnFunction method. llvm-svn: 42563
* Rewrite sqrt and powi to use anyfloat. By popular demand.Dale Johannesen2007-10-021-12/+4
| | | | llvm-svn: 42537
* Template-ize more of the DomTree internal implementation details. Only the ↵Owen Anderson2007-09-301-3/+4
| | | | | | calculate() methods for DomTree and PostDomTree remain to be merged/template-ized. llvm-svn: 42476
* Add a new DenseSet abstraction.Chris Lattner2007-09-301-4/+4
| | | | llvm-svn: 42474
* Switch to densemap rather than std::setDaniel Berlin2007-09-291-3/+26
| | | | llvm-svn: 42462
OpenPOWER on IntegriCloud