[PATCH] D115492: [LTO] Ignore unreachable virtual functions in WPD in hybrid LTO

Mingming Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 9 23:33:24 PST 2021


luna created this revision.
Herald added subscribers: ormris, pengfei, arphaman, steven_wu, hiraditya, inglorion.
luna requested review of this revision.
Herald added projects: clang, LLVM.
Herald added subscribers: llvm-commits, cfe-commits.

- In FunctionSummary, add a new bit `mustBeUnreachable`.

- In ModuleSummaryAnalysis, set this bit to 1 if a function is unreachable.

- For hybrid LTO, ignore unreachable functions (by reading from index) when finding virtual functions. This helps to de-virtualize. See the test case in llvm/test/ThinLTO/X86/devirt_hybrid_after_filtering_unreachable.ll


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D115492

Files:
  clang/test/CodeGen/thinlto-distributed-cfi-devirt.ll
  clang/test/CodeGen/thinlto-distributed-cfi.ll
  clang/test/CodeGen/thinlto-funcattr-prop.ll
  llvm/include/llvm/AsmParser/LLToken.h
  llvm/include/llvm/IR/ModuleSummaryIndex.h
  llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
  llvm/lib/AsmParser/LLLexer.cpp
  llvm/lib/AsmParser/LLParser.cpp
  llvm/lib/Bitcode/Reader/BitcodeReader.cpp
  llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
  llvm/lib/IR/ModuleSummaryIndex.cpp
  llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
  llvm/test/Assembler/thinlto-summary.ll
  llvm/test/Bitcode/thinlto-function-summary-refgraph.ll
  llvm/test/Bitcode/thinlto-type-vcalls.ll
  llvm/test/ThinLTO/X86/Inputs/devirt_hybrid_after_filtering_unreachable_lib.ll
  llvm/test/ThinLTO/X86/devirt_hybrid_after_filtering_unreachable.ll
  llvm/test/ThinLTO/X86/devirt_single_hybrid.ll
  llvm/test/ThinLTO/X86/dot-dumper.ll
  llvm/test/ThinLTO/X86/dot-dumper2.ll
  llvm/test/ThinLTO/X86/funcattrs-prop-maythrow.ll
  llvm/test/ThinLTO/X86/funcimport_alwaysinline.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115492.393382.patch
Type: text/x-patch
Size: 67564 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211210/529629d1/attachment-0001.bin>


More information about the llvm-commits mailing list