LICM uses AliasSet information to hoist and sink instructions. However, other passes...
[oota-llvm.git] / lib / Transforms / Utils / SSAUpdater.cpp
index b3f5289fcda94447c7d3355448dedf57ba24cc33..e568a616b6f0a853285561918741bd9eae31bb99 100644 (file)
@@ -214,6 +214,11 @@ void SSAUpdater::RewriteUse(Use &U) {
   else
     V = GetValueInMiddleOfBlock(User->getParent());
 
+  // Notify that users of the existing value that it is being replaced.
+  Value *OldVal = U.get();
+  if (OldVal != V && OldVal->hasValueHandle())
+    ValueHandleBase::ValueIsRAUWd(OldVal, V);
+
   U.set(V);
 }