From 5f4f84ba3ec3cd5c9d6fb8acd770042a5cfdf8aa Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 18 Dec 2008 00:51:32 +0000 Subject: [PATCH] reapply this hunk from Bill's reversion in r61169, it is conservative and safe and orthogonal from turning off load pre. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61177 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/GVN.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp index 36624249238..6e532630c7b 100644 --- a/lib/Transforms/Scalar/GVN.cpp +++ b/lib/Transforms/Scalar/GVN.cpp @@ -956,6 +956,11 @@ bool GVN::processNonLocalLoad(LoadInst *LI, // it will be too expensive. if (Deps.size() > 100) return false; + + // If we had a phi translation failure, we'll have a single entry which is a + // clobber in the current block. Reject this early. + if (Deps.size() == 1 && Deps[0].second.isClobber()) + return false; // Filter out useless results (non-locals, etc). Keep track of the blocks // where we have a value available in repl, also keep track of whether we see