River707 wrote:

> > Why don't the various transforms just use DominanceInfo? Answering these 
> > queries is what it's intended for.
> 
> Block reachability and block dominance are two different things. Just because 
> there is a path from `block A -> block B` does not necessarily mean that 
> `block A dominates block B`. I'm not sure how "block reachability" could be 
> implemented with `DominanceInfo`.
> 
> That being said, in the dialect conversion I actually need dominance, so what 
> I implemented here is not useful there...

Yes, my comment was geared towards the fact that several of the usages are 
already conflating reachability with dominance (for example the original usage 
in the followup IRBuilder PR). My concern is/was around the general utility of 
such a function, given that it cannot be used in most situations people would 
reach for it (i.e. dominance outside of purely structured control flow) so it 
wasn't clear the utility in adding it to Block. That being said I don't have an 
issue with this singular function, given that it's a tiny amount of graph 
traversal code. I would clearly mark in the comment that this function is not a 
replacement for dominance in any reasonable situation (given that a successor 
block can easily reach a predecessor in a situation such as a loop).

https://github.com/llvm/llvm-project/pull/114940
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to