1 //===- llvm/Transforms/ConstantMerge.h - Merge duplicate consts --*- C++ -*--=//
3 // This file defines the interface to a pass that merges duplicate global
4 // constants together into a single constant that is shared. This is useful
5 // because some passes (ie TraceValues) insert a lot of string constants into
6 // the program, regardless of whether or not they duplicate an existing string.
8 // Algorithm: ConstantMerge is designed to build up a map of available constants
9 // and elminate duplicates when it is initialized.
11 // The DynamicConstantMerge method is a superset of the ConstantMerge algorithm
12 // that checks for each method to see if constants have been added to the
13 // constant pool since it was last run... if so, it processes them.
15 //===----------------------------------------------------------------------===//
17 #ifndef LLVM_TRANSFORMS_CONSTANTMERGE_H
18 #define LLVM_TRANSFORMS_CONSTANTMERGE_H
21 Pass *createConstantMergePass();
22 Pass *createDynamicConstantMergePass();