[all-commits] [llvm/llvm-project] 3be6db: [ThinLTO] Promotion handling cleanup (NFC)

Teresa Johnson via All-commits all-commits at lists.llvm.org
Mon Nov 18 11:59:51 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 3be6dbca3b88e82009e1990957c15b94455c1714
      https://github.com/llvm/llvm-project/commit/3be6dbca3b88e82009e1990957c15b94455c1714
  Author: Teresa Johnson <tejohnson at google.com>
  Date:   2019-11-18 (Mon, 18 Nov 2019)

  Changed paths:
    M llvm/include/llvm/Transforms/Utils/FunctionImportUtils.h
    M llvm/lib/Transforms/Utils/FunctionImportUtils.cpp

  Log Message:
  -----------
  [ThinLTO] Promotion handling cleanup (NFC)

Summary:
Clean up the code that does GV promotion in the ThinLTO backends.

Specifically, we don't need to check whether we are importing since that
is already checked and handled correctly in shouldPromoteLocalToGlobal.
Simply call shouldPromoteLocalToGlobal, and if it returns true we are
guaranteed that we are promoting, whether or not we are importing (or in
the exporting module). This also makes the handling in getName()
consistent with that in getLinkage(), which checks the DoPromote parameter
regardless of whether we are importing or exporting.

Reviewers: steven_wu, pcc, evgeny777

Subscribers: mehdi_amini, inglorion, hiraditya, dexonsmith, llvm-commits

Tags: #llvm

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




More information about the All-commits mailing list