diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp index 102146945a0b..62896157d5bc 100644 --- a/llvm/lib/Transforms/Scalar/LICM.cpp +++ b/llvm/lib/Transforms/Scalar/LICM.cpp @@ -605,6 +605,7 @@ void LICM::hoist(Instruction &I) { // Remove the instruction from its current basic block... but don't delete the // instruction. + CurAST->deleteValue(&I); I.removeFromParent(); // Insert the new node in Preheader, before the terminator.