From: Chris Lattner Date: Tue, 16 Mar 2004 19:52:53 +0000 (+0000) Subject: Punt if we see gigantic PHI nodes. This improves a huge interpreter loop X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=91408eba1890fd763e058963ee9cecbfde2039f9;p=oota-llvm.git 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 --- diff --git a/lib/Transforms/ExprTypeConvert.cpp b/lib/Transforms/ExprTypeConvert.cpp index 9fc9c93d4bf..b30ddf1f293 100644 --- a/lib/Transforms/ExprTypeConvert.cpp +++ b/lib/Transforms/ExprTypeConvert.cpp @@ -206,6 +206,9 @@ bool llvm::ExpressionConvertibleToType(Value *V, const Type *Ty, } case Instruction::PHI: { PHINode *PN = cast(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(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;