LLVM  4.0.0
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/Module.h"
24 #include "llvm/IR/PassManager.h"
25 
26 namespace llvm {
27 
28 /// A pass that merges duplicate global constants into a single constant.
29 class ConstantMergePass : public PassInfoMixin<ConstantMergePass> {
30 public:
32 };
33 }
34 
35 #endif // LLVM_TRANSFORMS_IPO_CONSTANTMERGE_H
A Module instance is used to store all the information related to an LLVM module. ...
Definition: Module.h:52
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:311
A set of analyses that are preserved following a run of a transformation pass.
Definition: PassManager.h:107
Module.h This file contains the declarations for the Module class.
A pass that merges duplicate global constants into a single constant.
Definition: ConstantMerge.h:29
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.