[PATCH] D87149: [InstCombine] erase assume in block that ends in unreachable

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 4 12:01:57 PDT 2020


jdoerfert added a comment.

In D87149#2256885 <https://reviews.llvm.org/D87149#2256885>, @nikic wrote:

> This doesn't seem assume specific -- shouldn't we instead make this a visitUnreachableInst fold that removes preceding guaranteed-to-transfer instructions?
>
> Also as implemented this may remove asserts that are relevant, if we're not guaranteed-to-transfer from the assume to the unreachable terminator.

The first point is the important one. `unreachable` should eat any preceeding instruction that transfers execution for sure.
We should not remove assumes for other reasons.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87149/new/

https://reviews.llvm.org/D87149



More information about the llvm-commits mailing list