Page MenuHomePhabricator

[X86] Lower calls with rv_marker attribute.
Needs ReviewPublic

Authored by fhahn on Wed, Jan 13, 6:11 AM.

Details

Summary

This patch adds support for lowering function calls with the
rv_marker attribute. The goal is to expand such calls to the
following sequence of instructions:

CALL{32,64} @fn
movl %ebp, %ebp

This sequence of instructions triggers Objective-C runtime optimizations,
hence we want to ensure no instructions get moved in between them.
This patch achieves that by adding a new CALL_RVMARKER ISD node,
which gets turned into the CALL{32,64}_RVMARKER pseudo, which eventually gets
expanded into the sequence mentioned above. The sequence is then marked
as instruction bundle, to avoid anything being moved in between.

@ahatanak is working on using this attribute in the front- & middle-end.

Together with the front- & middle-end changes, this should address
PR31925 for X86.

This is the X86 version of 46bc40e50246c1902a1ca7916c8286cb837643ee,
which added similar support for AArch64.

Diff Detail

Event Timeline

fhahn created this revision.Wed, Jan 13, 6:11 AM
fhahn requested review of this revision.Wed, Jan 13, 6:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptWed, Jan 13, 6:11 AM
Herald added a subscriber: wdng. · View Herald Transcript
fhahn added a comment.Wed, Jan 13, 6:20 AM

I am not too familiar with how calls are handled in the X86 backend. I would really appreciate any pointers to cases that this approach might miss.

This is only relevant for Objective-C code on X86, so it would probably be OK to drop support for the CALL32* variants?

RKSimon resigned from this revision.Thu, Jan 14, 2:06 AM
RKSimon added a reviewer: pengfei.
skan added a subscriber: skan.Mon, Jan 18, 6:07 PM