From: Jakob Stoklund Olesen Date: Fri, 29 Jan 2010 23:54:14 +0000 (+0000) Subject: Keep iterating over all uses when meeting a phi node in AllUsesOfValueWillTrapIfNull(). X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b489d0f88a59cf620fad7a0a82037ad2cd3cad16;p=oota-llvm.git Keep iterating over all uses when meeting a phi node in AllUsesOfValueWillTrapIfNull(). This bug was exposed by my inliner cost changes in r94615, and caused failures of lencod on most architectures when building with LTO. This patch fixes lencod and 464.h264ref on x86-64 (and likely others). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94858 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp index ee260e9488e..ac91631f56c 100644 --- a/lib/Transforms/IPO/GlobalOpt.cpp +++ b/lib/Transforms/IPO/GlobalOpt.cpp @@ -638,8 +638,8 @@ static bool AllUsesOfValueWillTrapIfNull(Value *V, } else if (PHINode *PN = dyn_cast(*UI)) { // If we've already seen this phi node, ignore it, it has already been // checked. - if (PHIs.insert(PN)) - return AllUsesOfValueWillTrapIfNull(PN, PHIs); + if (PHIs.insert(PN) && !AllUsesOfValueWillTrapIfNull(PN, PHIs)) + return false; } else if (isa(*UI) && isa(UI->getOperand(1))) { // Ignore setcc X, null