[PATCH] D69498: IR: Invert convergent attribute handling

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 29 03:46:51 PDT 2019


nhaehnle added a comment.

As you know, I am very much in favor of this change, and really anything that re-establishes the rule that code is treated maximally conservatively when there are no attributes or metadata.

There is one slight concern here because what we arguably need in SIMT targets is two attributes, which I'm going to call `allowconvergence` and `allowdivergence` for now. Convergent operations are operations that communicate with some set of other threads that is implicitly affected by where the operation is in control flow. If we have as a baseline that this set of threads must not be changed at all by transforms, then there are two directions in which this can be relaxed:

- It may be correct to transform code in a way that may cause **more** threads to communicate. This applies e.g. to OpenCL uniform barriers and could be expressed as `allowconvergence`.
- It may be correct to transform code in a way that may cause **fewer** threads to communicate. This applies to readanylane-style operations (which are implicit e.g. in some of our buffer and image intrinsics) and could be expressed as `allowdivergence`.

Though non-SIMT targets may not want to add two attributes everywhere. Perhaps a viable path forward is to take this change towards `noconvergent` now if we can still add `allowconvergence` and `allowdivergence` later; `noconvergent` would then simply be the union of those two attributes in the end.


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

https://reviews.llvm.org/D69498





More information about the llvm-commits mailing list