llvm-project/llvm/test/Transforms/InferAddressSpaces/AMDGPU
Michael Liao bf225939bc [InferAddressSpaces] Support assumed addrspaces from addrspace predicates.
- CUDA cannot associate memory space with pointer types. Even though Clang could add extra attributes to specify the address space explicitly on a pointer type, it breaks the portability between Clang and NVCC.
- This change proposes to assume the address space from a pointer from the assumption built upon target-specific address space predicates, such as `__isGlobal` from CUDA. E.g.,

```
  foo(float *p) {
    __builtin_assume(__isGlobal(p));
    // From there, we could assume p is a global pointer instead of a
    // generic one.
  }
```

This makes the code portable without introducing the implementation-specific features.

Note that NVCC starts to support __builtin_assume from version 11.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D112041
2021-11-08 16:51:57 -05:00
..
address-space-id-funcs.ll
assumed-addrspace.ll
basic.ll
builtin-assumed-addrspace.ll [InferAddressSpaces] Support assumed addrspaces from addrspace predicates. 2021-11-08 16:51:57 -05:00
icmp.ll
infer-address-space.ll
infer-addrspacecast.ll
infer-getelementptr.ll
intrinsics.ll
lit.local.cfg
mem-intrinsics.ll [Tests] Fix incorrect noalias metadata 2021-09-18 20:51:00 +02:00
no-flat-addrspace.ll
noop-ptrint-pair.ll
old-pass-regressions-inseltpoison.ll
old-pass-regressions.ll
ptrmask.ll
redundant-addrspacecast.ll
select.ll
self-phi.ll
unreachable-code-assert.ll
volatile.ll