From 2577580967ba31ab6ae30307bcb1b4b1395d0f4f Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 10 Nov 2010 17:34:04 +0000 Subject: Factor out the code for testing whether a function accesses arbitrary memory into a helper function, and adjust some comments. llvm-svn: 118687 --- llvm/lib/Transforms/IPO/FunctionAttrs.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Transforms/IPO/FunctionAttrs.cpp') diff --git a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp index 3b1b13d378f..2e3440066e6 100644 --- a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp +++ b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp @@ -131,9 +131,8 @@ bool FunctionAttrs::AddReadAttrs(const CallGraphSCC &SCC) { AliasAnalysis::ModRefBehavior MRB = AA->getModRefBehavior(CS); // If the call doesn't access arbitrary memory, we may be able to // figure out something. - if (!(MRB & AliasAnalysis::Anywhere & - ~AliasAnalysis::ArgumentPointees)) { - // If the call accesses argument pointees, check each argument. + if (AliasAnalysis::onlyAccessesArgPointees(MRB)) { + // If the call does access argument pointees, check each argument. if (MRB & AliasAnalysis::AccessesArguments) // Check whether all pointer arguments point to local memory, and // ignore calls that only access local memory. -- cgit v1.2.3