[PATCH] D26348: Allow convergent attribute for function arguments

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 20 12:17:40 PST 2016


jlebar added inline comments.


================
Comment at: docs/LangRef.rst:1153
+    "whether and when each call site to this function is reached must be
+    uniform across multiple threads", the ``convergent`` attribute on function
+    arguments can be thought of as "the value of this argument at each
----------------
> While the ``convergent`` attribute on functions can be thought of as "whether and when each call site to this function is reached must be uniform across multiple threads",

I know this isn't meant to be normative, but I'm a little concerned by this language.  Specifically, our semantics say that the compiler is not allowed to *introduce* new sources of divergence to convergent calls, but it is also not allowed to *assume* that convergent calls are uniform.

I presume the same is true for convergent args -- the compiler cannot introduce divergence into the arg values, but it also cannot assume anything about the arg values as a consequence of their being marked convergent.

I know rewriting this to be precise might defeat the purpose of your summary here.  But could we add some weasel words so that people can't point to this as justification that divergent calls / args marked with `convergent` are LLVM UB?


================
Comment at: docs/LangRef.rst:1159
+    Program transformations must ensure that every pair of runs that is
+    compatible with respect to convergent function attributes in the original
+    program must also be compatible in the transformed program. Compatibility
----------------
Nit, suggest putting "compatible" in quotes so it's clear it's a term we're about to define.


https://reviews.llvm.org/D26348





More information about the llvm-commits mailing list