[llvm-commits] [llvm] r56105 - /llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp

Duncan Sands baldrick at free.fr
Thu Sep 11 08:43:13 PDT 2008


Author: baldrick
Date: Thu Sep 11 10:43:12 2008
New Revision: 56105

URL: http://llvm.org/viewvc/llvm-project?rev=56105&view=rev
Log:
Intrinsics don't read these kinds of global
variables.

Modified:
    llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp

Modified: llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp?rev=56105&r1=56104&r2=56105&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp (original)
+++ llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp Thu Sep 11 10:43:12 2008
@@ -384,11 +384,13 @@
           // 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;





More information about the llvm-commits mailing list