summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/BasicAliasAnalysis.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Integrate the readonly/readnone logic more deeplyDuncan Sands2007-12-011-5/+0
| | | | | | | | | | | | | | | 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
* 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
* 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
* 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
* Fix for PR1801Tanya Lattner2007-11-161-0/+3
| | | | llvm-svn: 44193
* 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-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Make a comment better.Owen Anderson2007-10-261-1/+3
| | | | llvm-svn: 43379
* Fix for PR1741.Owen Anderson2007-10-251-2/+3
| | | | llvm-svn: 43326
* Add lengthof and endof templates that hide a lot of sizeof computations.Owen Anderson2007-09-071-5/+4
| | | | | | Patch by Sterling Stein! llvm-svn: 41758
* Missing break. Patch by Wojciech Matyjewicz.Evan Cheng2007-09-051-0/+1
| | | | llvm-svn: 41727
* This resolves a regression of BasicAA which failed to find any memory ↵Chandler Carruth2007-08-061-4/+23
| | | | | | information for overloaded intrinsics (PR1600). This resolves that issue, and improves the matching scheme to use a BitVector rather than a binary search. llvm-svn: 40872
* Upgrade BasicAliasAnalysis::getModRefBehavior to not call Value::getName,Chris Lattner2007-08-051-4/+14
| | | | | | | which dynamically allocates the string result. This speeds up dse on the testcase from PR1432 from 0.3781s to 0.1804s (2.1x). llvm-svn: 40838
* Implement review feedback.Christopher Lamb2007-08-021-4/+4
| | | | llvm-svn: 40745
* Teach BasicAA about noalias parameter attributes, but do it correctly this time.Christopher Lamb2007-08-021-1/+31
| | | | llvm-svn: 40711
* Revert overly aggressive interpretation of noaliasChristopher Lamb2007-07-311-32/+1
| | | | llvm-svn: 40635
* Teach BasicAA about noalias function parameters. Passes all of DejaGNU and ↵Christopher Lamb2007-07-311-1/+32
| | | | | | test-suite. llvm-svn: 40624
* Fix comments about vectors to use the current wording.Dan Gohman2007-07-161-1/+1
| | | | llvm-svn: 39921
* Add explicit keywords.Dan Gohman2007-07-021-1/+1
| | | | llvm-svn: 37839
* Make BasicAliasAnalysis correctly register itself. Patch by DevangAnton Korobeynikov2007-06-181-0/+2
| | | | llvm-svn: 37627
* Drop 'const'Devang Patel2007-05-031-4/+4
| | | | llvm-svn: 36662
* Use 'static const char' instead of 'static const int'.Devang Patel2007-05-021-4/+4
| | | | | | | Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. llvm-svn: 36652
* Do not use typeinfo to identify pass in pass manager.Devang Patel2007-05-011-0/+6
| | | | llvm-svn: 36632
* Make use of ConstantInt::isZero instead of ConstantInt::isNullValue.Zhou Sheng2007-04-191-1/+1
| | | | llvm-svn: 36261
* For PR1195:Reid Spencer2007-02-151-3/+3
| | | | | | | Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and PackedTyID -> VectorTyID. No functional changes. llvm-svn: 34293
* Switch some std::vector's to SmallVectors. This speeds up -load-vn -gcseChris Lattner2007-02-101-3/+5
| | | | | | by 6% on tramp3d. llvm-svn: 34167
* modify CheckGEPInstructions to take a pointer and size instead of a vector.Chris Lattner2007-02-101-23/+31
| | | | llvm-svn: 34166
* eliminate use of TargetData::getIndexedOffset that takes a vectorChris Lattner2007-02-101-5/+11
| | | | llvm-svn: 34163
* Make classes in anonymous namespaces use VISIBILITY_HIDDEN to help reduceReid Spencer2007-02-051-1/+1
| | | | | | LLVM's footprint and speed up linking. llvm-svn: 33941
* For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoidReid Spencer2007-01-301-1/+1
| | | | | | confusion with external linkage types. llvm-svn: 33663
* fit to 80 cols.Chris Lattner2007-01-141-8/+6
| | | | | | | | | Remove now-extraneous checks for ptr->ptr bitcasts. Fix PR1109 and Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll. We need to consider arbitrary sized objects when checking for nested GEP offsets. llvm-svn: 33195
* GEP operands can't be boolsChris Lattner2007-01-121-6/+3
| | | | llvm-svn: 33125
* Implement review feedback for the ConstantBool->ConstantInt merge. ChrisReid Spencer2007-01-121-1/+1
| | | | | | | | recommended that getBoolValue be replaced with getZExtValue and that get(bool) be replaced by get(const Type*, uint64_t). This implements those changes. llvm-svn: 33110
* Rename BoolTy as Int1Ty. Patch by Sheng Zhou.Reid Spencer2007-01-111-4/+4
| | | | llvm-svn: 33076
* For PR1043:Zhou Sheng2007-01-111-6/+9
| | | | | | | Merge ConstantIntegral and ConstantBool into ConstantInt. Remove ConstantIntegral and ConstantBool from LLVM. llvm-svn: 33073
* For PR950:Reid Spencer2006-12-311-20/+12
| | | | | | | | | | | | | This patch replaces signed integer types with signless ones: 1. [US]Byte -> Int8 2. [U]Short -> Int16 3. [U]Int -> Int32 4. [U]Long -> Int64. 5. Removal of isSigned, isUnsigned, getSignedVersion, getUnsignedVersion and other methods related to signedness. In a few places this warranted identifying the signedness information from other sources. llvm-svn: 32785
* For PR950:Reid Spencer2006-12-231-1/+2
| | | | | | | | This patch removes the SetCC instructions and replaces them with the ICmp and FCmp instructions. The SetCondInst instruction has been removed and been replaced with ICmpInst and FCmpInst. llvm-svn: 32751
* Replace inferred getCast(V,Ty) calls with more strict variants.Reid Spencer2006-12-121-4/+4
| | | | | | | Rename getZeroExtend and getSignExtend to getZExt and getSExt to match the the casting mnemonics in the rest of LLVM. llvm-svn: 32514
* Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, areBill Wendling2006-12-071-2/+2
| | | | | | now cerr, cout, and NullStream resp. llvm-svn: 32298
* Convert to using llvm streams instead of iostreams.Bill Wendling2006-11-281-1/+1
| | | | llvm-svn: 31989
* For PR950:Reid Spencer2006-11-271-31/+45
| | | | | | | | | | The long awaited CAST patch. This introduces 12 new instructions into LLVM to replace the cast instruction. Corresponding changes throughout LLVM are provided. This passes llvm-test, llvm/test, and SPEC CPUINT2000 with the exception of 175.vpr which fails only on a slight floating point output difference. llvm-svn: 31931
* remove redundant codeChris Lattner2006-11-131-2/+0
| | | | llvm-svn: 31697
* Fix BasicAA/2006-11-03-BasicAAVectorCrash.ll by handling out-of-rangeChris Lattner2006-11-031-8/+20
| | | | | | vector accesses like we handle out-of-range array accesses. llvm-svn: 31427
* For PR786:Reid Spencer2006-11-021-1/+1
| | | | | | | | | | Turn on -Wunused and -Wno-unused-parameter. Clean up most of the resulting fall out by removing unused variables. Remaining warnings have to do with unused functions (I didn't want to delete code without review) and unused variables in generated code. Maintainers should clean up the remaining issues when they see them. All changes pass DejaGnu tests and Olden. llvm-svn: 31380
* For PR950:Reid Spencer2006-10-201-8/+7
| | | | | | | | This patch implements the first increment for the Signless Types feature. All changes pertain to removing the ConstantSInt and ConstantUInt classes in favor of just using ConstantInt. llvm-svn: 31063
* Fix more static dtor issuesChris Lattner2006-10-041-14/+17
| | | | llvm-svn: 30725
* simplify AnalysisGroup registration, eliminating one typeid call.Chris Lattner2006-08-281-2/+2
| | | | llvm-svn: 29932
* eliminate RegisterOpt. It does the same thing as RegisterPass.Chris Lattner2006-08-271-2/+2
| | | | llvm-svn: 29925
* s|llvm/Support/Visibility.h|llvm/Support/Compiler.h|Chris Lattner2006-08-271-1/+1
| | | | llvm-svn: 29911
OpenPOWER on IntegriCloud