This is an archive of the discontinued LLVM Phabricator instance.

[X86] Fix callee side of receiving byval args on the stack
ClosedPublic

Authored by hans on Jun 15 2023, 6:57 AM.

Details

Summary

See the discussion in https://discourse.llvm.org/t/generic-llvm-ir-windows-x64-argument-passing-issue-in-llvm-11-0-0-and-later/71350

D51842 implemented byval lowering for Win64. D83175 made the call lowering honor the "from now on treat this as a regular pointer" comment also when the argument gets passed on the stack. However, it didn't update the callee side.

Diff Detail

Event Timeline

hans created this revision.Jun 15 2023, 6:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 15 2023, 6:57 AM
hans requested review of this revision.Jun 15 2023, 6:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 15 2023, 6:57 AM
rnk accepted this revision.Jun 15 2023, 9:18 AM

lgtm

I checked the code and as I understand it, byval has no effect on the first four pointer arguments, those are passed in the 4 register parameters indirectly. After that, byval works normally as it does for i686 and other platforms. The argument is placed on the stack and it can be materialized.

This revision is now accepted and ready to land.Jun 15 2023, 9:18 AM
This revision was automatically updated to reflect the committed changes.