Fix PR13851: Preserve metadata for the unswitched branch
[oota-llvm.git] / lib / Transforms / Scalar / Sink.cpp
index ec3a0186641efbdaaad7b0790d9d541cb7f4a29f..f49f4eaaedcb00620649a854b791a811c78b4315 100644 (file)
@@ -163,7 +163,7 @@ static bool isSafeToMove(Instruction *Inst, AliasAnalysis *AA,
   }
 
   if (LoadInst *L = dyn_cast<LoadInst>(Inst)) {
-    AliasAnalysis::Location Loc = AA->getLocation(L);
+    MemoryLocation Loc = MemoryLocation::get(L);
     for (Instruction *S : Stores)
       if (AA->getModRefInfo(S, Loc) & AliasAnalysis::Mod)
         return false;