When performing return slot optimization, remember to inform memdep when we're removi...
authorOwen Anderson <resistor@mac.com>
Wed, 20 Feb 2008 08:23:02 +0000 (08:23 +0000)
committerOwen Anderson <resistor@mac.com>
Wed, 20 Feb 2008 08:23:02 +0000 (08:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47364 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/GVN.cpp

index 2ecc0e5d1f25277a863138f47973cd30724b5847..481956f6b4ce039dbb5307cc558372ce9e4c5d06 100644 (file)
@@ -1139,6 +1139,7 @@ bool GVN::performReturnSlotOptzn(MemCpyInst* cpy, CallInst* C,
   MD.dropInstruction(C);
   
   // Remove the memcpy
+  MD.removeInstruction(cpy);
   toErase.push_back(cpy);
   
   return true;