[PATCH] D87882: [AMDGPU] Fix merging m0 inits
Alexander via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 22 12:31:36 PDT 2020
alex-t added a comment.
In D87882#2282278 <https://reviews.llvm.org/D87882#2282278>, @rampitec wrote:
> Doesn't loop block self dominate?
By definition: in CFG block X dominates block Y iif every path from entry to Y goes through X. Every block dominates itself.
Also by definition: block X **strictly** dominates block Y iif X dominates Y and X != Y.
To check if MBB A strictly dominates MBB B you need to call MDT.properlyDominates(A, B)
All the above is about that there are 2 orthogonal problems - dominance and reachability.
All instructions in a loop (irrelative of the number of blocks in a loop) **are reachable from each other**, i.e form SCC in a graph.
This is not about dominance at all. Moreover, the notion of dominance applied to instructions is just an interface sugar because dominance assumes graph but we don't have a graph of instructions but only basic blocks.
So, my opinion that check for a loop (i.e.predecessor search) is correct here.
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