Fix bug: IPConstantProp/deadarg.ll

llvm-svn: 17679
This commit is contained in:
Chris Lattner 2004-11-11 07:46:29 +00:00
parent ba582f0d11
commit 5fa696f8e4
1 changed files with 2 additions and 2 deletions

View 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;