[all-commits] [llvm/llvm-project] d1a838: Basic block sections should enable function sectio...

Sriraman Tallam via All-commits all-commits at lists.llvm.org
Tue Feb 16 16:30:35 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d1a838babcc3360eb7e311006a4acd1eee61b8f2
      https://github.com/llvm/llvm-project/commit/d1a838babcc3360eb7e311006a4acd1eee61b8f2
  Author: Sriraman Tallam <tmsriram at google.com>
  Date:   2021-02-16 (Tue, 16 Feb 2021)

  Changed paths:
    M llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
    M llvm/include/llvm/Target/TargetLoweringObjectFile.h
    M llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
    M llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
    M llvm/lib/Target/TargetLoweringObjectFile.cpp
    M llvm/test/CodeGen/X86/basic-block-sections-blockaddress-taken.ll
    M llvm/test/CodeGen/X86/basic-block-sections-list.ll
    M llvm/test/CodeGen/X86/basic-block-sections-mir-parse.mir
    M llvm/test/CodeGen/X86/basic-block-sections-unreachable.ll
    M llvm/test/CodeGen/X86/basic-block-sections.ll
    M llvm/test/DebugInfo/X86/basic-block-sections_1.ll

  Log Message:
  -----------
  Basic block sections should enable function sections implicitly.

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.

This is the first of two patches and this adds functionality in LLVM to
create a new section for the entry block if function sections is not
enabled.

Differential Revision: https://reviews.llvm.org/D93876




More information about the All-commits mailing list