aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-04-26 17:41:02 +0000
committerChris Lattner <sabre@nondot.org>2011-04-26 17:41:02 +0000
commit9750acc079409e52f6563636a112a9de50749b30 (patch)
treec4de4b907fe534490798165a404b1318159760e6 /lib/Transforms
parenta61e73bda5125c28e48b52e573d115370838596b (diff)
Improve the bail-out predicate to really only kick in when phi
translation fails. We were bailing out in some cases that would cause us to miss GVN'ing some non-local cases away. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130206 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/GVN.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp
index 15db9ad70a..7c11323ec8 100644
--- a/lib/Transforms/Scalar/GVN.cpp
+++ b/lib/Transforms/Scalar/GVN.cpp
@@ -1103,7 +1103,8 @@ bool GVN::processNonLocalLoad(LoadInst *LI,
// 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].getResult().isClobber()) {
+ if (Deps.size() == 1 && Deps[0].getResult().isClobber() &&
+ Deps[0].getResult().getInst()->getParent() == LI->getParent()) {
DEBUG(
dbgs() << "GVN: non-local load ";
WriteAsOperand(dbgs(), LI);