[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:47:55 PDT 2024


rjmccall wrote:

> Libcall emission needs to know what AS to use for pointer arguments to things like __sync/__atomic implementations and various string-y mem*/str* functions. That's the main one that comes to mind from our experience in CHERI LLVM, and current LLVM just assumes that's AS0.

That's a fair point, but it's clearly specific to libcall emission and not a generic concept for all IR.  And it needs real intelligence, not just a hardcoded AS in the `DataLayout`, e.g. to know that it simply cannot do libcall emission for certain operations because there's no way to convert a pointer into AS 10 to the parameter type of the relevant function.

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


More information about the cfe-commits mailing list