[all-commits] [llvm/llvm-project] e80ee4: [GlobalDCE] In VFE support for relative pointers, ...

Kuba (Brecka) Mracek via All-commits all-commits at lists.llvm.org
Mon Sep 13 15:22:34 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e80ee4cbd9a79efa99cabdbb42faba7c7b01e70e
      https://github.com/llvm/llvm-project/commit/e80ee4cbd9a79efa99cabdbb42faba7c7b01e70e
  Author: Kuba Mracek <mracek at apple.com>
  Date:   2021-09-13 (Mon, 13 Sep 2021)

  Changed paths:
    M llvm/lib/Analysis/TypeMetadataUtils.cpp
    A llvm/test/Transforms/GlobalDCE/virtual-functions-relative-pointers-gep.ll

  Log Message:
  -----------
  [GlobalDCE] In VFE support for relative pointers, allow GEP references to the base symbol

This is for Swift VFE support. In some vtable forms that Swift emits, the "base" of a relative pointer is not the global symbol itself directly, but a GEP into it -- so the pointer is relative to a particular field in the global. So getPointerAtOffset() needs to be able to see through the GEP and allow it in a SUB expression, to correctly recognize the offset as a vtable slot.

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




More information about the All-commits mailing list