[PATCH] D94597: [X86] Lower calls with rv_marker attribute.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 13 06:11:58 PST 2021


fhahn created this revision.
fhahn added reviewers: ahatanak, t.p.northover, ab, RKSimon, arsenm.
Herald added subscribers: pengfei, hiraditya, kristof.beyls.
fhahn requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

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 <https://reviews.llvm.org/rG46bc40e50246c1902a1ca7916c8286cb837643ee>,
which added similar support for AArch64.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D94597

Files:
  llvm/lib/Target/X86/X86ExpandPseudo.cpp
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/lib/Target/X86/X86ISelLowering.h
  llvm/lib/Target/X86/X86InstrControl.td
  llvm/lib/Target/X86/X86InstrInfo.td
  llvm/test/CodeGen/X86/call-rv-marker.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94597.316378.patch
Type: text/x-patch
Size: 8024 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210113/a82a1463/attachment.bin>


More information about the llvm-commits mailing list