diff options
author | Aditya Nandakumar <aditya_nandakumar@apple.com> | 2016-01-07 23:22:55 +0000 |
---|---|---|
committer | Aditya Nandakumar <aditya_nandakumar@apple.com> | 2016-01-07 23:22:55 +0000 |
commit | 3d7142aab4786061a5e5509b2327696582a7fe6f (patch) | |
tree | 751e5e9f6f08ddefbeab3caadc118059f37ebf4b /lib/Transforms/Scalar/Reassociate.cpp | |
parent | af0132814087683ae35673d16ada93c2f024aa3b (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.cpp | 3 |
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; } |