1 //===- GlobalOpt.h - Optimize Global Variables ------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 // This pass transforms simple global variables that never have their address
10 // taken. If obviously true, it marks read/write globals as constant, deletes
11 // variables only stored to, etc.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_TRANSFORMS_IPO_GLOBALOPT_H
16 #define LLVM_TRANSFORMS_IPO_GLOBALOPT_H
18 #include "llvm/IR/PassManager.h"
24 /// Optimize globals that never have their address taken.
25 class GlobalOptPass
: public PassInfoMixin
<GlobalOptPass
> {
27 PreservedAnalyses
run(Module
&M
, ModuleAnalysisManager
&AM
);
30 } // end namespace llvm
32 #endif // LLVM_TRANSFORMS_IPO_GLOBALOPT_H