LLVM  8.0.1
ConstantMerge.h
Go to the documentation of this file.
1 //===- ConstantMerge.h - Merge duplicate global constants -------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines the interface to a pass that merges duplicate global
11 // constants together into a single constant that is shared. This is useful
12 // because some passes (ie TraceValues) insert a lot of string constants into
13 // the program, regardless of whether or not an existing string is available.
14 //
15 // Algorithm: ConstantMerge is designed to build up a map of available constants
16 // and eliminate duplicates when it is initialized.
17 //
18 //===----------------------------------------------------------------------===//
19 
20 #ifndef LLVM_TRANSFORMS_IPO_CONSTANTMERGE_H
21 #define LLVM_TRANSFORMS_IPO_CONSTANTMERGE_H
22 
23 #include "llvm/IR/PassManager.h"
24 
25 namespace llvm {
26 
27 class Module;
28 
29 /// A pass that merges duplicate global constants into a single constant.
30 class ConstantMergePass : public PassInfoMixin<ConstantMergePass> {
31 public:
33 };
34 
35 } // end namespace llvm
36 
37 #endif // LLVM_TRANSFORMS_IPO_CONSTANTMERGE_H
This class represents lattice values for constants.
Definition: AllocatorList.h:24
A Module instance is used to store all the information related to an LLVM module. ...
Definition: Module.h:65
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:366
A set of analyses that are preserved following a run of a transformation pass.
Definition: PassManager.h:154
A pass that merges duplicate global constants into a single constant.
Definition: ConstantMerge.h:30
PreservedAnalyses run(Module &M, ModuleAnalysisManager &)
A container for analyses that lazily runs them and caches their results.
This header defines various interfaces for pass management in LLVM.