Punt if we see gigantic PHI nodes. This improves a huge interpreter loop

testcase from 32.5s in -raise to take .3s


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12443 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2004-03-16 19:52:53 +00:00
parent a2f652d420
commit 91408eba18

View File

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