mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
beb273cb73
Besides a general consistently benefit, the extra layer of indirection allows the mechanical part of https://reviews.llvm.org/D23256 that requires touching every transformation and analysis to be factored out cleanly. Thanks to David for the suggestion. llvm-svn: 278078
33 lines
1019 B
C++
33 lines
1019 B
C++
//===- GlobalOpt.h - Optimize Global Variables ------------------*- C++ -*-===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This pass transforms simple global variables that never have their address
|
|
// taken. If obviously true, it marks read/write globals as constant, deletes
|
|
// variables only stored to, etc.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_TRANSFORMS_IPO_GLOBALOPT_H
|
|
#define LLVM_TRANSFORMS_IPO_GLOBALOPT_H
|
|
|
|
#include "llvm/IR/Module.h"
|
|
#include "llvm/IR/PassManager.h"
|
|
|
|
namespace llvm {
|
|
|
|
/// Optimize globals that never have their address taken.
|
|
class GlobalOptPass : public PassInfoMixin<GlobalOptPass> {
|
|
public:
|
|
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
|
|
};
|
|
|
|
}
|
|
|
|
#endif // LLVM_TRANSFORMS_IPO_GLOBALOPT_H
|