[CloneFunction] Support BB == PredBB in DuplicateInstructionsInSplit.
authorFlorian Hahn <florian.hahn@arm.com>
Tue, 6 Mar 2018 13:12:32 +0000 (13:12 +0000)
committerFlorian Hahn <florian.hahn@arm.com>
Tue, 6 Mar 2018 13:12:32 +0000 (13:12 +0000)
commitf0a25f7253745d8aa3c3692e53110fc20a569bd0
tree90d761243c00062aff7cf00031795f800b6cc06f
parent33caf899704c9a300be44e97c70f1c8a9e679072
[CloneFunction] Support BB == PredBB in DuplicateInstructionsInSplit.

In case PredBB == BB and StopAt == BB's terminator, StopAt != &*BI will
fail, because BB's terminator instruction gets replaced.

By using BB.getTerminator() we get the current terminator which we can use
to compare.

Reviewers: sanjoy, anna, reames

Reviewed By: anna

Differential Revision: https://reviews.llvm.org/D43822

llvm-svn: 326779
llvm/lib/Transforms/Utils/CloneFunction.cpp
llvm/unittests/Transforms/Utils/Cloning.cpp