[PATCH] D89632: [DomTree] Accept Value as Def (NFC)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 19 12:55:30 PDT 2020


nikic added a comment.

In D89632#2339531 <https://reviews.llvm.org/D89632#2339531>, @kuhar wrote:

> Interesting idea.
>
> The first question that comes to my mind is what does it mean for and value to dominate a use.
> The function-level comment says:
>
>   /// Return true if Def dominates a use in User.
>
> this is clear when thinking about CFG-level graph dominance,  but globals and arguments are not really present in the CFG. I guess the intention is to actually check if a value is always 'available' before a use, i.e., either executes (as an instruction) in the same function, or 'statically' available in the module. Is this consistent with your patch and understanding, @nikic?

Yes, that's the interpretation I have in mind. I think this is also consistent with the interpretation of existing DominatorTree methods. The CFG-level concept of graph dominance is only really applicable to the base API operating on basic blocks, while other APIs perform reasoning in terms of value availability. For example, if you ask whether an invoke dominates an instruction in the unwind block, then the graph-level interpretation would tell you "yes". However, the DomTree API will actually tell you "no", because it knows that the invoke result is only available in the success block.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89632



More information about the llvm-commits mailing list