This is an archive of the discontinued LLVM Phabricator instance.

GlobalISel: Insert memcpy for outgoing byval arguments
ClosedPublic

Authored by arsenm on Mar 14 2021, 7:05 AM.

Details

Summary

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).

Diff Detail