[PATCH] D72721: [BranchAlign] Disable autopadding in cold blocks to reduce code size impact

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 14 10:23:27 PST 2020


reames created this revision.
reames added reviewers: annita.zhang, skan, fedor.sergeev, craig.topper, andrew.w.kaylor, MaskRay, jyknight, andrewluo, tstellar.
Herald added subscribers: bollu, hiraditya, mcrosier.
Herald added a project: LLVM.

This change builds on the compiler support for selectively disabling assembler inserted padding - we really need the assembler syntax finalized - to selectively disable nop/prefix insertion in cold basic blocks.  This has the effect of reducing the code size impact of the branch alignment mitigation.

Based on some quick manual analysis of our assembly on a randomly chosen java workload, padding in slow paths was the most glaringly obvious deficiency with what's currently checked in.

For the moment, the detection of a cold region follows the precedent used elsewhere in the backend and relies on ProfileSummaryInfo.  This may change in the future as I can't really find documentation for what this is, or how a frontend might generate it.  I figured it was better to get something in and tested then to roll too much into one change, so expect some follow up there.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D72721

Files:
  llvm/include/llvm/MC/MCStreamer.h
  llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
  llvm/lib/MC/MCParser/AsmParser.cpp
  llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
  llvm/lib/Target/X86/X86MCInstLower.cpp
  llvm/test/CodeGen/X86/align-branch-boundary-pgo.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72721.238024.patch
Type: text/x-patch
Size: 9263 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200114/3060d0f7/attachment.bin>


More information about the llvm-commits mailing list