[PATCH] D87882: [AMDGPU] Fix merging m0 inits

Piotr Sobczak via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 06:47:19 PDT 2020


piotr added a comment.

  bb.1:
    ..
    TO_inst   (inits m0)
    ...       (uses m0)
    FROM_inst (clobbers m0)
    ...
    S_CBRANCH_VCCZ %bb.1, undef
    S_BRANCH %bb.2

I guess I am missing something here, the dominance usually refers to blocks so it can be confusing if applied for instructions.

In this case I expect MDT.dominates(FROM_inst, TO_inst) to return false, because it is possible for a program invocation to execute TO_inst, without executing FROM_inst first (e.g. single loop iteration).

Anyway, the spirit of the code I am editing was that before my patch it was assumed that if FROM_inst comes after TO_inst in a basic block (as in the case described above) then there was no path from FROM_inst to TO_inst, so TO_inst could be removed. This is not true for loops, where FROM_inst will clober m0 used in the next iteration.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87882



More information about the llvm-commits mailing list