[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
Thu Dec 5 04:25:24 PST 2024


================
@@ -1350,7 +1350,7 @@ bool ItaniumCXXABI::classifyReturnType(CGFunctionInfo &FI) const {
   // If C++ prohibits us from making a copy, return by address.
   if (!RD->canPassInRegisters()) {
     auto Align = CGM.getContext().getTypeAlignInChars(FI.getReturnType());
-    FI.getReturnInfo() = ABIArgInfo::getIndirect(Align, /*ByVal=*/false);
+    FI.getReturnInfo() = ABIArgInfo::getIndirect(Align, 0, /*ByVal=*/false);
----------------
AlexVlx wrote:

I actually went ahead and bit the bullet, switching indirect returns to the AllocaAS (this is at least initially covered by tests here), and leaving other uses of indirect using LangAS::Default. I'm going to have to revisit this around indirect args, but I wasn't brave enough to go and add even more noise to what is already a chunky patch.

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


More information about the cfe-commits mailing list