From 1a469385bdba848c93a8e9f66407f80cb36a6127 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 11 Nov 2004 07:47:54 +0000 Subject: [PATCH] Actually, leave the check in. This prevents us from counting dead arguments as IPCP opportunities. llvm-svn: 17680 --- lib/Transforms/IPO/IPConstantPropagation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Transforms/IPO/IPConstantPropagation.cpp b/lib/Transforms/IPO/IPConstantPropagation.cpp index 9daeb4fa5d9..bf2e3d72c3f 100644 --- a/lib/Transforms/IPO/IPConstantPropagation.cpp +++ b/lib/Transforms/IPO/IPConstantPropagation.cpp @@ -113,7 +113,7 @@ bool IPCP::processFunction(Function &F) { bool MadeChange = false; for (unsigned i = 0, e = ArgumentConstants.size(); i != e; ++i, ++AI) // Do we have a constant argument!? - if (!ArgumentConstants[i].second) { + if (!ArgumentConstants[i].second && !AI->use_empty()) { Value *V = ArgumentConstants[i].first; if (V == 0) V = UndefValue::get(AI->getType()); AI->replaceAllUsesWith(V);