GlobalOpt forgot to handle bitcast when analyzing globals. Found by inspection.
[oota-llvm.git] / lib / Transforms / IPO / GlobalOpt.cpp
index 35f98b226536f1886fb8e749c3526627f8ef4948..4e1c23c1980c0f74670709c03576f58884a7eda3 100644 (file)
@@ -254,6 +254,8 @@ static bool AnalyzeGlobal(const Value *V, GlobalStatus &GS,
             GS.StoredType = GlobalStatus::isStored;
           }
         }
+      } else if (isa<BitCastInst>(I)) {
+        if (AnalyzeGlobal(I, GS, PHIUsers)) return true;
       } else if (isa<GetElementPtrInst>(I)) {
         if (AnalyzeGlobal(I, GS, PHIUsers)) return true;
       } else if (isa<SelectInst>(I)) {