[PATCH] D116053: [MachineSink] Allow sinking of constant or ignorable physreg uses

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 21 01:24:50 PST 2021


shchenz added a comment.

In D116053#3203538 <https://reviews.llvm.org/D116053#3203538>, @rampitec wrote:

> I am not sure I can prove to myself this is legal. For example you are sinking a def into a loop with divergent condition and this def is used after the loop. Can this happen?

If `SuccToSinkTo` exists, all uses of the def must be dominated by block `SuccToSinkTo`. So I think it is ok to do the sinking.

`isConstantPhysReg()` seems ok as any def to such register has no meaning.

Better let an AMDGPU expert have a look especially at the code gen changes.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116053



More information about the llvm-commits mailing list