[CallSiteSplitting] Do not crash when BB's terminator changes.
authorFlorian Hahn <florian.hahn@arm.com>
Tue, 6 Mar 2018 14:00:58 +0000 (14:00 +0000)
committerFlorian Hahn <florian.hahn@arm.com>
Tue, 6 Mar 2018 14:00:58 +0000 (14:00 +0000)
commit517dc51c488739e45b9a6ad67c31f85778f43459
treebecd57dda7ddd648168b4255343df6aae7e7bfa0
parent446d6ec996c6c397d4576d9608e1dd01a97e0064
[CallSiteSplitting] Do not crash when BB's terminator changes.

Change doCallSiteSplitting to iterate until we reach the terminator instruction.
tryToSplitCallSite can replace BB's terminator in case BB is a successor of
itself. Then IE will be invalidated and we also have to check the current
terminator.

Reviewers: junbuml, davidxl, davide, fhahn

Reviewed By: fhahn, junbuml

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

llvm-svn: 326793
llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp
llvm/test/Transforms/CallSiteSplitting/split-loop.ll [new file with mode: 0644]