LLVM 19.0.0git
MemProfContextDisambiguation.h
Go to the documentation of this file.
1//==- MemProfContextDisambiguation.h - Context Disambiguation ----*- C++ -*-==//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// Implements support for context disambiguation of allocation calls for profile
10// guided heap optimization using memprof metadata. See implementation file for
11// details.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_TRANSFORMS_IPO_MEMPROF_CONTEXT_DISAMBIGUATION_H
16#define LLVM_TRANSFORMS_IPO_MEMPROF_CONTEXT_DISAMBIGUATION_H
17
18#include "llvm/IR/GlobalValue.h"
20#include "llvm/IR/PassManager.h"
21#include <functional>
22
23namespace llvm {
24class GlobalValueSummary;
25class Module;
26class OptimizationRemarkEmitter;
27
29 : public PassInfoMixin<MemProfContextDisambiguation> {
30 /// Run the context disambiguator on \p M, returns true if any changes made.
31 bool processModule(
32 Module &M,
34
35 /// In the ThinLTO backend, apply the cloning decisions in ImportSummary to
36 /// the IR.
37 bool applyImport(Module &M);
38
39 /// Import summary containing cloning decisions for the ThinLTO backend.
40 const ModuleSummaryIndex *ImportSummary;
41
42 // Owns the import summary specified by internal options for testing the
43 // ThinLTO backend via opt (to simulate distributed ThinLTO).
44 std::unique_ptr<ModuleSummaryIndex> ImportSummaryForTesting;
45
46public:
47 MemProfContextDisambiguation(const ModuleSummaryIndex *Summary = nullptr);
48
50
53 isPrevailing);
54};
55} // end namespace llvm
56
57#endif // LLVM_TRANSFORMS_IPO_MEMPROF_CONTEXT_DISAMBIGUATION_H
Machine Check Debug Module
ModuleSummaryIndex.h This file contains the declarations the classes that hold the module index and s...
This header defines various interfaces for pass management in LLVM.
A container for analyses that lazily runs them and caches their results.
Definition: PassManager.h:348
Function and variable summary information to aid decisions and implementation of importing.
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
Class to hold module path string table and global value map, and encapsulate methods for operating on...
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
The optimization diagnostic interface.
A set of analyses that are preserved following a run of a transformation pass.
Definition: Analysis.h:109
An efficient, type-erasing, non-owning reference to a callable.
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:91