[llvm] [RFC] IR: Define noalias.addrspace metadata (PR #102461)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 8 11:58:22 PDT 2024


================
@@ -8015,6 +8015,42 @@ it will contain a list of ids, including the ids of the callsites in the
 full inline sequence, in order from the leaf-most call's id to the outermost
 inlined call.
 
+
+'``noalias.addrspace``' Metadata
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The ``noalias.addrspace`` metadata is used to identify memory
+operations which cannot access a range of address spaces. It is
+attached to memory instructions, including :ref:`atomicrmw
+<i_atomicrmw>`, :ref:`cmpxchg <i_cmpxchg>`, and :ref:`call <i_call>`
+instructions.
+
+This follows the same form as :ref:`range metadata <_range-metadata>`,
+except the field entries must be of type `i32`. The interpretation is
+the same numeric address spaces as applied to IR values.
----------------
arsenm wrote:

>  if/when we need to specify individual address spaces

This is the one actual use now and it's not awkward, you just need N and N + 1. 

> Could it be just a list of i32, possibly with enforced order/uniqueness on the elements?

This was the lazy initial idea I was going to go with, but it's not scalable. It bakes in the assumption there are only a few relevant address spaces, and not the full 24-bit limit of values 


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


More information about the llvm-commits mailing list