[PATCH] D82513: [CodeGen] Store the return value of the target function call to the thunk's return value slot directly when the return type is an aggregate instead of doing so via a temporary

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 9 15:55:58 PDT 2020


ahatanak added a comment.

In D82513#2142596 <https://reviews.llvm.org/D82513#2142596>, @rjmccall wrote:

> This seems fine.  I do wonder if the "real" bug is that this ought to be handled properly in EmitReturnFromThunk, but regardless, the fix seems acceptable.


Since `EmitReturnFromThunk` is used only by `EmitCallAndReturnForThunk`, I think it's better to just avoid the copy in the first place. Perhaps we should teach `EmitReturnOfRValue` to handle aggregates with non-trivial copy or move assignments correctly, but it seems that it won't have any effect once we commit the changes in this patch.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82513/new/

https://reviews.llvm.org/D82513





More information about the cfe-commits mailing list