forked from OSchip/llvm-project
Punt if we see gigantic PHI nodes. This improves a huge interpreter loop
testcase from 32.5s in -raise to take .3s llvm-svn: 12443
This commit is contained in:
parent
7a7b114871
commit
fa48edfb7d
|
@ -206,6 +206,9 @@ bool llvm::ExpressionConvertibleToType(Value *V, const Type *Ty,
|
|||
}
|
||||
case Instruction::PHI: {
|
||||
PHINode *PN = cast<PHINode>(I);
|
||||
// Be conservative if we find a giant PHI node.
|
||||
if (PN->getNumIncomingValues() > 32) return false;
|
||||
|
||||
for (unsigned i = 0; i < PN->getNumIncomingValues(); ++i)
|
||||
if (!ExpressionConvertibleToType(PN->getIncomingValue(i), Ty, CTMap, TD))
|
||||
return false;
|
||||
|
@ -815,6 +818,9 @@ static bool OperandConvertibleToType(User *U, Value *V, const Type *Ty,
|
|||
|
||||
case Instruction::PHI: {
|
||||
PHINode *PN = cast<PHINode>(I);
|
||||
// Be conservative if we find a giant PHI node.
|
||||
if (PN->getNumIncomingValues() > 32) return false;
|
||||
|
||||
for (unsigned i = 0; i < PN->getNumIncomingValues(); ++i)
|
||||
if (!ExpressionConvertibleToType(PN->getIncomingValue(i), Ty, CTMap, TD))
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue