Intrinsics don't touch internal global variables
authorDuncan Sands <baldrick@free.fr>
Thu, 11 Sep 2008 19:35:55 +0000 (19:35 +0000)
committerDuncan Sands <baldrick@free.fr>
Thu, 11 Sep 2008 19:35:55 +0000 (19:35 +0000)
(unless passed one via a parameter), even if they
are IntrWriteMem.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56115 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/IPA/GlobalsModRef.cpp

index 6063a1d16b77c8426adb527a3b31227d168dce80..6736e6f3ce43566c13d68ebd67488679754c2940 100644 (file)
@@ -392,8 +392,10 @@ void GlobalsModRef::AnalyzeCallGraph(CallGraph &CG, Module &M) {
               FR.GlobalInfo[*GI] |= Ref;
           }
         } else {
-          // Can't say anything useful.
-          KnowNothing = true;
+          FunctionEffect |= ModRef;
+          // Can't say anything useful unless it's an intrinsic - they don't
+          // read or write global variables of the kind considered here.
+          KnowNothing = !F->isIntrinsic();
         }
         continue;
       }