aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/Reassociate.cpp
diff options
context:
space:
mode:
authorAditya Nandakumar <aditya_nandakumar@apple.com>2016-01-07 23:22:55 +0000
committerAditya Nandakumar <aditya_nandakumar@apple.com>2016-01-07 23:22:55 +0000
commit3d7142aab4786061a5e5509b2327696582a7fe6f (patch)
tree751e5e9f6f08ddefbeab3caadc118059f37ebf4b /lib/Transforms/Scalar/Reassociate.cpp
parentaf0132814087683ae35673d16ada93c2f024aa3b (diff)
Instructions to be redone only if from the same BB
While adding instructions(possible roots) to be redone, make sure they are from the same basic block. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257112 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/Reassociate.cpp')
-rw-r--r--lib/Transforms/Scalar/Reassociate.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/Reassociate.cpp b/lib/Transforms/Scalar/Reassociate.cpp
index 401a740856e..bcadd4e2bee 100644
--- a/lib/Transforms/Scalar/Reassociate.cpp
+++ b/lib/Transforms/Scalar/Reassociate.cpp
@@ -2155,7 +2155,8 @@ void Reassociate::OptimizeInst(Instruction *I) {
// During the initial run we will get to the root of the tree.
// But if we get here while we are redoing instructions, there is no
// guarantee that the root will be visited. So Redo later
- if (BO->user_back() != BO)
+ if (BO->user_back() != BO &&
+ BO->getParent() == BO->user_back()->getParent())
RedoInsts.insert(BO->user_back());
return;
}