From e42592e33afcef2d9603e87f93175104534787c7 Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Thu, 20 Nov 2008 04:36:13 +0000 Subject: undef beats zero. Fix this missed optimization opportunity. Patch by Matt Elder! llvm-svn: 59705 --- llvm/lib/Analysis/ConstantFolding.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Analysis/ConstantFolding.cpp') diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp index 9f94ee38337..597eecc1d23 100644 --- a/llvm/lib/Analysis/ConstantFolding.cpp +++ b/llvm/lib/Analysis/ConstantFolding.cpp @@ -281,7 +281,7 @@ static Constant *FoldBitCast(Constant *C, const Type *DestTy, Constant *llvm::ConstantFoldInstruction(Instruction *I, const TargetData *TD) { if (PHINode *PN = dyn_cast(I)) { if (PN->getNumIncomingValues() == 0) - return Constant::getNullValue(PN->getType()); + return UndefValue::get(PN->getType()); Constant *Result = dyn_cast(PN->getIncomingValue(0)); if (Result == 0) return 0; -- cgit v1.2.3