[NVVM] Update intrinsic definitions to include more attributes
authorJohannes Doerfert <johannes@jdoerfert.de>
Fri, 17 Sep 2021 18:23:42 +0000 (13:23 -0500)
committerJohannes Doerfert <johannes@jdoerfert.de>
Wed, 3 Nov 2021 04:21:57 +0000 (23:21 -0500)
commitc690c1c977ffb25c3334431604ed771cb6b43b72
tree9d5feab9bb239c5a38cb442713142e686478e012
parente6e440ae5f8de23bea20ecf03394d46cbe5c11f8
[NVVM] Update intrinsic definitions to include more attributes

A lot of NVVM intrinsics can use the default intrinsic attributes (e.g.,
nosync, nofree, ...) as well as `speculatable`. The latter is important
if we want to recompute intrinsics results instead of communicating them
via memory.

I did use default attributes for almost all `readnone` attributes but
speculatable only where I had reasonable confidence they cannot
experience UB. That said, someone should double check.

TODO: There seem to be various intrinsics marked `Commutative` which
      should not, e.g., fma and div.

Reviewed By: tra

Differential Revision: https://reviews.llvm.org/D109987
llvm/include/llvm/IR/IntrinsicsNVVM.td
llvm/test/Transforms/OpenMP/replace_globalization.ll