forked from OSchip/llvm-project
It is illegal for PHI nodes to have zero values, delete the code to handle them
llvm-svn: 4071
This commit is contained in:
parent
2e0fb39d87
commit
394617f38b
|
@ -630,8 +630,6 @@ Instruction *InstCombiner::visitCastInst(CastInst &CI) {
|
||||||
//
|
//
|
||||||
Instruction *InstCombiner::visitPHINode(PHINode &PN) {
|
Instruction *InstCombiner::visitPHINode(PHINode &PN) {
|
||||||
// If the PHI node only has one incoming value, eliminate the PHI node...
|
// If the PHI node only has one incoming value, eliminate the PHI node...
|
||||||
if (PN.getNumIncomingValues() == 0)
|
|
||||||
return ReplaceInstUsesWith(PN, Constant::getNullValue(PN.getType()));
|
|
||||||
if (PN.getNumIncomingValues() == 1)
|
if (PN.getNumIncomingValues() == 1)
|
||||||
return ReplaceInstUsesWith(PN, PN.getIncomingValue(0));
|
return ReplaceInstUsesWith(PN, PN.getIncomingValue(0));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue