[llvm] [LangRef] Clarify what "group" in invariant.group means. (PR #200552)
Antonio Frighetto via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 4 02:26:15 PDT 2026
================
@@ -8634,6 +8634,12 @@ value (but see the ``llvm.launder.invariant.group`` intrinsic which affects
when two pointers are considered the same). Pointers returned by bitcast or
getelementptr with only zero indices are considered the same.
+Note that although ``invariant.group`` takes a metadata value (e.g. ``!0`` in
+the code below), that value is meaningless and ignored. (It's present only
----------------
antoniofrighetto wrote:
Isn't this sort of already mentioned above when saying the metadata carries an empty node? While I don't think there's going to be any movement in this direction any time soon, it seems like the author had envisioned a possible per-function use, possibly specifying a devirtualization policy the group would belong to (ce358262eb7ddc3bf4b251c61feb87c561ad5378).
We could perhaps make the above lines a bit more explicit, saying that the node carries no semantics on its own, and it just happens to be the index metadata assigned (i.e., we won't see `!invariant.group !0`, `!invariant.group !1`, etc. referring to different groups in the same program).
https://github.com/llvm/llvm-project/pull/200552
More information about the llvm-commits
mailing list