[PATCH] D103340: [LoopUnroll] Use changeToUnreachable()

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 28 15:02:50 PDT 2021


nikic added a comment.

In D103340#2787715 <https://reviews.llvm.org/D103340#2787715>, @reames wrote:

> I have two concerns with this patch.
>
> 1. This is moving the code from before the dom tree rewrite to after.  Is the dom tree rewrite correct with the changed CFG?  From what I can tell, it is, but critical thought here is warranted.

Right, this is part of the motivation here: moving code out of the scope of the tricky manual dom tree update code. I believe that this is correct, because the particular CFG change that is performed here is one that does not affect the DT at all: The removal of an unconditional backedge.

> 2. Previously a throwing instruction in the last latch block was left in place.  If we ever had a case where we computed a trap count from a known throwing instruction, the new behavior is different than the old behavior.  I don't know of anything which does this, but I think I'd prefer to be conservative here.
>
> LGTM w/the unreachable moved to the end of the latch block.

Okay, I'll do that, which should make this an NFC change.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103340



More information about the llvm-commits mailing list