[PATCH] D128696: [BOLT] Fix trampoline code for shared libraries and PIEs

Maksim Panchenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 27 21:02:33 PDT 2022


maksfb created this revision.
maksfb added reviewers: yota9, Amir, ayermolo, rafauler, zr33, nhuhuan, FPar.
Herald added a project: All.
maksfb requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

When SplitFunctions pass adds a trampoline code for exceptions landing
pads, it may increase the size of the hot code past an acceptable
threshold and trigger the revert of the splitting.

However, if createEHTrampolines() added new blocks to the CFG and
modified invoke instructions, simply restoring the original block layout
will not suffice. In such case, modify the original layout by merging in
trampoline blocks right before their matching targets. As a result, the
number of blocks will increase, but the number of instructions will stay
the same.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D128696

Files:
  bolt/include/bolt/Core/BinaryFunction.h
  bolt/include/bolt/Passes/SplitFunctions.h
  bolt/lib/Passes/SplitFunctions.cpp
  bolt/test/runtime/X86/Inputs/pie-exceptions-failed-split.s
  bolt/test/runtime/X86/pie-exceptions-failed-split.test

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128696.440464.patch
Type: text/x-patch
Size: 15649 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220628/152bc452/attachment.bin>


More information about the llvm-commits mailing list