[llvm-branch-commits] [llvm] [Attributor] Take the address space from addrspacecast directly (PR #108258)

Matt Arsenault via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sun Sep 15 04:44:15 PDT 2024


arsenm wrote:

> If the value to be analyzed is directly from addrspacecast, we take the source
address space directly. 

I don't think this is valid in general. You are allow to speculatively produce invalid addrspacecasts. For example:

```
__generic int* g_ptr = ...;
__local int* l_ptr = (__local int*) g_ptr;
if (is_shared(g_ptr)) 
  *l_ptr = 1;


```


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


More information about the llvm-branch-commits mailing list