25class SystemZAlignGlobalsLegacy :
public ModulePass {
29 explicit SystemZAlignGlobalsLegacy() : ModulePass(ID) {}
31 StringRef getPassName()
const override {
return "SystemZ Align Globals"; }
33 bool runOnModule(
Module &M)
override;
38char SystemZAlignGlobalsLegacy::ID = 0;
41 "Try aligning globals to 2 bytes",
false,
false)
44 return new SystemZAlignGlobalsLegacy();
52 if (!GVAlign || GVAlign.value() > 1)
55 if (!GV.canIncreaseAlignment())
58 GV.setAlignment(
Align(2));
65bool SystemZAlignGlobalsLegacy::runOnModule(
Module &M) {
Module.h This file contains the declarations for the Module class.
This header defines various interfaces for pass management in LLVM.
ModuleAnalysisManager MAM
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
static bool alignGlobalsInModule(Module &M)
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
A Module instance is used to store all the information related to an LLVM module.
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses none()
Convenience factory function for the empty preserved set.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM)
Pass manager infrastructure for declaring and invalidating analyses.
This is an optimization pass for GlobalISel generic memory operations.
ModulePass * createSystemZAlignGlobalsLegacyPass()
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
This struct is a compact representation of a valid (non-zero power of two) alignment.
This struct is a compact representation of a valid (power of two) or undefined (0) alignment.