[PATCH] D98597: GlobalISel: Insert memcpy for outgoing byval arguments

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 14 07:05:43 PDT 2021


arsenm created this revision.
arsenm added reviewers: aemerson, paquette, dsanders, aditya_nandakumar, bogner.
Herald added subscribers: kerbowa, hiraditya, tpr, rovka, nhaehnle, jvesely.
arsenm requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

byval requires an implicit copy between the caller and callee such
that the callee may write into the stack area without it modifying the
value in the parent. Previously, this was passing through the raw
pointer value which would break if the callee wrote into it.

      

Most of the time, this copy can be optimized out (however we don't
have the optimization SelectionDAG does yet).

      

This will trigger more fallbacks for AMDGPU now, since we don't have
legalization for memcpy yet (although we should stop using byval
anyway).


https://reviews.llvm.org/D98597

Files:
  llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h
  llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
  llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
  llvm/test/CodeGen/AArch64/GlobalISel/byval-call.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/irtranslator-call.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98597.330507.patch
Type: text/x-patch
Size: 14607 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210314/b77bf9d9/attachment.bin>


More information about the llvm-commits mailing list