[PATCH] D93876: Do not implicitly turn on function sections with basic block sections.

Sriraman Tallam via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 28 15:43:42 PST 2020


tmsriram created this revision.
tmsriram added reviewers: rahmanl, snehasish, shenhan, efriedma.
Herald added subscribers: pengfei, hiraditya.
tmsriram requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Basic block sections enables function sections implicitly, this is not needed and is inefficient with "=list" option.

We had basic block sections enable function sections implicitly in clang.  This is particularly inefficient with "=list" option as it places functions that do not have any basic block sections in separate sections. This causes unnecessary object file overhead for large applications.

This patch disables this implicit behavior.  It only creates function sections for those functions that require basic block sections.

Further, there was an inconistent behavior with llc as llc was not turning on function sections by default.  This patch makes llc and clang consistent and tests are added to check the new behavior.


https://reviews.llvm.org/D93876

Files:
  clang/lib/Frontend/CompilerInvocation.cpp
  clang/test/CodeGen/basic-block-sections.c
  llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
  llvm/include/llvm/Target/TargetLoweringObjectFile.h
  llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
  llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
  llvm/lib/Target/TargetLoweringObjectFile.cpp
  llvm/test/CodeGen/X86/basic-block-sections-blockaddress-taken.ll
  llvm/test/CodeGen/X86/basic-block-sections-mir-parse.mir
  llvm/test/CodeGen/X86/basic-block-sections-unreachable.ll
  llvm/test/CodeGen/X86/basic-block-sections.ll
  llvm/test/DebugInfo/X86/basic-block-sections_1.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93876.313909.patch
Type: text/x-patch
Size: 9661 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201228/6e7adaee/attachment.bin>


More information about the llvm-commits mailing list