Issue 58227
Summary What is the correct addrspace for ptr argument of var.annotation ?
Labels
Assignees
Reporter MrSidims
    LangRef says:
`The first argument is a pointer to a value, the second is a pointer to a global string, the third is a pointer to a global string which is the source file name, and the last argument is the line number.`

so if I read it correctly it has no restrictions regarding what address spaces are legal and I would assume that any address space can be used. But meanwhile for to following declaration:
`declare void @llvm.var.annotation(ptr addrspace(4), ptr, ptr, i32, ptr)`
llvm-as generates:
```
 assembly parsed, but does not verify as correct!
Intrinsic has incorrect argument type!
void (ptr addrspace(4), ptr, ptr, i32, ptr)* @llvm.var.annotation
```
so the validator doesn't accept it.
This error seems to be unreasonable and in some cases even undesirable, for example in OpenCL addrspace(4) is a generic AS generated by clang.

So the question is: is it intentional or it's a bug in the validator?
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to