[PATCH] D26348: Allow convergent attribute for function arguments

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 16 15:45:45 PST 2016


mehdi_amini added inline comments.


================
Comment at: docs/LangRef.rst:1147
+    In some parallel execution models, there exist operations with one or more
+    arguments that must be uniform across threads. Such arguments are called
+    ``convergent``.
----------------
`uniform` isn't defined in the LangRef.


================
Comment at: docs/LangRef.rst:1155
+    execution of each call site to this function must be uniform across
+    multiple threads".
+
----------------
(Ignore this, phab bug)


================
Comment at: docs/LangRef.rst:1161
+    convergent argument at that call site in r1 and r2, respectively, satisfy
+    that S1 is a subsequence of S2 or vice versa.
+
----------------
It is not clear to me what is r1/S1 and r2/S2 that prevent to CSE:

```
if (cond) {
  Tmp1 = Foo(v [convergent])
} else {
  Tmp2 = Foo(v [convergent])
}
Tmp3 = phi [Tmp1, Tmp2]
```

to:

```
Tmp3 = Foo(v[convergent])
```

But your definition reference a "call site" as if there is a one-to-one mapping before/after a transformation.


https://reviews.llvm.org/D26348





More information about the llvm-commits mailing list