// FIXME: This pass may be useful for other targets too.
//===----------------------------------------------------------------------===//
-#define DEBUG_TYPE "arm64-promote-const"
#include "ARM64.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/DenseMap.h"
using namespace llvm;
+#define DEBUG_TYPE "arm64-promote-const"
+
// Stress testing mode - disable heuristics.
static cl::opt<bool> Stress("arm64-stress-promote-const", cl::Hidden,
cl::desc("Promote all vector constants"));
static char ID;
ARM64PromoteConstant() : ModulePass(ID) {}
- virtual const char *getPassName() const { return "ARM64 Promote Constant"; }
+ const char *getPassName() const override { return "ARM64 Promote Constant"; }
/// Iterate over the functions and promote the interesting constants into
/// global variables with module scope.
- bool runOnModule(Module &M) {
+ bool runOnModule(Module &M) override {
DEBUG(dbgs() << getPassName() << '\n');
bool Changed = false;
for (auto &MF : M) {
bool runOnFunction(Function &F);
// This transformation requires dominator info
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
+ void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesCFG();
AU.addRequired<DominatorTreeWrapperPass>();
AU.addPreserved<DominatorTreeWrapperPass>();
ModuleToMergedGV.find(M);
if (MapIt == ModuleToMergedGV.end()) {
PromotedGV = new GlobalVariable(
- *M, Cst->getType(), true, GlobalValue::InternalLinkage, 0,
- "_PromotedConst", 0, GlobalVariable::NotThreadLocal);
+ *M, Cst->getType(), true, GlobalValue::InternalLinkage, nullptr,
+ "_PromotedConst", nullptr, GlobalVariable::NotThreadLocal);
PromotedGV->setInitializer(Cst);
ModuleToMergedGV[M] = PromotedGV;
DEBUG(dbgs() << "Global replacement: ");