From e30b36fe37c2fb0659cf71c3f223806fedfa9474 Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Thu, 11 Sep 2008 15:43:12 +0000 Subject: Intrinsics don't read these kinds of global variables. llvm-svn: 56105 --- llvm/lib/Analysis/IPA/GlobalsModRef.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'llvm/lib/Analysis/IPA/GlobalsModRef.cpp') diff --git a/llvm/lib/Analysis/IPA/GlobalsModRef.cpp b/llvm/lib/Analysis/IPA/GlobalsModRef.cpp index 70680bfed73..6063a1d16b7 100644 --- a/llvm/lib/Analysis/IPA/GlobalsModRef.cpp +++ b/llvm/lib/Analysis/IPA/GlobalsModRef.cpp @@ -384,11 +384,13 @@ void GlobalsModRef::AnalyzeCallGraph(CallGraph &CG, Module &M) { // Can't do better than that! } else if (F->onlyReadsMemory()) { FunctionEffect |= Ref; - // This function might call back into the module and read a global, so - // mark all globals read somewhere as being read by this function. - for (std::set::iterator GI = ReadGlobals.begin(), - E = ReadGlobals.end(); GI != E; ++GI) - FR.GlobalInfo[*GI] |= Ref; + if (!F->isIntrinsic()) { + // This function might call back into the module and read a global - + // mark all globals read somewhere as being read by this function. + for (std::set::iterator GI = ReadGlobals.begin(), + E = ReadGlobals.end(); GI != E; ++GI) + FR.GlobalInfo[*GI] |= Ref; + } } else { // Can't say anything useful. KnowNothing = true; -- cgit v1.2.3