This is an archive of the discontinued LLVM Phabricator instance.

[X86] Fix for offsets of CFA directives
ClosedPublic

Authored by theo25 on Feb 8 2023, 6:01 PM.

Details

Summary

emitPrologue may insert stack pointer adjustment in tail call optimized functions where the callee argument stack size is bigger than the caller's. In such a case, the adjustment must be taken into account when generating CFA directives.

Diff Detail

Event Timeline

theo25 created this revision.Feb 8 2023, 6:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 8 2023, 6:01 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
theo25 requested review of this revision.Feb 8 2023, 6:01 PM

Add a test case to reflect the changes?

theo25 updated this revision to Diff 497781.Feb 15 2023, 1:38 PM

I have added a test to showcase the issue this diff resolves. Previously, the generated DWARF directives were erroneously using an offset of 16 instead of the correct offset of 8176.

I have also applied some linting changes suggested by clang-format.

pengfei accepted this revision.Feb 15 2023, 11:39 PM

LGTM, thanks!

This revision is now accepted and ready to land.Feb 15 2023, 11:39 PM

Thanks @pengfei. I don’t have commit access, can you land this patch for me? Please use “Theodoros Kasampalis kasampalis.theodoros@gmail.com” to commit the change.

This revision was landed with ongoing or failed builds.Feb 27 2023, 7:04 PM
This revision was automatically updated to reflect the committed changes.