summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-09-11 15:43:12 +0000
committerDuncan Sands <baldrick@free.fr>2008-09-11 15:43:12 +0000
commite30b36fe37c2fb0659cf71c3f223806fedfa9474 (patch)
treef49cd661d58284a6977c26f0ff38be5ecfa94995 /llvm/lib
parent4adbe3116ec7539ab8b0cea8ba2001c773101c68 (diff)
downloadbcm5719-llvm-e30b36fe37c2fb0659cf71c3f223806fedfa9474.tar.gz
bcm5719-llvm-e30b36fe37c2fb0659cf71c3f223806fedfa9474.zip
Intrinsics don't read these kinds of global
variables. llvm-svn: 56105
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/IPA/GlobalsModRef.cpp12
1 files changed, 7 insertions, 5 deletions
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<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;
OpenPOWER on IntegriCloud