This is an archive of the discontinued LLVM Phabricator instance.

[IRGen] Emit lifetime markers for temporary struct allocas
ClosedPublic

Authored by thegameg on Oct 7 2019, 4:53 PM.

Details

Summary

When passing arguments using temporary allocas, we need to add the appropriate lifetime markers so that the stack coloring passes can re-use the stack space.

This patch keeps track of all the lifetime.start calls emited before the codegened call, and adds the corresponding lifetime.end calls after the call.

Diff Detail

Event Timeline

thegameg created this revision.Oct 7 2019, 4:53 PM
rjmccall added inline comments.Oct 8 2019, 10:06 AM
clang/lib/CodeGen/CGCall.cpp
4014

Please push this immediately after emitting the lifetime start. That'll just make it more obvious that the copyInto call doesn't affect this.

thegameg updated this revision to Diff 223907.Oct 8 2019, 11:18 AM

Move cleanup code after emitting lifetime start.

rjmccall accepted this revision.Oct 8 2019, 1:05 PM

LGTM

This revision is now accepted and ready to land.Oct 8 2019, 1:05 PM
This revision was automatically updated to reflect the committed changes.
thegameg marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptOct 8 2019, 3:12 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript