[all-commits] [llvm/llvm-project] fee0bd: [WPD] Extend checking mode to support fallback to ...

Teresa Johnson via All-commits all-commits at lists.llvm.org
Mon Mar 14 10:16:53 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fee0bde4c6bbee8dd21865b91d422395f4c1202b
      https://github.com/llvm/llvm-project/commit/fee0bde4c6bbee8dd21865b91d422395f4c1202b
  Author: Teresa Johnson <tejohnson at google.com>
  Date:   2022-03-14 (Mon, 14 Mar 2022)

  Changed paths:
    M llvm/include/llvm/Transforms/Utils/CallPromotionUtils.h
    M llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
    M llvm/lib/Transforms/Utils/CallPromotionUtils.cpp
    M llvm/test/ThinLTO/X86/devirt.ll
    M llvm/test/ThinLTO/X86/devirt_check.ll

  Log Message:
  -----------
  [WPD] Extend checking mode to support fallback to indirect call

Extend -wholeprogramdevirt-check to support both the existing
trapping mode on an incorrect devirtualization, as well as a new
mode to fallback to an indirect call on a mismatch. The new mode is

The new mode is useful in cases where we want to enable
devirtualization but cannot fully guarantee whole program visibility
(e.g in the case where LTO has been disabled for a small set of objects
that could potentially override virtual methods without having a symbol
reference to anything in the base class including the vtable).

Remove !prof and !callees metadata (which are used by indirect call
promotion) from both the new direct call and the fallback indirect call
(so that we don't perform another round of promotion on the latter).
Also remove it from the direct call in the non-fallback cases, which
was an oversight, although it didn't seem to cause any issues. Add tests
for the metadata removal covering the various cases.

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




More information about the All-commits mailing list