[LoopUnroll] Unroll loops which have exit blocks to EH pads
authorDavid Majnemer <david.majnemer@gmail.com>
Tue, 3 May 2016 03:57:40 +0000 (03:57 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Tue, 3 May 2016 03:57:40 +0000 (03:57 +0000)
commit3d90bb79c4e81dfd76afe26a771097dc3852674c
treed3dc2a6f76ce26012d6976cc9618d9df5afbca2c
parent2a4c00f24328cece37ee57134974b24e4295a17e
[LoopUnroll] Unroll loops which have exit blocks to EH pads

We were overly cautious in our analysis of loops which have invokes
which unwind to EH pads.  The loop unroll transform is safe because it
only clones blocks in the loop body, it does not try to split critical
edges involving EH pads.  Instead, move the necessary safety check to
LoopUnswitch.

N.B. The safety check for loop unswitch is covered by an existing test
which fails without it.

llvm-svn: 268357
llvm/include/llvm/IR/CallSite.h
llvm/lib/Analysis/LoopInfo.cpp
llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
llvm/test/Transforms/LoopUnroll/unroll-cleanuppad.ll [new file with mode: 0644]