[llvm] Extend MemoryEffects to Support Target-Specific Memory Locations (PR #148650)

via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 22 01:52:55 PDT 2025


================
@@ -203,6 +203,8 @@ enum Kind {
   kw_readwrite,
   kw_argmem,
   kw_inaccessiblemem,
+  kw_aarch64_fpmr,
+  kw_aarch64_za,
----------------
CarolineConcatto wrote:

We need a token to be used when describing the memory:
 memory(aarch64_za : read)

There are 3 solutions:
1) Create a target specific token for each architecture(arch64_za), but without a generic token(target_mem0).  It is the one I chosen because each target needs to describe its token  to be able to use the target location . All tokens should have the architecture name, like suggested. So it could not borrow from other architectures.
So this option allows:
 memory(aarch64_za : read)
but does not allow:
 memory(target_mem0 : read)

2) Create a generic token and print what is this meaning when we add target triple support, but do not add a target specific token. There would be the tokens target_memX and when we add the triple support it could print whatever the target wants. So only the Triple.h would know the name of the target locations, not even in the description of the memory we could use a target specific name. 
So this option allows:
 memory(target_mem0 : read)
but does not allow:
 memory(aarch64_za : read)

3) Could add target specific and generic tokens. I did not liked this option because it may cause confusion  being able to describe the same thing in two ways so thing could get messy.
So this option allows:
 memory(aarch64_za : read)
and
 memory(target_mem0 : read)

Do you have a preferred solution? Or do you see another way of doing this?

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


More information about the llvm-commits mailing list