[clang] [clang][CodeGen] `sret` args should always point to the `alloca` AS, so use that (PR #114062)

Alex Voicu via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 18 14:55:23 PST 2024


================
@@ -225,7 +225,9 @@ ABIArgInfo AMDGPUABIInfo::classifyArgumentType(QualType Ty, bool Variadic,
     // Records with non-trivial destructors/copy-constructors should not be
     // passed by value.
     if (auto RAA = getRecordArgABI(Ty, getCXXABI()))
-      return getNaturalAlignIndirect(Ty, RAA == CGCXXABI::RAA_DirectInMemory);
+      return getNaturalAlignIndirect(
+          Ty, getContext().getTargetAddressSpace(LangAS::Default),
+          RAA == CGCXXABI::RAA_DirectInMemory);
----------------
AlexVlx wrote:

Apologies if my reply came off as defensive (and for the delay), it wasn't intended as such, merely wanted to convey trepidation around doing too much in one change. I am in agreement with the points you made / the way forward. In what regards the proposed rule, as I mentioned elsewhere, I'm of the opinion that we should leave indirect returns pointing to the AllocaAS (since this is the only possibility at the moment), with a note that this would require reworking in the future (where the base ABI would be to return a pointer to the default AS, with targets potentially altering this).

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


More information about the cfe-commits mailing list