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

Piotr Sobczak via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 18 13:43:20 PDT 2020


piotr added a comment.

In D87882#2282278 <https://reviews.llvm.org/D87882#2282278>, @rampitec wrote:

> Doesn't loop block self dominate?

You mean, why the condition "MDT.dominates(From, To)" returns false if From and To are in the same BB? Inside that function there is a bb dominance check if the instructions are in different blocks, but if the instructions are in the same block the code checks whether From comes before To.

The bug I am trying to fix is simplified in the test m0-in-loop-0 where before my patch SI_INIT from line 333 was incorrectly removed. Although "m0 = COPY" comes after SI_INIT in that bb, this is a loop and in the second iteration DS_WRITE would see a clobbered m0, so SI_INIT has to be preserved.


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