diff options
-rw-r--r-- | lib/Transforms/IPO/GlobalOpt.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp index f5d2baa426..56f6390ea4 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<StoreInst>(*GUI) && "Only expect load and stores!"); + // If we get here we could have stores, loads, or phi nodes whose values + // are loaded. + assert((isa<StoreInst>(*GUI) || isa<PHINode>(*GUI)) && + "Only expect load and stores!"); } if (Changed) { |