[llvm] [AMDGPU] - Generate s_bitreplicate_b64_b32 (PR #69209)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 23 06:46:54 PDT 2023


jayfoad wrote:

> we should define the intrinsic such that the argument must be uniform

I can see why that's attractive but I have previously been told that it is not possible: https://reviews.llvm.org/D139817#3991676

> This justifies the use of convergent (to prevent the kind of transforms you mentioned)

I don't think that works. I'm talking about transforming:
```
  %res1 = bitreplicate(%val1)
  %res2 = bitreplicate(%val2)
  %res = select %cond, %res1, %res2
```
into:
```
  %val = select %cond, %val1, %val2
  %res = bitreplicate(%val)
```
(where `val1` and `val2` are uniform but `cond` is divergent). I can't see how the `convergent` attribute would prevent that, since there is no divergent control flow here.

https://github.com/llvm/llvm-project/pull/69209


More information about the llvm-commits mailing list