[PATCH] D126111: [BOLT] Increase coverage of shrink wrapping [1/5]

Rafael Auler via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 20 20:20:32 PDT 2022


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

Change how function score is calculated and provide more
detailed statistics when reporting back frame optimizer and shrink
wrapping results. In this new statistics, we provide dynamic coverage
numbers. The main metric for shrink wrapping is the number of executed
stores that were saved because of shrink wrapping (push instructions
that were either entirely moved away from the hot block or converted
to a stack adjustment instruction). There is still a number of reduced
load instructions (pop) that we are not counting at the moment. Also
update alloc combiner to report dynamic numbers, as well as frame
optimizer.

For debugging purposes, we also include a list of top 10 functions
optimized by shrink wrapping. These changes are aimed at better
understanding the impact of shrink wrapping in a given binary.

We also remove an assertion in dataflow analysis to do not choke on
empty functions (which makes no sense).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D126111

Files:
  bolt/include/bolt/Passes/AllocCombiner.h
  bolt/include/bolt/Passes/DataflowAnalysis.h
  bolt/include/bolt/Passes/FrameAnalysis.h
  bolt/include/bolt/Passes/FrameOptimizer.h
  bolt/include/bolt/Passes/ShrinkWrapping.h
  bolt/lib/Core/BinaryFunction.cpp
  bolt/lib/Passes/AllocCombiner.cpp
  bolt/lib/Passes/FrameAnalysis.cpp
  bolt/lib/Passes/FrameOptimizer.cpp
  bolt/lib/Passes/ShrinkWrapping.cpp
  bolt/test/X86/shrinkwrapping-pop-order.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126111.431116.patch
Type: text/x-patch
Size: 16935 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220521/7f7e1ea6/attachment.bin>


More information about the llvm-commits mailing list