diff options
author | Chris Lattner <sabre@nondot.org> | 2011-05-23 05:15:43 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-05-23 05:15:43 +0000 |
commit | 026f5e61f08de77d911807f2bcdcda1823eb3dbb (patch) | |
tree | 342f6abe17423eb39728c3f0467b2f00e9a2f391 /llvm/lib/Analysis/BasicAliasAnalysis.cpp | |
parent | efb1af9ae83fc28702b3b946fa05b3960f689d5c (diff) | |
download | bcm5719-llvm-026f5e61f08de77d911807f2bcdcda1823eb3dbb.tar.gz bcm5719-llvm-026f5e61f08de77d911807f2bcdcda1823eb3dbb.zip |
fix a really nasty basicaa mod/ref calculation bug that was causing miscompilation of
UnitTests/ObjC/messages-2.m with the recent optimizer improvements.
llvm-svn: 131897
Diffstat (limited to 'llvm/lib/Analysis/BasicAliasAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/BasicAliasAnalysis.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp index f1bb8a38f09..989d8e0e82d 100644 --- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp +++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp @@ -680,9 +680,12 @@ BasicAliasAnalysis::getModRefInfo(ImmutableCallSite CS, unsigned ArgNo = 0; for (ImmutableCallSite::arg_iterator CI = CS.arg_begin(), CE = CS.arg_end(); CI != CE; ++CI, ++ArgNo) { - // Only look at the no-capture pointer arguments. + // Only look at the no-capture or byval pointer arguments. If this + // pointer were passed to arguments that were neither of these, then it + // couldn't be no-capture. if (!(*CI)->getType()->isPointerTy() || - !CS.paramHasAttr(ArgNo+1, Attribute::NoCapture)) + (!CS.paramHasAttr(ArgNo+1, Attribute::NoCapture) && + !CS.paramHasAttr(ArgNo+1, Attribute::ByVal))) continue; // If this is a no-capture pointer argument, see if we can tell that it |