[PATCH] D30667: GVNHoist: handle basic blocks with UnreachableInst

Daniel Berlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 7 09:46:17 PST 2017


dberlin added a comment.

In https://reviews.llvm.org/D30667#694347, @hiraditya wrote:

> In https://reviews.llvm.org/D30667#693739, @dberlin wrote:
>
> > Uh, won't this already return false on the call to longjmp?
>
>
> GVNHoist only calls isGuaranteedToTransferExecutionToSuccessor for terminators.


This is not safe to do.
LLVM's basic blocks are really closer to EBB's.
You can't assume the only place it will return false is at a terminator. It can and will return false for calls in the middle of the block, for example.


https://reviews.llvm.org/D30667





More information about the llvm-commits mailing list