[all-commits] [llvm/llvm-project] 58725c: [OpenMP] Introduce RAII to protect certain RTL cal...

Joseph Huber via All-commits all-commits at lists.llvm.org
Sun Jul 25 11:16:05 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 58725c12bb2746a3f82b4aafc84ff9284e4a991e
      https://github.com/llvm/llvm-project/commit/58725c12bb2746a3f82b4aafc84ff9284e4a991e
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2021-07-25 (Sun, 25 Jul 2021)

  Changed paths:
    M llvm/lib/Transforms/IPO/OpenMPOpt.cpp

  Log Message:
  -----------
  [OpenMP] Introduce RAII to protect certain RTL calls from DCE

This patch introduces a new RAII struct that will temporarily make an OpenMP
RTL function have external linkage. This is done before the attributor is
invoked to prevent it from incorrectly removing some function definitions that
we will use later. For example, if we determine all calls to one function are
dead, because it has internal linkage it can safely be removed. Later when we
try to get an instance to that function to modify the source using
`getOrCreateRuntimeFunction` we will then get an empty declaration for that
function that won't be defined anywhere. This patch prevents this from
occurring.

Reviewed By: jdoerfert

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




More information about the All-commits mailing list