[all-commits] [llvm/llvm-project] 20faf7: [ThinLTO] Add noRecurse and noUnwind thinlink func...

modiking via All-commits all-commits at lists.llvm.org
Mon Sep 27 12:28:24 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 20faf789199d31a40c7f1a359361980c65067aab
      https://github.com/llvm/llvm-project/commit/20faf789199d31a40c7f1a359361980c65067aab
  Author: modimo <modimo at fb.com>
  Date:   2021-09-27 (Mon, 27 Sep 2021)

  Changed paths:
    M clang/test/CodeGen/thinlto-distributed-cfi-devirt.ll
    M clang/test/CodeGen/thinlto-distributed-cfi.ll
    A clang/test/CodeGen/thinlto-funcattr-prop.ll
    M llvm/include/llvm/AsmParser/LLToken.h
    M llvm/include/llvm/IR/GlobalValue.h
    M llvm/include/llvm/IR/ModuleSummaryIndex.h
    M llvm/include/llvm/LTO/LTO.h
    M llvm/include/llvm/Transforms/IPO/FunctionAttrs.h
    M llvm/include/llvm/Transforms/IPO/FunctionImport.h
    M llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
    M llvm/lib/AsmParser/LLLexer.cpp
    M llvm/lib/AsmParser/LLParser.cpp
    M llvm/lib/Bitcode/Reader/BitcodeReader.cpp
    M llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
    M llvm/lib/IR/AsmWriter.cpp
    M llvm/lib/IR/ModuleSummaryIndex.cpp
    M llvm/lib/LTO/LTO.cpp
    M llvm/lib/LTO/LTOBackend.cpp
    M llvm/lib/LTO/ThinLTOCodeGenerator.cpp
    M llvm/lib/Transforms/IPO/FunctionAttrs.cpp
    M llvm/lib/Transforms/IPO/FunctionImport.cpp
    M llvm/test/Assembler/thinlto-summary.ll
    M llvm/test/Bitcode/thinlto-function-summary-refgraph.ll
    M llvm/test/Bitcode/thinlto-type-vcalls.ll
    M llvm/test/ThinLTO/X86/deadstrip.ll
    M llvm/test/ThinLTO/X86/dot-dumper.ll
    M llvm/test/ThinLTO/X86/dot-dumper2.ll
    A llvm/test/ThinLTO/X86/funcattrs-prop-exported-internal.ll
    A llvm/test/ThinLTO/X86/funcattrs-prop-maythrow.ll
    A llvm/test/ThinLTO/X86/funcattrs-prop-undefined.ll
    A llvm/test/ThinLTO/X86/funcattrs-prop-unknown.ll
    A llvm/test/ThinLTO/X86/funcattrs-prop-weak.ll
    A llvm/test/ThinLTO/X86/funcattrs-prop.ll
    M llvm/test/ThinLTO/X86/funcimport_alwaysinline.ll
    M llvm/test/ThinLTO/X86/function_entry_count.ll
    M llvm/test/ThinLTO/X86/linkonce_resolution_comdat.ll

  Log Message:
  -----------
  [ThinLTO] Add noRecurse and noUnwind thinlink function attribute propagation

Thinlink provides an opportunity to propagate function attributes across modules, enabling additional propagation opportunities.

This change propagates (currently default off, turn on with `disable-thinlto-funcattrs=1`) noRecurse and noUnwind based off of function summaries of the prevailing functions in bottom-up call-graph order. Testing on clang self-build:
1. There's a 35-40% increase in noUnwind functions due to the additional propagation opportunities.
2. Throughput is measured at 10-15% increase in thinlink time which itself is 1.5% of E2E link time.

Implementation-wise this adds the following summary function attributes:
1. noUnwind: function is noUnwind
2. mayThrow: function contains a non-call instruction that `Instruction::mayThrow` returns true on (e.g. windows SEH instructions)
3. hasUnknownCall: function contains calls that don't make it into the summary call-graph thus should not be propagated from (e.g. indirect for now, could add no-opt functions as well)

Testing:
Clang self-build passes and 2nd stage build passes check-all
ninja check-all with newly added tests passing

Reviewed By: tejohnson

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




More information about the All-commits mailing list