diff --git a/llvm/include/llvm/Transforms/Scalar/GVN.h b/llvm/include/llvm/Transforms/Scalar/GVN.h --- a/llvm/include/llvm/Transforms/Scalar/GVN.h +++ b/llvm/include/llvm/Transforms/Scalar/GVN.h @@ -115,13 +115,13 @@ /// /// FIXME: We should have a good summary of the GVN algorithm implemented by /// this particular pass here. -class GVN : public PassInfoMixin { +class GVNPass : public PassInfoMixin { GVNOptions Options; public: struct Expression; - GVN(GVNOptions Options = {}) : Options(Options) {} + GVNPass(GVNOptions Options = {}) : Options(Options) {} /// Run the pass over the function. PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); @@ -182,11 +182,11 @@ Expression createExtractvalueExpr(ExtractValueInst *EI); uint32_t lookupOrAddCall(CallInst *C); uint32_t phiTranslateImpl(const BasicBlock *BB, const BasicBlock *PhiBlock, - uint32_t Num, GVN &Gvn); + uint32_t Num, GVNPass &Gvn); bool areCallValsEqual(uint32_t Num, uint32_t NewNum, const BasicBlock *Pred, - const BasicBlock *PhiBlock, GVN &Gvn); + const BasicBlock *PhiBlock, GVNPass &Gvn); std::pair assignExpNewValueNum(Expression &exp); - bool areAllValsInBB(uint32_t num, const BasicBlock *BB, GVN &Gvn); + bool areAllValsInBB(uint32_t num, const BasicBlock *BB, GVNPass &Gvn); public: ValueTable(); @@ -200,7 +200,7 @@ uint32_t lookupOrAddCmp(unsigned Opcode, CmpInst::Predicate Pred, Value *LHS, Value *RHS); uint32_t phiTranslate(const BasicBlock *BB, const BasicBlock *PhiBlock, - uint32_t Num, GVN &Gvn); + uint32_t Num, GVNPass &Gvn); void eraseTranslateCacheEntry(uint32_t Num, const BasicBlock &CurrBlock); bool exists(Value *V) const; void add(Value *V, uint32_t num); diff --git a/llvm/include/llvm/Transforms/Scalar/SROA.h b/llvm/include/llvm/Transforms/Scalar/SROA.h --- a/llvm/include/llvm/Transforms/Scalar/SROA.h +++ b/llvm/include/llvm/Transforms/Scalar/SROA.h @@ -62,7 +62,7 @@ /// onto insert and extract operations on a vector value, and convert them to /// this form. By doing so, it will enable promotion of vector aggregates to /// SSA vector values. -class SROA : public PassInfoMixin { +class SROAPass : public PassInfoMixin { LLVMContext *C = nullptr; DominatorTree *DT = nullptr; AssumptionCache *AC = nullptr; @@ -110,7 +110,7 @@ SetVector> SpeculatableSelects; public: - SROA() = default; + SROAPass() = default; /// Run the pass over the function. PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); diff --git a/llvm/lib/Passes/PassBuilderPipelines.cpp b/llvm/lib/Passes/PassBuilderPipelines.cpp --- a/llvm/lib/Passes/PassBuilderPipelines.cpp +++ b/llvm/lib/Passes/PassBuilderPipelines.cpp @@ -232,7 +232,7 @@ // Form SSA out of local memory accesses after breaking apart aggregates into // scalars. - FPM.addPass(SROA()); + FPM.addPass(SROAPass()); // Catch trivial redundancies FPM.addPass(EarlyCSEPass(true /* Enable mem-ssa. */)); @@ -323,7 +323,7 @@ /*UseBlockFrequencyInfo=*/false)); // Delete small array after loop unroll. - FPM.addPass(SROA()); + FPM.addPass(SROAPass()); // Specially optimize memory movement as it doesn't look like dataflow in SSA. FPM.addPass(MemCpyOptPass()); @@ -373,7 +373,7 @@ // Form SSA out of local memory accesses after breaking apart aggregates into // scalars. - FPM.addPass(SROA()); + FPM.addPass(SROAPass()); // Catch trivial redundancies FPM.addPass(EarlyCSEPass(true /* Enable mem-ssa. */)); @@ -498,7 +498,7 @@ /*UseBlockFrequencyInfo=*/false)); // Delete small array after loop unroll. - FPM.addPass(SROA()); + FPM.addPass(SROAPass()); // The matrix extension can introduce large vector operations early, which can // benefit from running vector-combine early on. @@ -510,7 +510,7 @@ if (RunNewGVN) FPM.addPass(NewGVNPass()); else - FPM.addPass(GVN()); + FPM.addPass(GVNPass()); // Sparse conditional constant propagation. // FIXME: It isn't clear why we do this *after* loop passes rather than @@ -590,7 +590,7 @@ CGSCCPassManager &CGPipeline = MIWP.getPM(); FunctionPassManager FPM; - FPM.addPass(SROA()); + FPM.addPass(SROAPass()); FPM.addPass(EarlyCSEPass()); // Catch trivial redundancies. FPM.addPass(SimplifyCFGPass()); // Merge & remove basic blocks. FPM.addPass(InstCombinePass()); // Combine silly sequences. @@ -778,7 +778,7 @@ // Compare/branch metadata may alter the behavior of passes like SimplifyCFG. EarlyFPM.addPass(LowerExpectIntrinsicPass()); EarlyFPM.addPass(SimplifyCFGPass()); - EarlyFPM.addPass(SROA()); + EarlyFPM.addPass(SROAPass()); EarlyFPM.addPass(EarlyCSEPass()); EarlyFPM.addPass(CoroEarlyPass()); if (Level == OptimizationLevel::O3) @@ -1508,7 +1508,7 @@ } // Break up allocas - FPM.addPass(SROA()); + FPM.addPass(SROAPass()); // LTO provides additional opportunities for tailcall elimination due to // link-time inlining, and visibility of nocapture attribute. @@ -1536,7 +1536,7 @@ if (RunNewGVN) MainFPM.addPass(NewGVNPass()); else - MainFPM.addPass(GVN()); + MainFPM.addPass(GVNPass()); // Remove dead memcpy()'s. MainFPM.addPass(MemCpyOptPass()); diff --git a/llvm/lib/Passes/PassRegistry.def b/llvm/lib/Passes/PassRegistry.def --- a/llvm/lib/Passes/PassRegistry.def +++ b/llvm/lib/Passes/PassRegistry.def @@ -337,7 +337,7 @@ FUNCTION_PASS("slp-vectorizer", SLPVectorizerPass()) FUNCTION_PASS("slsr", StraightLineStrengthReducePass()) FUNCTION_PASS("speculative-execution", SpeculativeExecutionPass()) -FUNCTION_PASS("sroa", SROA()) +FUNCTION_PASS("sroa", SROAPass()) FUNCTION_PASS("strip-gc-relocates", StripGCRelocates()) FUNCTION_PASS("structurizecfg", StructurizeCFGPass()) FUNCTION_PASS("tailcallelim", TailCallElimPass()) @@ -436,9 +436,9 @@ parseMergedLoadStoreMotionOptions, "no-split-footer-bb;split-footer-bb") FUNCTION_PASS_WITH_PARAMS("gvn", - "GVN", + "GVNPass", [](GVNOptions Opts) { - return GVN(Opts); + return GVNPass(Opts); }, parseGVNOptions, "no-pre;pre;" diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp --- a/llvm/lib/Transforms/Scalar/GVN.cpp +++ b/llvm/lib/Transforms/Scalar/GVN.cpp @@ -126,7 +126,7 @@ "into) when deducing if a value is fully available or not in GVN " "(default = 600)")); -struct llvm::GVN::Expression { +struct llvm::GVNPass::Expression { uint32_t opcode; bool commutative = false; Type *type = nullptr; @@ -155,17 +155,18 @@ namespace llvm { -template <> struct DenseMapInfo { - static inline GVN::Expression getEmptyKey() { return ~0U; } - static inline GVN::Expression getTombstoneKey() { return ~1U; } +template <> struct DenseMapInfo { + static inline GVNPass::Expression getEmptyKey() { return ~0U; } + static inline GVNPass::Expression getTombstoneKey() { return ~1U; } - static unsigned getHashValue(const GVN::Expression &e) { + static unsigned getHashValue(const GVNPass::Expression &e) { using llvm::hash_value; return static_cast(hash_value(e)); } - static bool isEqual(const GVN::Expression &LHS, const GVN::Expression &RHS) { + static bool isEqual(const GVNPass::Expression &LHS, + const GVNPass::Expression &RHS) { return LHS == RHS; } }; @@ -246,7 +247,7 @@ /// Emit code at the specified insertion point to adjust the value defined /// here to the specified type. This handles various coercion cases. Value *MaterializeAdjustedValue(LoadInst *Load, Instruction *InsertPt, - GVN &gvn) const; + GVNPass &gvn) const; }; /// Represents an AvailableValue which can be rematerialized at the end of @@ -276,7 +277,7 @@ /// Emit code at the end of this block to adjust the value defined here to /// the specified type. This handles various coercion cases. - Value *MaterializeAdjustedValue(LoadInst *Load, GVN &gvn) const { + Value *MaterializeAdjustedValue(LoadInst *Load, GVNPass &gvn) const { return AV.MaterializeAdjustedValue(Load, BB->getTerminator(), gvn); } }; @@ -285,7 +286,7 @@ // ValueTable Internal Functions //===----------------------------------------------------------------------===// -GVN::Expression GVN::ValueTable::createExpr(Instruction *I) { +GVNPass::Expression GVNPass::ValueTable::createExpr(Instruction *I) { Expression e; e.type = I->getType(); e.opcode = I->getOpcode(); @@ -330,9 +331,8 @@ return e; } -GVN::Expression GVN::ValueTable::createCmpExpr(unsigned Opcode, - CmpInst::Predicate Predicate, - Value *LHS, Value *RHS) { +GVNPass::Expression GVNPass::ValueTable::createCmpExpr( + unsigned Opcode, CmpInst::Predicate Predicate, Value *LHS, Value *RHS) { assert((Opcode == Instruction::ICmp || Opcode == Instruction::FCmp) && "Not a comparison!"); Expression e; @@ -350,7 +350,8 @@ return e; } -GVN::Expression GVN::ValueTable::createExtractvalueExpr(ExtractValueInst *EI) { +GVNPass::Expression +GVNPass::ValueTable::createExtractvalueExpr(ExtractValueInst *EI) { assert(EI && "Not an ExtractValueInst?"); Expression e; e.type = EI->getType(); @@ -382,20 +383,21 @@ // ValueTable External Functions //===----------------------------------------------------------------------===// -GVN::ValueTable::ValueTable() = default; -GVN::ValueTable::ValueTable(const ValueTable &) = default; -GVN::ValueTable::ValueTable(ValueTable &&) = default; -GVN::ValueTable::~ValueTable() = default; -GVN::ValueTable &GVN::ValueTable::operator=(const GVN::ValueTable &Arg) = default; +GVNPass::ValueTable::ValueTable() = default; +GVNPass::ValueTable::ValueTable(const ValueTable &) = default; +GVNPass::ValueTable::ValueTable(ValueTable &&) = default; +GVNPass::ValueTable::~ValueTable() = default; +GVNPass::ValueTable & +GVNPass::ValueTable::operator=(const GVNPass::ValueTable &Arg) = default; /// add - Insert a value into the table with a specified value number. -void GVN::ValueTable::add(Value *V, uint32_t num) { +void GVNPass::ValueTable::add(Value *V, uint32_t num) { valueNumbering.insert(std::make_pair(V, num)); if (PHINode *PN = dyn_cast(V)) NumberingPhi[num] = PN; } -uint32_t GVN::ValueTable::lookupOrAddCall(CallInst *C) { +uint32_t GVNPass::ValueTable::lookupOrAddCall(CallInst *C) { if (AA->doesNotAccessMemory(C)) { Expression exp = createExpr(C); uint32_t e = assignExpNewValueNum(exp).first; @@ -499,11 +501,13 @@ } /// Returns true if a value number exists for the specified value. -bool GVN::ValueTable::exists(Value *V) const { return valueNumbering.count(V) != 0; } +bool GVNPass::ValueTable::exists(Value *V) const { + return valueNumbering.count(V) != 0; +} /// lookup_or_add - Returns the value number for the specified value, assigning /// it a new number if it did not have one before. -uint32_t GVN::ValueTable::lookupOrAdd(Value *V) { +uint32_t GVNPass::ValueTable::lookupOrAdd(Value *V) { DenseMap::iterator VI = valueNumbering.find(V); if (VI != valueNumbering.end()) return VI->second; @@ -580,7 +584,7 @@ /// Returns the value number of the specified value. Fails if /// the value has not yet been numbered. -uint32_t GVN::ValueTable::lookup(Value *V, bool Verify) const { +uint32_t GVNPass::ValueTable::lookup(Value *V, bool Verify) const { DenseMap::const_iterator VI = valueNumbering.find(V); if (Verify) { assert(VI != valueNumbering.end() && "Value not numbered?"); @@ -593,15 +597,15 @@ /// assigning it a new number if it did not have one before. Useful when /// we deduced the result of a comparison, but don't immediately have an /// instruction realizing that comparison to hand. -uint32_t GVN::ValueTable::lookupOrAddCmp(unsigned Opcode, - CmpInst::Predicate Predicate, - Value *LHS, Value *RHS) { +uint32_t GVNPass::ValueTable::lookupOrAddCmp(unsigned Opcode, + CmpInst::Predicate Predicate, + Value *LHS, Value *RHS) { Expression exp = createCmpExpr(Opcode, Predicate, LHS, RHS); return assignExpNewValueNum(exp).first; } /// Remove all entries from the ValueTable. -void GVN::ValueTable::clear() { +void GVNPass::ValueTable::clear() { valueNumbering.clear(); expressionNumbering.clear(); NumberingPhi.clear(); @@ -613,7 +617,7 @@ } /// Remove a value from the value numbering. -void GVN::ValueTable::erase(Value *V) { +void GVNPass::ValueTable::erase(Value *V) { uint32_t Num = valueNumbering.lookup(V); valueNumbering.erase(V); // If V is PHINode, V <--> value number is an one-to-one mapping. @@ -623,7 +627,7 @@ /// verifyRemoved - Verify that the value is removed from all internal data /// structures. -void GVN::ValueTable::verifyRemoved(const Value *V) const { +void GVNPass::ValueTable::verifyRemoved(const Value *V) const { for (DenseMap::const_iterator I = valueNumbering.begin(), E = valueNumbering.end(); I != E; ++I) { assert(I->first != V && "Inst still occurs in value numbering map!"); @@ -634,28 +638,28 @@ // GVN Pass //===----------------------------------------------------------------------===// -bool GVN::isPREEnabled() const { +bool GVNPass::isPREEnabled() const { return Options.AllowPRE.getValueOr(GVNEnablePRE); } -bool GVN::isLoadPREEnabled() const { +bool GVNPass::isLoadPREEnabled() const { return Options.AllowLoadPRE.getValueOr(GVNEnableLoadPRE); } -bool GVN::isLoadInLoopPREEnabled() const { +bool GVNPass::isLoadInLoopPREEnabled() const { return Options.AllowLoadInLoopPRE.getValueOr(GVNEnableLoadInLoopPRE); } -bool GVN::isLoadPRESplitBackedgeEnabled() const { +bool GVNPass::isLoadPRESplitBackedgeEnabled() const { return Options.AllowLoadPRESplitBackedge.getValueOr( GVNEnableSplitBackedgeInLoadPRE); } -bool GVN::isMemDepEnabled() const { +bool GVNPass::isMemDepEnabled() const { return Options.AllowMemDep.getValueOr(GVNEnableMemDep); } -PreservedAnalyses GVN::run(Function &F, FunctionAnalysisManager &AM) { +PreservedAnalyses GVNPass::run(Function &F, FunctionAnalysisManager &AM) { // FIXME: The order of evaluation of these 'getResult' calls is very // significant! Re-ordering these variables will cause GVN when run alone to // be less effective! We should fix memdep and basic-aa to not exhibit this @@ -683,10 +687,10 @@ return PA; } -void GVN::printPipeline( +void GVNPass::printPipeline( raw_ostream &OS, function_ref MapClassName2PassName) { - static_cast *>(this)->printPipeline(OS, - MapClassName2PassName); + static_cast *>(this)->printPipeline( + OS, MapClassName2PassName); OS << "<"; if (Options.AllowPRE != None) @@ -702,7 +706,7 @@ } #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) -LLVM_DUMP_METHOD void GVN::dump(DenseMap& d) const { +LLVM_DUMP_METHOD void GVNPass::dump(DenseMap &d) const { errs() << "{\n"; for (auto &I : d) { errs() << I.first << "\n"; @@ -852,7 +856,7 @@ static Value * ConstructSSAForLoadSet(LoadInst *Load, SmallVectorImpl &ValuesPerBlock, - GVN &gvn) { + GVNPass &gvn) { // Check for the fully redundant, dominating load case. In this case, we can // just use the dominating value directly. if (ValuesPerBlock.size() == 1 && @@ -895,7 +899,7 @@ Value *AvailableValue::MaterializeAdjustedValue(LoadInst *Load, Instruction *InsertPt, - GVN &gvn) const { + GVNPass &gvn) const { Value *Res; Type *LoadTy = Load->getType(); const DataLayout &DL = Load->getModule()->getDataLayout(); @@ -1019,8 +1023,8 @@ ORE->emit(R); } -bool GVN::AnalyzeLoadAvailability(LoadInst *Load, MemDepResult DepInfo, - Value *Address, AvailableValue &Res) { +bool GVNPass::AnalyzeLoadAvailability(LoadInst *Load, MemDepResult DepInfo, + Value *Address, AvailableValue &Res) { assert((DepInfo.isDef() || DepInfo.isClobber()) && "expected a local dependence"); assert(Load->isUnordered() && "rules below are incorrect for ordered access"); @@ -1154,9 +1158,9 @@ return false; } -void GVN::AnalyzeLoadAvailability(LoadInst *Load, LoadDepVect &Deps, - AvailValInBlkVect &ValuesPerBlock, - UnavailBlkVect &UnavailableBlocks) { +void GVNPass::AnalyzeLoadAvailability(LoadInst *Load, LoadDepVect &Deps, + AvailValInBlkVect &ValuesPerBlock, + UnavailBlkVect &UnavailableBlocks) { // Filter out useless results (non-locals, etc). Keep track of the blocks // where we have a value available in repl, also keep track of whether we see // dependencies that produce an unknown value for the load (such as a call @@ -1199,7 +1203,7 @@ "post condition violation"); } -void GVN::eliminatePartiallyRedundantLoad( +void GVNPass::eliminatePartiallyRedundantLoad( LoadInst *Load, AvailValInBlkVect &ValuesPerBlock, MapVector &AvailableLoads) { for (const auto &AvailableLoad : AvailableLoads) { @@ -1273,8 +1277,8 @@ }); } -bool GVN::PerformLoadPRE(LoadInst *Load, AvailValInBlkVect &ValuesPerBlock, - UnavailBlkVect &UnavailableBlocks) { +bool GVNPass::PerformLoadPRE(LoadInst *Load, AvailValInBlkVect &ValuesPerBlock, + UnavailBlkVect &UnavailableBlocks) { // Okay, we have *some* definitions of the value. This means that the value // is available in some of our (transitive) predecessors. Lets think about // doing PRE of this load. This will involve inserting a new load into the @@ -1514,8 +1518,9 @@ return true; } -bool GVN::performLoopLoadPRE(LoadInst *Load, AvailValInBlkVect &ValuesPerBlock, - UnavailBlkVect &UnavailableBlocks) { +bool GVNPass::performLoopLoadPRE(LoadInst *Load, + AvailValInBlkVect &ValuesPerBlock, + UnavailBlkVect &UnavailableBlocks) { if (!LI) return false; @@ -1606,7 +1611,7 @@ /// Attempt to eliminate a load whose dependencies are /// non-local by performing PHI construction. -bool GVN::processNonLocalLoad(LoadInst *Load) { +bool GVNPass::processNonLocalLoad(LoadInst *Load) { // non-local speculations are not allowed under asan. if (Load->getParent()->getParent()->hasFnAttribute( Attribute::SanitizeAddress) || @@ -1757,7 +1762,7 @@ return false; } -bool GVN::processAssumeIntrinsic(AssumeInst *IntrinsicI) { +bool GVNPass::processAssumeIntrinsic(AssumeInst *IntrinsicI) { Value *V = IntrinsicI->getArgOperand(0); if (ConstantInt *Cond = dyn_cast(V)) { @@ -1901,7 +1906,7 @@ /// Attempt to eliminate a load, first by eliminating it /// locally, and then attempting non-local elimination if that fails. -bool GVN::processLoad(LoadInst *L) { +bool GVNPass::processLoad(LoadInst *L) { if (!MD) return false; @@ -1955,7 +1960,7 @@ /// Return a pair the first field showing the value number of \p Exp and the /// second field showing whether it is a value number newly created. std::pair -GVN::ValueTable::assignExpNewValueNum(Expression &Exp) { +GVNPass::ValueTable::assignExpNewValueNum(Expression &Exp) { uint32_t &e = expressionNumbering[Exp]; bool CreateNewValNum = !e; if (CreateNewValNum) { @@ -1970,8 +1975,8 @@ /// Return whether all the values related with the same \p num are /// defined in \p BB. -bool GVN::ValueTable::areAllValsInBB(uint32_t Num, const BasicBlock *BB, - GVN &Gvn) { +bool GVNPass::ValueTable::areAllValsInBB(uint32_t Num, const BasicBlock *BB, + GVNPass &Gvn) { LeaderTableEntry *Vals = &Gvn.LeaderTable[Num]; while (Vals && Vals->BB == BB) Vals = Vals->Next; @@ -1979,9 +1984,9 @@ } /// Wrap phiTranslateImpl to provide caching functionality. -uint32_t GVN::ValueTable::phiTranslate(const BasicBlock *Pred, - const BasicBlock *PhiBlock, uint32_t Num, - GVN &Gvn) { +uint32_t GVNPass::ValueTable::phiTranslate(const BasicBlock *Pred, + const BasicBlock *PhiBlock, + uint32_t Num, GVNPass &Gvn) { auto FindRes = PhiTranslateTable.find({Num, Pred}); if (FindRes != PhiTranslateTable.end()) return FindRes->second; @@ -1992,9 +1997,10 @@ // Return true if the value number \p Num and NewNum have equal value. // Return false if the result is unknown. -bool GVN::ValueTable::areCallValsEqual(uint32_t Num, uint32_t NewNum, - const BasicBlock *Pred, - const BasicBlock *PhiBlock, GVN &Gvn) { +bool GVNPass::ValueTable::areCallValsEqual(uint32_t Num, uint32_t NewNum, + const BasicBlock *Pred, + const BasicBlock *PhiBlock, + GVNPass &Gvn) { CallInst *Call = nullptr; LeaderTableEntry *Vals = &Gvn.LeaderTable[Num]; while (Vals) { @@ -2027,9 +2033,9 @@ /// Translate value number \p Num using phis, so that it has the values of /// the phis in BB. -uint32_t GVN::ValueTable::phiTranslateImpl(const BasicBlock *Pred, - const BasicBlock *PhiBlock, - uint32_t Num, GVN &Gvn) { +uint32_t GVNPass::ValueTable::phiTranslateImpl(const BasicBlock *Pred, + const BasicBlock *PhiBlock, + uint32_t Num, GVNPass &Gvn) { if (PHINode *PN = NumberingPhi[Num]) { for (unsigned i = 0; i != PN->getNumIncomingValues(); ++i) { if (PN->getParent() == PhiBlock && PN->getIncomingBlock(i) == Pred) @@ -2082,8 +2088,8 @@ /// Erase stale entry from phiTranslate cache so phiTranslate can be computed /// again. -void GVN::ValueTable::eraseTranslateCacheEntry(uint32_t Num, - const BasicBlock &CurrBlock) { +void GVNPass::ValueTable::eraseTranslateCacheEntry( + uint32_t Num, const BasicBlock &CurrBlock) { for (const BasicBlock *Pred : predecessors(&CurrBlock)) PhiTranslateTable.erase({Num, Pred}); } @@ -2093,7 +2099,7 @@ // and then scan the list to find one whose block dominates the block in // question. This is fast because dominator tree queries consist of only // a few comparisons of DFS numbers. -Value *GVN::findLeader(const BasicBlock *BB, uint32_t num) { +Value *GVNPass::findLeader(const BasicBlock *BB, uint32_t num) { LeaderTableEntry Vals = LeaderTable[num]; if (!Vals.Val) return nullptr; @@ -2132,7 +2138,7 @@ return Pred != nullptr; } -void GVN::assignBlockRPONumber(Function &F) { +void GVNPass::assignBlockRPONumber(Function &F) { BlockRPONumber.clear(); uint32_t NextBlockNumber = 1; ReversePostOrderTraversal RPOT(&F); @@ -2141,7 +2147,7 @@ InvalidBlockRPONumbers = false; } -bool GVN::replaceOperandsForInBlockEquality(Instruction *Instr) const { +bool GVNPass::replaceOperandsForInBlockEquality(Instruction *Instr) const { bool Changed = false; for (unsigned OpNum = 0; OpNum < Instr->getNumOperands(); ++OpNum) { Value *Operand = Instr->getOperand(OpNum); @@ -2161,8 +2167,9 @@ /// 'RHS' everywhere in the scope. Returns whether a change was made. /// If DominatesByEdge is false, then it means that we will propagate the RHS /// value starting from the end of Root.Start. -bool GVN::propagateEquality(Value *LHS, Value *RHS, const BasicBlockEdge &Root, - bool DominatesByEdge) { +bool GVNPass::propagateEquality(Value *LHS, Value *RHS, + const BasicBlockEdge &Root, + bool DominatesByEdge) { SmallVector, 4> Worklist; Worklist.push_back(std::make_pair(LHS, RHS)); bool Changed = false; @@ -2310,7 +2317,7 @@ /// When calculating availability, handle an instruction /// by inserting it into the appropriate sets -bool GVN::processInstruction(Instruction *I) { +bool GVNPass::processInstruction(Instruction *I) { // Ignore dbg info intrinsics. if (isa(I)) return false; @@ -2451,10 +2458,10 @@ } /// runOnFunction - This is the main transformation entry point for a function. -bool GVN::runImpl(Function &F, AssumptionCache &RunAC, DominatorTree &RunDT, - const TargetLibraryInfo &RunTLI, AAResults &RunAA, - MemoryDependenceResults *RunMD, LoopInfo *LI, - OptimizationRemarkEmitter *RunORE, MemorySSA *MSSA) { +bool GVNPass::runImpl(Function &F, AssumptionCache &RunAC, DominatorTree &RunDT, + const TargetLibraryInfo &RunTLI, AAResults &RunAA, + MemoryDependenceResults *RunMD, LoopInfo *LI, + OptimizationRemarkEmitter *RunORE, MemorySSA *MSSA) { AC = &RunAC; DT = &RunDT; VN.setDomTree(DT); @@ -2519,7 +2526,7 @@ return Changed; } -bool GVN::processBlock(BasicBlock *BB) { +bool GVNPass::processBlock(BasicBlock *BB) { // FIXME: Kill off InstrsToErase by doing erasing eagerly in a helper function // (and incrementing BI before processing an instruction). assert(InstrsToErase.empty() && @@ -2580,8 +2587,8 @@ } // Instantiate an expression in a predecessor that lacked it. -bool GVN::performScalarPREInsertion(Instruction *Instr, BasicBlock *Pred, - BasicBlock *Curr, unsigned int ValNo) { +bool GVNPass::performScalarPREInsertion(Instruction *Instr, BasicBlock *Pred, + BasicBlock *Curr, unsigned int ValNo) { // Because we are going top-down through the block, all value numbers // will be available in the predecessor by the time we need them. Any // that weren't originally present will have been instantiated earlier @@ -2629,7 +2636,7 @@ return true; } -bool GVN::performScalarPRE(Instruction *CurInst) { +bool GVNPass::performScalarPRE(Instruction *CurInst) { if (isa(CurInst) || CurInst->isTerminator() || isa(CurInst) || CurInst->getType()->isVoidTy() || CurInst->mayReadFromMemory() || CurInst->mayHaveSideEffects() || @@ -2814,7 +2821,7 @@ /// Perform a purely local form of PRE that looks for diamond /// control flow patterns and attempts to perform simple PRE at the join point. -bool GVN::performPRE(Function &F) { +bool GVNPass::performPRE(Function &F) { bool Changed = false; for (BasicBlock *CurrentBlock : depth_first(&F.getEntryBlock())) { // Nothing to PRE in the entry block. @@ -2841,7 +2848,7 @@ /// Split the critical edge connecting the given two blocks, and return /// the block inserted to the critical edge. -BasicBlock *GVN::splitCriticalEdges(BasicBlock *Pred, BasicBlock *Succ) { +BasicBlock *GVNPass::splitCriticalEdges(BasicBlock *Pred, BasicBlock *Succ) { // GVN does not require loop-simplify, do not try to preserve it if it is not // possible. BasicBlock *BB = SplitCriticalEdge( @@ -2857,7 +2864,7 @@ /// Split critical edges found during the previous /// iteration that may enable further optimization. -bool GVN::splitCriticalEdges() { +bool GVNPass::splitCriticalEdges() { if (toSplit.empty()) return false; @@ -2877,7 +2884,7 @@ } /// Executes one iteration of GVN -bool GVN::iterateOnFunction(Function &F) { +bool GVNPass::iterateOnFunction(Function &F) { cleanupGlobalSets(); // Top-down walk of the dominator tree @@ -2893,7 +2900,7 @@ return Changed; } -void GVN::cleanupGlobalSets() { +void GVNPass::cleanupGlobalSets() { VN.clear(); LeaderTable.clear(); BlockRPONumber.clear(); @@ -2904,7 +2911,7 @@ /// Verify that the specified instruction does not occur in our /// internal data structures. -void GVN::verifyRemoved(const Instruction *Inst) const { +void GVNPass::verifyRemoved(const Instruction *Inst) const { VN.verifyRemoved(Inst); // Walk through the value number scope to make sure the instruction isn't @@ -2924,7 +2931,7 @@ /// function is to add all these blocks to "DeadBlocks". For the dead blocks' /// live successors, update their phi nodes by replacing the operands /// corresponding to dead blocks with UndefVal. -void GVN::addDeadBlock(BasicBlock *BB) { +void GVNPass::addDeadBlock(BasicBlock *BB) { SmallVector NewDead; SmallSetVector DF; @@ -3012,7 +3019,7 @@ // dead blocks with "UndefVal" in an hope these PHIs will optimized away. // // Return true iff *NEW* dead code are found. -bool GVN::processFoldableCondBr(BranchInst *BI) { +bool GVNPass::processFoldableCondBr(BranchInst *BI) { if (!BI || BI->isUnconditional()) return false; @@ -3040,7 +3047,7 @@ // associated val-num. As it normally has far more live instructions than dead // instructions, it makes more sense just to "fabricate" a val-number for the // dead code than checking if instruction involved is dead or not. -void GVN::assignValNumForDeadCode() { +void GVNPass::assignValNumForDeadCode() { for (BasicBlock *BB : DeadBlocks) { for (Instruction &Inst : *BB) { unsigned ValNum = VN.lookupOrAdd(&Inst); @@ -3095,7 +3102,7 @@ } private: - GVN Impl; + GVNPass Impl; }; char GVNLegacyPass::ID = 0; diff --git a/llvm/lib/Transforms/Scalar/GVNHoist.cpp b/llvm/lib/Transforms/Scalar/GVNHoist.cpp --- a/llvm/lib/Transforms/Scalar/GVNHoist.cpp +++ b/llvm/lib/Transforms/Scalar/GVNHoist.cpp @@ -169,7 +169,7 @@ public: // Inserts I and its value number in VNtoScalars. - void insert(Instruction *I, GVN::ValueTable &VN) { + void insert(Instruction *I, GVNPass::ValueTable &VN) { // Scalar instruction. unsigned V = VN.lookupOrAdd(I); VNtoScalars[{V, InvalidVN}].push_back(I); @@ -184,7 +184,7 @@ public: // Insert Load and the value number of its memory address in VNtoLoads. - void insert(LoadInst *Load, GVN::ValueTable &VN) { + void insert(LoadInst *Load, GVNPass::ValueTable &VN) { if (Load->isSimple()) { unsigned V = VN.lookupOrAdd(Load->getPointerOperand()); VNtoLoads[{V, InvalidVN}].push_back(Load); @@ -201,7 +201,7 @@ public: // Insert the Store and a hash number of the store address and the stored // value in VNtoStores. - void insert(StoreInst *Store, GVN::ValueTable &VN) { + void insert(StoreInst *Store, GVNPass::ValueTable &VN) { if (!Store->isSimple()) return; // Hash the store address and the stored value. @@ -221,7 +221,7 @@ public: // Insert Call and its value numbering in one of the VNtoCalls* containers. - void insert(CallInst *Call, GVN::ValueTable &VN) { + void insert(CallInst *Call, GVNPass::ValueTable &VN) { // A call that doesNotAccessMemory is handled as a Scalar, // onlyReadsMemory will be handled as a Load instruction, // all other calls will be handled as stores. @@ -274,7 +274,7 @@ unsigned int rank(const Value *V) const; private: - GVN::ValueTable VN; + GVNPass::ValueTable VN; DominatorTree *DT; PostDominatorTree *PDT; AliasAnalysis *AA; diff --git a/llvm/lib/Transforms/Scalar/SROA.cpp b/llvm/lib/Transforms/Scalar/SROA.cpp --- a/llvm/lib/Transforms/Scalar/SROA.cpp +++ b/llvm/lib/Transforms/Scalar/SROA.cpp @@ -2242,7 +2242,7 @@ const DataLayout &DL; AllocaSlices &AS; - SROA &Pass; + SROAPass &Pass; AllocaInst &OldAI, &NewAI; const uint64_t NewAllocaBeginOffset, NewAllocaEndOffset; Type *NewAllocaTy; @@ -2290,7 +2290,7 @@ IRBuilderTy IRB; public: - AllocaSliceRewriter(const DataLayout &DL, AllocaSlices &AS, SROA &Pass, + AllocaSliceRewriter(const DataLayout &DL, AllocaSlices &AS, SROAPass &Pass, AllocaInst &OldAI, AllocaInst &NewAI, uint64_t NewAllocaBeginOffset, uint64_t NewAllocaEndOffset, bool IsIntegerPromotable, @@ -3755,7 +3755,7 @@ /// there all along. /// /// \returns true if any changes are made. -bool SROA::presplitLoadsAndStores(AllocaInst &AI, AllocaSlices &AS) { +bool SROAPass::presplitLoadsAndStores(AllocaInst &AI, AllocaSlices &AS) { LLVM_DEBUG(dbgs() << "Pre-splitting loads and stores\n"); // Track the loads and stores which are candidates for pre-splitting here, in @@ -4235,8 +4235,8 @@ /// appropriate new offsets. It also evaluates how successful the rewrite was /// at enabling promotion and if it was successful queues the alloca to be /// promoted. -AllocaInst *SROA::rewritePartition(AllocaInst &AI, AllocaSlices &AS, - Partition &P) { +AllocaInst *SROAPass::rewritePartition(AllocaInst &AI, AllocaSlices &AS, + Partition &P) { // Try to compute a friendly type for this partition of the alloca. This // won't always succeed, in which case we fall back to a legal integer type // or an i8 array of an appropriate size. @@ -4387,7 +4387,7 @@ /// Walks the slices of an alloca and form partitions based on them, /// rewriting each of their uses. -bool SROA::splitAlloca(AllocaInst &AI, AllocaSlices &AS) { +bool SROAPass::splitAlloca(AllocaInst &AI, AllocaSlices &AS) { if (AS.begin() == AS.end()) return false; @@ -4558,7 +4558,7 @@ } /// Clobber a use with undef, deleting the used value if it becomes dead. -void SROA::clobberUse(Use &U) { +void SROAPass::clobberUse(Use &U) { Value *OldV = U; // Replace the use with an undef value. U = UndefValue::get(OldV->getType()); @@ -4577,7 +4577,7 @@ /// This analyzes the alloca to ensure we can reason about it, builds /// the slices of the alloca, and then hands it off to be split and /// rewritten as needed. -bool SROA::runOnAlloca(AllocaInst &AI) { +bool SROAPass::runOnAlloca(AllocaInst &AI) { LLVM_DEBUG(dbgs() << "SROA alloca: " << AI << "\n"); ++NumAllocasAnalyzed; @@ -4651,7 +4651,7 @@ /// /// We also record the alloca instructions deleted here so that they aren't /// subsequently handed to mem2reg to promote. -bool SROA::deleteDeadInstructions( +bool SROAPass::deleteDeadInstructions( SmallPtrSetImpl &DeletedAllocas) { bool Changed = false; while (!DeadInsts.empty()) { @@ -4690,7 +4690,7 @@ /// This attempts to promote whatever allocas have been identified as viable in /// the PromotableAllocas list. If that list is empty, there is nothing to do. /// This function returns whether any promotion occurred. -bool SROA::promoteAllocas(Function &F) { +bool SROAPass::promoteAllocas(Function &F) { if (PromotableAllocas.empty()) return false; @@ -4702,8 +4702,8 @@ return true; } -PreservedAnalyses SROA::runImpl(Function &F, DominatorTree &RunDT, - AssumptionCache &RunAC) { +PreservedAnalyses SROAPass::runImpl(Function &F, DominatorTree &RunDT, + AssumptionCache &RunAC) { LLVM_DEBUG(dbgs() << "SROA function: " << F.getName() << "\n"); C = &F.getContext(); DT = &RunDT; @@ -4757,7 +4757,7 @@ return PA; } -PreservedAnalyses SROA::run(Function &F, FunctionAnalysisManager &AM) { +PreservedAnalyses SROAPass::run(Function &F, FunctionAnalysisManager &AM) { return runImpl(F, AM.getResult(F), AM.getResult(F)); } @@ -4768,7 +4768,7 @@ /// SROA pass. class llvm::sroa::SROALegacyPass : public FunctionPass { /// The SROA implementation. - SROA Impl; + SROAPass Impl; public: static char ID; diff --git a/llvm/test/DebugInfo/pr37964.ll b/llvm/test/DebugInfo/pr37964.ll --- a/llvm/test/DebugInfo/pr37964.ll +++ b/llvm/test/DebugInfo/pr37964.ll @@ -1,7 +1,7 @@ ; RUN: opt -disable-output -debugify-each -passes=gvn < %s 2>&1 | FileCheck %s ; CHECK-NOT: ERROR: Instruction with empty DebugLoc in function _Z3bazv -- {{%.*}} = phi -; CHECK: CheckFunctionDebugify [GVN]: PASS +; CHECK: CheckFunctionDebugify [GVNPass]: PASS @foo = dso_local local_unnamed_addr global i32 0, align 4 @x = global i8 17 diff --git a/llvm/test/Other/new-pm-defaults.ll b/llvm/test/Other/new-pm-defaults.ll --- a/llvm/test/Other/new-pm-defaults.ll +++ b/llvm/test/Other/new-pm-defaults.ll @@ -85,7 +85,7 @@ ; CHECK-O-NEXT: Running pass: SimplifyCFGPass ; CHECK-O-NEXT: Running analysis: TargetIRAnalysis ; CHECK-O-NEXT: Running analysis: AssumptionAnalysis -; CHECK-O-NEXT: Running pass: SROA +; CHECK-O-NEXT: Running pass: SROAPass ; CHECK-O-NEXT: Running analysis: DominatorTreeAnalysis ; CHECK-O-NEXT: Running pass: EarlyCSEPass ; CHECK-O-NEXT: Running analysis: TargetLibraryAnalysis @@ -129,7 +129,7 @@ ; CHECK-O2-NEXT: Running pass: OpenMPOptCGSCCPass on (foo) ; CHECK-O3-NEXT: Running pass: OpenMPOptCGSCCPass on (foo) ; CHECK-EP-CGSCC-LATE-NEXT: Running pass: NoOpCGSCCPass -; CHECK-O-NEXT: Running pass: SROA +; CHECK-O-NEXT: Running pass: SROAPass ; CHECK-O-NEXT: Running pass: EarlyCSEPass ; CHECK-O-NEXT: Running analysis: MemorySSAAnalysis ; CHECK-O23SZ-NEXT: Running pass: SpeculativeExecutionPass @@ -169,10 +169,10 @@ ; CHECK-O-NEXT: Running pass: LoopDeletionPass ; CHECK-O-NEXT: Running pass: LoopFullUnrollPass ; CHECK-EP-LOOP-END-NEXT: Running pass: NoOpLoopPass -; CHECK-O-NEXT: Running pass: SROA on foo +; CHECK-O-NEXT: Running pass: SROAPass on foo ; CHECK-MATRIX: Running pass: VectorCombinePass ; CHECK-O23SZ-NEXT: Running pass: MergedLoadStoreMotionPass -; CHECK-O23SZ-NEXT: Running pass: GVN +; CHECK-O23SZ-NEXT: Running pass: GVNPass ; CHECK-O23SZ-NEXT: Running analysis: MemoryDependenceAnalysis ; CHECK-O23SZ-NEXT: Running analysis: PhiValuesAnalysis ; CHECK-O1-NEXT: Running pass: MemCpyOptPass diff --git a/llvm/test/Other/new-pm-lto-defaults.ll b/llvm/test/Other/new-pm-lto-defaults.ll --- a/llvm/test/Other/new-pm-lto-defaults.ll +++ b/llvm/test/Other/new-pm-lto-defaults.ll @@ -79,7 +79,7 @@ ; CHECK-EP-Peephole-NEXT: Running pass: NoOpFunctionPass ; CHECK-O23SZ-NEXT: Running pass: JumpThreadingPass ; CHECK-O23SZ-NEXT: Running analysis: LazyValueAnalysis -; CHECK-O23SZ-NEXT: Running pass: SROA on foo +; CHECK-O23SZ-NEXT: Running pass: SROAPass on foo ; CHECK-O23SZ-NEXT: Running pass: TailCallElimPass on foo ; CHECK-O23SZ-NEXT: Running pass: PostOrderFunctionAttrsPass on (foo) ; CHECK-O23SZ-NEXT: Running pass: RequireAnalysisPass<{{.*}}GlobalsAA @@ -94,7 +94,7 @@ ; CHECK-O23SZ-NEXT: Running analysis: ScalarEvolutionAnalysis on foo ; CHECK-O23SZ-NEXT: Running analysis: InnerAnalysisManagerProxy ; CHECK-O23SZ-NEXT: Running pass: LICMPass on Loop -; CHECK-O23SZ-NEXT: Running pass: GVN on foo +; CHECK-O23SZ-NEXT: Running pass: GVNPass on foo ; CHECK-O23SZ-NEXT: Running analysis: MemoryDependenceAnalysis on foo ; CHECK-O23SZ-NEXT: Running analysis: PhiValuesAnalysis on foo ; CHECK-O23SZ-NEXT: Running pass: MemCpyOptPass on foo diff --git a/llvm/test/Other/new-pm-pgo-preinline.ll b/llvm/test/Other/new-pm-pgo-preinline.ll --- a/llvm/test/Other/new-pm-pgo-preinline.ll +++ b/llvm/test/Other/new-pm-pgo-preinline.ll @@ -9,7 +9,7 @@ ; CHECK-Osz-NEXT: Running analysis: OuterAnalysisManagerProxy ; CHECK-Osz-NEXT: Running pass: InlinerPass on (foo) ; CHECK-Osz-NEXT: Running pass: InlinerPass on (foo) -; CHECK-Osz-NEXT: Running pass: SROA on foo +; CHECK-Osz-NEXT: Running pass: SROAPass on foo ; CHECK-Osz-NEXT: Running pass: EarlyCSEPass on foo ; CHECK-Osz-NEXT: Running pass: SimplifyCFGPass on foo ; CHECK-Osz-NEXT: Running pass: InstCombinePass on foo diff --git a/llvm/test/Other/new-pm-pgo.ll b/llvm/test/Other/new-pm-pgo.ll --- a/llvm/test/Other/new-pm-pgo.ll +++ b/llvm/test/Other/new-pm-pgo.ll @@ -22,7 +22,7 @@ ; SAMPLE_USE_PRE_LINK: Running pass: AddDiscriminatorsPass ; SAMPLE_USE: Running pass: LowerExpectIntrinsicPass ; SAMPLE_USE: Running pass: SimplifyCFGPass -; SAMPLE_USE: Running pass: SROA +; SAMPLE_USE: Running pass: SROAPass ; SAMPLE_USE: Running pass: EarlyCSEPass ; SAMPLE_USE_POST_LINK: Running pass: InstCombinePass ; SAMPLE_USE: Running pass: SampleProfileLoaderPass diff --git a/llvm/test/Other/new-pm-thinlto-defaults.ll b/llvm/test/Other/new-pm-thinlto-defaults.ll --- a/llvm/test/Other/new-pm-thinlto-defaults.ll +++ b/llvm/test/Other/new-pm-thinlto-defaults.ll @@ -66,7 +66,7 @@ ; CHECK-O-NEXT: Running pass: SimplifyCFGPass ; CHECK-O-NEXT: Running analysis: TargetIRAnalysis ; CHECK-O-NEXT: Running analysis: AssumptionAnalysis -; CHECK-O-NEXT: Running pass: SROA +; CHECK-O-NEXT: Running pass: SROAPass ; CHECK-O-NEXT: Running analysis: DominatorTreeAnalysis ; CHECK-O-NEXT: Running pass: EarlyCSEPass ; CHECK-O-NEXT: Running analysis: TargetLibraryAnalysis @@ -108,7 +108,7 @@ ; CHECK-O3-NEXT: Running pass: ArgumentPromotionPass ; CHECK-O2-NEXT: Running pass: OpenMPOptCGSCCPass on (foo) ; CHECK-O3-NEXT: Running pass: OpenMPOptCGSCCPass on (foo) -; CHECK-O-NEXT: Running pass: SROA +; CHECK-O-NEXT: Running pass: SROAPass ; CHECK-O-NEXT: Running pass: EarlyCSEPass ; CHECK-O-NEXT: Running analysis: MemorySSAAnalysis ; CHECK-O23SZ-NEXT: Running pass: SpeculativeExecutionPass @@ -145,21 +145,21 @@ ; CHECK-O-NEXT: Running pass: IndVarSimplifyPass ; CHECK-O-NEXT: Running pass: LoopDeletionPass ; CHECK-O-NEXT: Running pass: LoopFullUnrollPass -; CHECK-O-NEXT: Running pass: SROA on foo +; CHECK-O-NEXT: Running pass: SROAPass on foo ; CHECK-Os-NEXT: Running pass: MergedLoadStoreMotionPass -; CHECK-Os-NEXT: Running pass: GVN +; CHECK-Os-NEXT: Running pass: GVNPass ; CHECK-Os-NEXT: Running analysis: MemoryDependenceAnalysis ; CHECK-Os-NEXT: Running analysis: PhiValuesAnalysis ; CHECK-Oz-NEXT: Running pass: MergedLoadStoreMotionPass -; CHECK-Oz-NEXT: Running pass: GVN +; CHECK-Oz-NEXT: Running pass: GVNPass ; CHECK-Oz-NEXT: Running analysis: MemoryDependenceAnalysis ; CHECK-Oz-NEXT: Running analysis: PhiValuesAnalysis ; CHECK-O2-NEXT: Running pass: MergedLoadStoreMotionPass -; CHECK-O2-NEXT: Running pass: GVN +; CHECK-O2-NEXT: Running pass: GVNPass ; CHECK-O2-NEXT: Running analysis: MemoryDependenceAnalysis ; CHECK-O2-NEXT: Running analysis: PhiValuesAnalysis ; CHECK-O3-NEXT: Running pass: MergedLoadStoreMotionPass -; CHECK-O3-NEXT: Running pass: GVN +; CHECK-O3-NEXT: Running pass: GVNPass ; CHECK-O3-NEXT: Running analysis: MemoryDependenceAnalysis ; CHECK-O3-NEXT: Running analysis: PhiValuesAnalysis ; CHECK-O1-NEXT: Running pass: MemCpyOptPass diff --git a/llvm/test/Other/new-pm-thinlto-postlink-pgo-defaults.ll b/llvm/test/Other/new-pm-thinlto-postlink-pgo-defaults.ll --- a/llvm/test/Other/new-pm-thinlto-postlink-pgo-defaults.ll +++ b/llvm/test/Other/new-pm-thinlto-postlink-pgo-defaults.ll @@ -36,7 +36,7 @@ ; CHECK-O-NEXT: Running pass: SimplifyCFGPass ; CHECK-O-NEXT: Running analysis: TargetIRAnalysis ; CHECK-O-NEXT: Running analysis: AssumptionAnalysis -; CHECK-O-NEXT: Running pass: SROA +; CHECK-O-NEXT: Running pass: SROAPass ; CHECK-O-NEXT: Running analysis: DominatorTreeAnalysis ; CHECK-O-NEXT: Running pass: EarlyCSEPass ; CHECK-O-NEXT: Running analysis: TargetLibraryAnalysis @@ -82,7 +82,7 @@ ; CHECK-O3-NEXT: Running pass: ArgumentPromotionPass ; CHECK-O2-NEXT: Running pass: OpenMPOptCGSCCPass ; CHECK-O3-NEXT: Running pass: OpenMPOptCGSCCPass -; CHECK-O-NEXT: Running pass: SROA +; CHECK-O-NEXT: Running pass: SROAPass ; CHECK-O-NEXT: Running pass: EarlyCSEPass ; CHECK-O-NEXT: Running analysis: MemorySSAAnalysis ; CHECK-O23SZ-NEXT: Running pass: SpeculativeExecutionPass @@ -118,21 +118,21 @@ ; CHECK-O-NEXT: Running pass: IndVarSimplifyPass ; CHECK-O-NEXT: Running pass: LoopDeletionPass ; CHECK-O-NEXT: Running pass: LoopFullUnrollPass -; CHECK-O-NEXT: Running pass: SROA on foo +; CHECK-O-NEXT: Running pass: SROAPass on foo ; CHECK-Os-NEXT: Running pass: MergedLoadStoreMotionPass -; CHECK-Os-NEXT: Running pass: GVN +; CHECK-Os-NEXT: Running pass: GVNPass ; CHECK-Os-NEXT: Running analysis: MemoryDependenceAnalysis ; CHECK-Os-NEXT: Running analysis: PhiValuesAnalysis ; CHECK-Oz-NEXT: Running pass: MergedLoadStoreMotionPass -; CHECK-Oz-NEXT: Running pass: GVN +; CHECK-Oz-NEXT: Running pass: GVNPass ; CHECK-Oz-NEXT: Running analysis: MemoryDependenceAnalysis ; CHECK-Oz-NEXT: Running analysis: PhiValuesAnalysis ; CHECK-O2-NEXT: Running pass: MergedLoadStoreMotionPass -; CHECK-O2-NEXT: Running pass: GVN +; CHECK-O2-NEXT: Running pass: GVNPass ; CHECK-O2-NEXT: Running analysis: MemoryDependenceAnalysis ; CHECK-O2-NEXT: Running analysis: PhiValuesAnalysis ; CHECK-O3-NEXT: Running pass: MergedLoadStoreMotionPass -; CHECK-O3-NEXT: Running pass: GVN +; CHECK-O3-NEXT: Running pass: GVNPass ; CHECK-O3-NEXT: Running analysis: MemoryDependenceAnalysis ; CHECK-O3-NEXT: Running analysis: PhiValuesAnalysis ; CHECK-O1-NEXT: Running pass: MemCpyOptPass diff --git a/llvm/test/Other/new-pm-thinlto-postlink-samplepgo-defaults.ll b/llvm/test/Other/new-pm-thinlto-postlink-samplepgo-defaults.ll --- a/llvm/test/Other/new-pm-thinlto-postlink-samplepgo-defaults.ll +++ b/llvm/test/Other/new-pm-thinlto-postlink-samplepgo-defaults.ll @@ -38,7 +38,7 @@ ; CHECK-O-NEXT: Running pass: SimplifyCFGPass ; CHECK-O-NEXT: Running analysis: TargetIRAnalysis ; CHECK-O-NEXT: Running analysis: AssumptionAnalysis -; CHECK-O-NEXT: Running pass: SROA +; CHECK-O-NEXT: Running pass: SROAPass ; CHECK-O-NEXT: Running analysis: DominatorTreeAnalysis ; CHECK-O-NEXT: Running pass: EarlyCSEPass ; CHECK-O-NEXT: Running analysis: TargetLibraryAnalysis @@ -91,7 +91,7 @@ ; CHECK-O3-NEXT: Running pass: ArgumentPromotionPass ; CHECK-O2-NEXT: Running pass: OpenMPOptCGSCCPass ; CHECK-O3-NEXT: Running pass: OpenMPOptCGSCCPass -; CHECK-O-NEXT: Running pass: SROA +; CHECK-O-NEXT: Running pass: SROAPass ; CHECK-O-NEXT: Running pass: EarlyCSEPass ; CHECK-O-NEXT: Running analysis: MemorySSAAnalysis ; CHECK-O23SZ-NEXT: Running pass: SpeculativeExecutionPass @@ -127,21 +127,21 @@ ; CHECK-O-NEXT: Running pass: IndVarSimplifyPass ; CHECK-O-NEXT: Running pass: LoopDeletionPass ; CHECK-O-NEXT: Running pass: LoopFullUnrollPass -; CHECK-O-NEXT: Running pass: SROA on foo +; CHECK-O-NEXT: Running pass: SROAPass on foo ; CHECK-Os-NEXT: Running pass: MergedLoadStoreMotionPass -; CHECK-Os-NEXT: Running pass: GVN +; CHECK-Os-NEXT: Running pass: GVNPass ; CHECK-Os-NEXT: Running analysis: MemoryDependenceAnalysis ; CHECK-Os-NEXT: Running analysis: PhiValuesAnalysis ; CHECK-Oz-NEXT: Running pass: MergedLoadStoreMotionPass -; CHECK-Oz-NEXT: Running pass: GVN +; CHECK-Oz-NEXT: Running pass: GVNPass ; CHECK-Oz-NEXT: Running analysis: MemoryDependenceAnalysis ; CHECK-Oz-NEXT: Running analysis: PhiValuesAnalysis ; CHECK-O2-NEXT: Running pass: MergedLoadStoreMotionPass -; CHECK-O2-NEXT: Running pass: GVN +; CHECK-O2-NEXT: Running pass: GVNPass ; CHECK-O2-NEXT: Running analysis: MemoryDependenceAnalysis ; CHECK-O2-NEXT: Running analysis: PhiValuesAnalysis ; CHECK-O3-NEXT: Running pass: MergedLoadStoreMotionPass -; CHECK-O3-NEXT: Running pass: GVN +; CHECK-O3-NEXT: Running pass: GVNPass ; CHECK-O3-NEXT: Running analysis: MemoryDependenceAnalysis ; CHECK-O3-NEXT: Running analysis: PhiValuesAnalysis ; CHECK-O1-NEXT: Running pass: MemCpyOptPass diff --git a/llvm/test/Other/new-pm-thinlto-prelink-pgo-defaults.ll b/llvm/test/Other/new-pm-thinlto-prelink-pgo-defaults.ll --- a/llvm/test/Other/new-pm-thinlto-prelink-pgo-defaults.ll +++ b/llvm/test/Other/new-pm-thinlto-prelink-pgo-defaults.ll @@ -37,7 +37,7 @@ ; CHECK-O-NEXT: Running pass: SimplifyCFGPass ; CHECK-O-NEXT: Running analysis: TargetIRAnalysis ; CHECK-O-NEXT: Running analysis: AssumptionAnalysis -; CHECK-O-NEXT: Running pass: SROA +; CHECK-O-NEXT: Running pass: SROAPass ; CHECK-O-NEXT: Running analysis: DominatorTreeAnalysis ; CHECK-O-NEXT: Running pass: EarlyCSEPass ; CHECK-O-NEXT: Running analysis: TargetLibraryAnalysis @@ -65,7 +65,7 @@ ; CHECK-O123SZ-NEXT: Running analysis: OuterAnalysisManagerProxy ; CHECK-O123SZ-NEXT: Running pass: InlinerPass on (foo) ; CHECK-O123SZ-NEXT: Running pass: InlinerPass on (foo) -; CHECK-O123SZ-NEXT: Running pass: SROA on foo +; CHECK-O123SZ-NEXT: Running pass: SROAPass on foo ; CHECK-O123SZ-NEXT: Running pass: EarlyCSEPass on foo ; CHECK-O123SZ-NEXT: Running pass: SimplifyCFGPass on foo ; CHECK-O123SZ-NEXT: Running pass: InstCombinePass on foo @@ -112,7 +112,7 @@ ; CHECK-O3-NEXT: Running analysis: TargetIRAnalysis ; CHECK-O2-NEXT: Running pass: OpenMPOptCGSCCPass ; CHECK-O3-NEXT: Running pass: OpenMPOptCGSCCPass -; CHECK-O-NEXT: Running pass: SROA +; CHECK-O-NEXT: Running pass: SROAPass ; CHECK-O-NEXT: Running pass: EarlyCSEPass ; CHECK-O1-NEXT: Running analysis: TargetIRAnalysis on foo ; CHECK-O2-NEXT: Running analysis: TargetIRAnalysis on foo @@ -160,21 +160,21 @@ ; CHECK-O-NEXT: Running pass: IndVarSimplifyPass ; CHECK-O-NEXT: Running pass: LoopDeletionPass ; CHECK-O-NEXT: Running pass: LoopFullUnrollPass -; CHECK-O-NEXT: Running pass: SROA on foo +; CHECK-O-NEXT: Running pass: SROAPass on foo ; CHECK-Os-NEXT: Running pass: MergedLoadStoreMotionPass -; CHECK-Os-NEXT: Running pass: GVN +; CHECK-Os-NEXT: Running pass: GVNPass ; CHECK-Os-NEXT: Running analysis: MemoryDependenceAnalysis ; CHECK-Os-NEXT: Running analysis: PhiValuesAnalysis ; CHECK-Oz-NEXT: Running pass: MergedLoadStoreMotionPass -; CHECK-Oz-NEXT: Running pass: GVN +; CHECK-Oz-NEXT: Running pass: GVNPass ; CHECK-Oz-NEXT: Running analysis: MemoryDependenceAnalysis ; CHECK-Oz-NEXT: Running analysis: PhiValuesAnalysis ; CHECK-O2-NEXT: Running pass: MergedLoadStoreMotionPass -; CHECK-O2-NEXT: Running pass: GVN +; CHECK-O2-NEXT: Running pass: GVNPass ; CHECK-O2-NEXT: Running analysis: MemoryDependenceAnalysis ; CHECK-O2-NEXT: Running analysis: PhiValuesAnalysis ; CHECK-O3-NEXT: Running pass: MergedLoadStoreMotionPass -; CHECK-O3-NEXT: Running pass: GVN +; CHECK-O3-NEXT: Running pass: GVNPass ; CHECK-O3-NEXT: Running analysis: MemoryDependenceAnalysis ; CHECK-O3-NEXT: Running analysis: PhiValuesAnalysis ; CHECK-O1-NEXT: Running pass: MemCpyOptPass diff --git a/llvm/test/Other/new-pm-thinlto-prelink-samplepgo-defaults.ll b/llvm/test/Other/new-pm-thinlto-prelink-samplepgo-defaults.ll --- a/llvm/test/Other/new-pm-thinlto-prelink-samplepgo-defaults.ll +++ b/llvm/test/Other/new-pm-thinlto-prelink-samplepgo-defaults.ll @@ -36,7 +36,7 @@ ; CHECK-O-NEXT: Running pass: SimplifyCFGPass ; CHECK-O-NEXT: Running analysis: TargetIRAnalysis ; CHECK-O-NEXT: Running analysis: AssumptionAnalysis -; CHECK-O-NEXT: Running pass: SROA +; CHECK-O-NEXT: Running pass: SROAPass ; CHECK-O-NEXT: Running analysis: DominatorTreeAnalysis ; CHECK-O-NEXT: Running pass: EarlyCSEPass ; CHECK-O-NEXT: Running analysis: TargetLibraryAnalysis @@ -86,7 +86,7 @@ ; CHECK-O3-NEXT: Running pass: ArgumentPromotionPass ; CHECK-O2-NEXT: Running pass: OpenMPOptCGSCCPass ; CHECK-O3-NEXT: Running pass: OpenMPOptCGSCCPass -; CHECK-O-NEXT: Running pass: SROA +; CHECK-O-NEXT: Running pass: SROAPass ; CHECK-O-NEXT: Running pass: EarlyCSEPass ; CHECK-O-NEXT: Running analysis: MemorySSAAnalysis ; CHECK-O23SZ-NEXT: Running pass: SpeculativeExecutionPass @@ -121,21 +121,21 @@ ; CHECK-O-NEXT: Running pass: LoopIdiomRecognizePass ; CHECK-O-NEXT: Running pass: IndVarSimplifyPass ; CHECK-O-NEXT: Running pass: LoopDeletionPass -; CHECK-O-NEXT: Running pass: SROA on foo +; CHECK-O-NEXT: Running pass: SROAPass on foo ; CHECK-Os-NEXT: Running pass: MergedLoadStoreMotionPass -; CHECK-Os-NEXT: Running pass: GVN +; CHECK-Os-NEXT: Running pass: GVNPass ; CHECK-Os-NEXT: Running analysis: MemoryDependenceAnalysis ; CHECK-Os-NEXT: Running analysis: PhiValuesAnalysis ; CHECK-Oz-NEXT: Running pass: MergedLoadStoreMotionPass -; CHECK-Oz-NEXT: Running pass: GVN +; CHECK-Oz-NEXT: Running pass: GVNPass ; CHECK-Oz-NEXT: Running analysis: MemoryDependenceAnalysis ; CHECK-Oz-NEXT: Running analysis: PhiValuesAnalysis ; CHECK-O2-NEXT: Running pass: MergedLoadStoreMotionPass -; CHECK-O2-NEXT: Running pass: GVN +; CHECK-O2-NEXT: Running pass: GVNPass ; CHECK-O2-NEXT: Running analysis: MemoryDependenceAnalysis ; CHECK-O2-NEXT: Running analysis: PhiValuesAnalysis ; CHECK-O3-NEXT: Running pass: MergedLoadStoreMotionPass -; CHECK-O3-NEXT: Running pass: GVN +; CHECK-O3-NEXT: Running pass: GVNPass ; CHECK-O3-NEXT: Running analysis: MemoryDependenceAnalysis ; CHECK-O3-NEXT: Running analysis: PhiValuesAnalysis ; CHECK-O1-NEXT: Running pass: MemCpyOptPass diff --git a/llvm/test/Transforms/GVN/preserve-analysis.ll b/llvm/test/Transforms/GVN/preserve-analysis.ll --- a/llvm/test/Transforms/GVN/preserve-analysis.ll +++ b/llvm/test/Transforms/GVN/preserve-analysis.ll @@ -16,7 +16,7 @@ ; NEW-PM-DAG: Running analysis: LoopAnalysis on test ; NEW-PM-DAG: Running analysis: DominatorTreeAnalysis on test -; NEW-PM: Running pass: GVN on test +; NEW-PM: Running pass: GVNPass on test ; NEW-PM-NOT: Running analysis: LoopAnalysis on test ; NEW-PM-NOT: Running analysis: DominatorTreeAnalysis on test diff --git a/llvm/test/Transforms/SROA/dead-inst.ll b/llvm/test/Transforms/SROA/dead-inst.ll --- a/llvm/test/Transforms/SROA/dead-inst.ll +++ b/llvm/test/Transforms/SROA/dead-inst.ll @@ -4,7 +4,7 @@ ; RUN: opt < %s -passes=bdce,sroa,bdce -o %t -debug-pass-manager 2>&1 | FileCheck %s ; CHECK: Running pass: BDCEPass on H ; CHECK: Running analysis: DemandedBitsAnalysis on H -; CHECK: Running pass: SROA on H +; CHECK: Running pass: SROAPass on H ; CHECK: Invalidating analysis: DemandedBitsAnalysis on H ; CHECK: Running pass: BDCEPass on H ; CHECK: Running analysis: DemandedBitsAnalysis on H