diff options
| author | Sanjoy Das <sanjoy@playingwithpointers.com> | 2015-10-22 03:12:51 +0000 |
|---|---|---|
| committer | Sanjoy Das <sanjoy@playingwithpointers.com> | 2015-10-22 03:12:51 +0000 |
| commit | 769e7e2f7122dc29a4400b4d4acfde858ab9fa2c (patch) | |
| tree | 24b78574f29856ed4775a6ec621645aa4f225df6 /llvm/include | |
| parent | 98a341bc0cbc66a7f1456f834fea565541721087 (diff) | |
| download | bcm5719-llvm-769e7e2f7122dc29a4400b4d4acfde858ab9fa2c.tar.gz bcm5719-llvm-769e7e2f7122dc29a4400b4d4acfde858ab9fa2c.zip | |
[OperandBundles] Teach AliasAnalysis about operand bundles
Summary:
If a `CallSite` has operand bundles, then do not peek into the called
function to get a more precise `ModRef` answer.
This is tested using `argmemonly`, `-basicaa` and `-gvn`; but the
functionality is not specific to any of these.
Depends on D13961
Reviewers: reames, chandlerc
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D13962
llvm-svn: 250974
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/Analysis/AliasAnalysis.h | 8 | ||||
| -rw-r--r-- | llvm/include/llvm/IR/InstrTypes.h | 7 |
2 files changed, 11 insertions, 4 deletions
diff --git a/llvm/include/llvm/Analysis/AliasAnalysis.h b/llvm/include/llvm/Analysis/AliasAnalysis.h index 781ab25b391..2f4722fb964 100644 --- a/llvm/include/llvm/Analysis/AliasAnalysis.h +++ b/llvm/include/llvm/Analysis/AliasAnalysis.h @@ -759,8 +759,12 @@ public: } FunctionModRefBehavior getModRefBehavior(ImmutableCallSite CS) { - if (const Function *F = CS.getCalledFunction()) - return getBestAAResults().getModRefBehavior(F); + if (!CS.hasOperandBundles()) + // If CS has operand bundles then aliasing attributes from the function it + // calls do not directly apply to the CallSite. This can be made more + // precise in the future. + if (const Function *F = CS.getCalledFunction()) + return getBestAAResults().getModRefBehavior(F); return FMRB_UnknownModRefBehavior; } diff --git a/llvm/include/llvm/IR/InstrTypes.h b/llvm/include/llvm/IR/InstrTypes.h index 136a6c3f457..207b5b42d50 100644 --- a/llvm/include/llvm/IR/InstrTypes.h +++ b/llvm/include/llvm/IR/InstrTypes.h @@ -1255,8 +1255,8 @@ protected: /// \brief Is the function attribute S disallowed by some operand bundle on /// this operand bundle user? bool isFnAttrDisallowedByOpBundle(StringRef S) const { - // Operand bundles only possibly disallow readnone and readonly attributes. - // All String attributes are fine. + // Operand bundles only possibly disallow readnone, readonly and argmenonly + // attributes. All String attributes are fine. return false; } @@ -1267,6 +1267,9 @@ protected: default: return false; + case Attribute::ArgMemOnly: + return hasReadingOperandBundles(); + case Attribute::ReadNone: return hasReadingOperandBundles(); |

