[llvm-commits] [llvm] r94858 - /llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Fri Jan 29 15:54:14 PST 2010


Author: stoklund
Date: Fri Jan 29 17:54:14 2010
New Revision: 94858

URL: http://llvm.org/viewvc/llvm-project?rev=94858&view=rev
Log:
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).

Modified:
    llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp

Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp?rev=94858&r1=94857&r2=94858&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Fri Jan 29 17:54:14 2010
@@ -638,8 +638,8 @@
     } else if (PHINode *PN = dyn_cast<PHINode>(*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<ICmpInst>(*UI) &&
                isa<ConstantPointerNull>(UI->getOperand(1))) {
       // Ignore setcc X, null





More information about the llvm-commits mailing list