[PATCH] D120330: [MachineSink] Fix CFG walk in clobber check (PR53990)

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 23 01:28:47 PST 2022


shchenz added a comment.

In D120330#3339665 <https://reviews.llvm.org/D120330#3339665>, @nikic wrote:

> In D120330#3339261 <https://reviews.llvm.org/D120330#3339261>, @shchenz wrote:
>
>> Can we check why the instruction is sunk from a shallower block `From` to a deeper block `To`?  `MachineSinking::isProfitableToSinkTo()` should not allow this?
>
> This happens because the loop is irreducible. The loop depth check is based on MachineLoopInfo, which only handles natural loops. So sinking into irreducible cycles is not prevented by the profitability check.

Is it possible to exclude this irreducible loop case in `isProfitableToSinkTo` and add some assertions/checks in `hasStoreBetween`? The posted patch may largely increase the compile time as now more blocks are checked. Compile-time issue happened before in https://reviews.llvm.org/D86864#2469289


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

https://reviews.llvm.org/D120330



More information about the llvm-commits mailing list