Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:44:40

0001 //===- ConstantMerge.h - Merge duplicate global constants -------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 // This file defines the interface to a pass that merges duplicate global
0010 // constants together into a single constant that is shared.  This is useful
0011 // because some passes (ie TraceValues) insert a lot of string constants into
0012 // the program, regardless of whether or not an existing string is available.
0013 //
0014 // Algorithm: ConstantMerge is designed to build up a map of available constants
0015 // and eliminate duplicates when it is initialized.
0016 //
0017 //===----------------------------------------------------------------------===//
0018 
0019 #ifndef LLVM_TRANSFORMS_IPO_CONSTANTMERGE_H
0020 #define LLVM_TRANSFORMS_IPO_CONSTANTMERGE_H
0021 
0022 #include "llvm/IR/PassManager.h"
0023 
0024 namespace llvm {
0025 
0026 class Module;
0027 
0028 /// A pass that merges duplicate global constants into a single constant.
0029 class ConstantMergePass : public PassInfoMixin<ConstantMergePass> {
0030 public:
0031   PreservedAnalyses run(Module &M, ModuleAnalysisManager &);
0032 };
0033 
0034 } // end namespace llvm
0035 
0036 #endif // LLVM_TRANSFORMS_IPO_CONSTANTMERGE_H