diff options
author | Duncan Sands <baldrick@free.fr> | 2008-09-11 15:43:12 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2008-09-11 15:43:12 +0000 |
commit | 26cce28a3dd67fa562ffcca9e02c2d3c79392142 (patch) | |
tree | 6113949c4b6da949dc3a2db0d62b714626ebe2ea /lib/Analysis/IPA | |
parent | 99e8b0d00d87e476aecb90b8ba1cb764dd878c33 (diff) | |
download | external_llvm-26cce28a3dd67fa562ffcca9e02c2d3c79392142.zip external_llvm-26cce28a3dd67fa562ffcca9e02c2d3c79392142.tar.gz external_llvm-26cce28a3dd67fa562ffcca9e02c2d3c79392142.tar.bz2 |
Intrinsics don't read these kinds of global
variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56105 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/IPA')
-rw-r--r-- | lib/Analysis/IPA/GlobalsModRef.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/Analysis/IPA/GlobalsModRef.cpp b/lib/Analysis/IPA/GlobalsModRef.cpp index 70680bf..6063a1d 100644 --- a/lib/Analysis/IPA/GlobalsModRef.cpp +++ b/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<GlobalValue*>::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<GlobalValue*>::iterator GI = ReadGlobals.begin(), + E = ReadGlobals.end(); GI != E; ++GI) + FR.GlobalInfo[*GI] |= Ref; + } } else { // Can't say anything useful. KnowNothing = true; |