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

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 20 15:21:39 PDT 2020


nikic added a comment.

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

> One corner case: how does dominance work over global values (possibly with initializers)? Is it possible to have invalid IR where a global has a broken initializer, but `dominates` answers `true`? I don't know this part of IR very well and am not sure if such issues are possible or not.

I can't say I'm particularly familiar with details of globals either. Here's the relevant bit of LangRef on the question of globals and dominance:

> As SSA values, global variables define pointer values that are in scope (i.e. they dominate) all basic blocks in the program. Global variables always define a pointer to their “content” type because they describe a region of memory, and all memory objects in LLVM are accessed through pointers.

Because globals (as SSA values) refer to the pointer to the global, rather than the value of the global, I don't think the well-formedness of the initializer really comes into play here (though I'm also not sure in what way globals initializers can be "broken" in LLVM).


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

https://reviews.llvm.org/D89632



More information about the llvm-commits mailing list