[clang] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

John McCall via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 9 13:16:13 PDT 2024


rjmccall wrote:

It's very uncommon for LLVM to need to come up with an address space on its own, as opposed to just propagating the original address space of some memory / operation as chosen by the frontend.  LLVM occasionally creates new storage allocations, but usually they're (non-escaping) `alloca`s and therefore have to be in the `alloca` AS.  The only situation I can think of where LLVM might legitimately have to come with an address space is when LLVM decides to introduce new global constants.  (I can't think of any transformation that would introduce a *non-constant* global.)  So if you add a default AS to `DataLayout`, please focus on that specifically and call it something like a "preferred constant address space" rather than some sort of default AS.  The default AS for pointer types and so on is really a frontend issue that's none of LLVM's business to know about.

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


More information about the cfe-commits mailing list