Fix bug: IPConstantProp/deadarg.ll
authorChris Lattner <sabre@nondot.org>
Thu, 11 Nov 2004 07:46:29 +0000 (07:46 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 11 Nov 2004 07:46:29 +0000 (07:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17679 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/IPConstantPropagation.cpp

index 479f8e73ccb482c062bdafe89b0540786f2467f5..9daeb4fa5d928c5bd9ccdde8437d3951545090b7 100644 (file)
@@ -113,9 +113,9 @@ 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 && !AI->use_empty()) {
-      assert(ArgumentConstants[i].first && "Unknown constant value!");
+    if (!ArgumentConstants[i].second) {
       Value *V = ArgumentConstants[i].first;
+      if (V == 0) V = UndefValue::get(AI->getType());
       AI->replaceAllUsesWith(V);
       ++NumArgumentsProped;
       MadeChange = true;