mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-21 18:29:46 +00:00
undef beats zero. Fix this missed optimization opportunity. Patch by Matt Elder!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59705 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ee85bbcae1
commit
d433904982
@ -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<PHINode>(I)) {
|
||||
if (PN->getNumIncomingValues() == 0)
|
||||
return Constant::getNullValue(PN->getType());
|
||||
return UndefValue::get(PN->getType());
|
||||
|
||||
Constant *Result = dyn_cast<Constant>(PN->getIncomingValue(0));
|
||||
if (Result == 0) return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user