diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp index f5d2baa426a..56f6390ea4b 100644 --- a/lib/Transforms/IPO/GlobalOpt.cpp +++ b/lib/Transforms/IPO/GlobalOpt.cpp @@ -623,7 +623,10 @@ static bool OptimizeAwayTrappingUsesOfLoads(GlobalVariable *GV, Constant *LV) { Loads.push_back(LI); Changed |= OptimizeAwayTrappingUsesOfValue(LI, LV); } else { - assert(isa(*GUI) && "Only expect load and stores!"); + // If we get here we could have stores, loads, or phi nodes whose values + // are loaded. + assert((isa(*GUI) || isa(*GUI)) && + "Only expect load and stores!"); } if (Changed) {