From 537e5a6b500af7fef73b61ee8482819f2633be91 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 30 Nov 2004 07:01:15 +0000 Subject: [PATCH] Fix test/Regression/Transforms/LICM/2004-09-14-AliasAnalysisInvalidate.llx This only fails on darwin or on X86 under valgrind. llvm-svn: 18377 --- lib/Transforms/Utils/PromoteMemoryToRegister.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Transforms/Utils/PromoteMemoryToRegister.cpp b/lib/Transforms/Utils/PromoteMemoryToRegister.cpp index 213b3d742f4..ff68f4e69e3 100644 --- a/lib/Transforms/Utils/PromoteMemoryToRegister.cpp +++ b/lib/Transforms/Utils/PromoteMemoryToRegister.cpp @@ -342,6 +342,8 @@ void PromoteMem2Reg::run() { if (PNs[i]) { if (Value *V = hasConstantValue(PNs[i])) { if (!isa(V) || dominates(cast(V), PNs[i])) { + if (AST && isa(PNs[i]->getType())) + AST->deleteValue(PNs[i]); PNs[i]->replaceAllUsesWith(V); PNs[i]->eraseFromParent(); PNs[i] = 0;