[all-commits] [llvm/llvm-project] 748bb5: [WPD/LowerTypeTests] Delay lowering/removal of typ...

Teresa Johnson via All-commits all-commits at lists.llvm.org
Wed Feb 5 09:00:04 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 748bb5a0f1964d20dfb3891b0948ab6c66236c70
      https://github.com/llvm/llvm-project/commit/748bb5a0f1964d20dfb3891b0948ab6c66236c70
  Author: Teresa Johnson <tejohnson at google.com>
  Date:   2020-02-05 (Wed, 05 Feb 2020)

  Changed paths:
    M llvm/include/llvm/IR/ModuleSummaryIndex.h
    M llvm/include/llvm/IR/ModuleSummaryIndexYAML.h
    M llvm/lib/AsmParser/LLParser.cpp
    M llvm/lib/IR/AsmWriter.cpp
    M llvm/lib/Passes/PassBuilder.cpp
    M llvm/lib/Transforms/IPO/LowerTypeTests.cpp
    M llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
    M llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
    M llvm/test/Bitcode/summary_version.ll
    M llvm/test/Other/new-pm-lto-defaults.ll
    M llvm/test/Other/new-pm-thinlto-defaults.ll
    M llvm/test/Other/new-pm-thinlto-postlink-pgo-defaults.ll
    M llvm/test/Other/new-pm-thinlto-postlink-samplepgo-defaults.ll
    M llvm/test/Transforms/WholeProgramDevirt/branch-funnel.ll
    M llvm/test/Transforms/WholeProgramDevirt/devirt-single-impl2.ll
    M llvm/test/Transforms/WholeProgramDevirt/export-single-impl.ll
    M llvm/test/Transforms/WholeProgramDevirt/export-uniform-ret-val.ll
    M llvm/test/Transforms/WholeProgramDevirt/export-unique-ret-val.ll
    M llvm/test/Transforms/WholeProgramDevirt/export-vcp.ll
    M llvm/test/Transforms/WholeProgramDevirt/import-indir.ll
    M llvm/test/Transforms/WholeProgramDevirt/uniform-retval.ll

  Log Message:
  -----------
  [WPD/LowerTypeTests] Delay lowering/removal of type tests until after ICP

Summary:
Currently type test assume sequences inserted for devirtualization are
removed during WPD. This patch delays their removal until later in the
optimization pipeline. This is an enabler for upcoming enhancements to
indirect call promotion, for example streamlined promotion guard
sequences that compare against vtable address instead of the target
function, when there are small number of possible vtables (either
determined via WPD or by in-progress type profiling). We need the type
tests to correlate the callsites with the address point offset needed in
the compare sequence, and optionally to associated type summary info
computed during WPD.

This depends on work in D71913 to enable invocation of LowerTypeTests to
drop type test assume sequences, which will now be invoked following ICP
in the ThinLTO post-LTO link pipelines, and also after the existing
export phase LowerTypeTests invocation in regular LTO (which is already
after ICP). We cannot simply move the existing import phase
LowerTypeTests pass later in the ThinLTO post link pipelines, as the
comment in PassBuilder.cpp notes (it must run early because when
performing CFI other passes may disturb the sequences it looks for).

This necessitated adding a new type test resolution "Unknown" that we
can use on the type test assume sequences previously removed by WPD,
that we now want LTT to ignore.

Depends on D71913.

Reviewers: pcc, evgeny777

Subscribers: mehdi_amini, Prazek, hiraditya, steven_wu, dexonsmith, arphaman, davidxl, cfe-commits, llvm-commits

Tags: #clang, #llvm

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




More information about the All-commits mailing list