mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 04:32:44 +01:00
361e5d3bdf
This ports the MergeFunctions pass to the NewPM. This was rather straightforward, as no analyses are used. Additionally MergeFunctions needs to be conditionally enabled in the PassBuilder, but I left that part out of this patch. Differential Revision: https://reviews.llvm.org/D72537
33 lines
1.0 KiB
C++
33 lines
1.0 KiB
C++
//===- MergeFunctions.h - Merge Identical Functions -------------*- C++ -*-===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This pass transforms simple global variables that never have their address
|
|
// taken. If obviously true, it marks read/write globals as constant, deletes
|
|
// variables only stored to, etc.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_TRANSFORMS_IPO_MERGEFUNCTIONS_H
|
|
#define LLVM_TRANSFORMS_IPO_MERGEFUNCTIONS_H
|
|
|
|
#include "llvm/IR/PassManager.h"
|
|
|
|
namespace llvm {
|
|
|
|
class Module;
|
|
|
|
/// Merge identical functions.
|
|
class MergeFunctionsPass : public PassInfoMixin<MergeFunctionsPass> {
|
|
public:
|
|
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
|
|
};
|
|
|
|
} // end namespace llvm
|
|
|
|
#endif // LLVM_TRANSFORMS_IPO_MERGEFUNCTIONS_H
|