diff --git a/llvm/include/llvm/InitializePasses.h b/llvm/include/llvm/InitializePasses.h --- a/llvm/include/llvm/InitializePasses.h +++ b/llvm/include/llvm/InitializePasses.h @@ -214,7 +214,7 @@ void initializeLazyValueInfoWrapperPassPass(PassRegistry&); void initializeLegacyDivergenceAnalysisPass(PassRegistry&); void initializeLegacyLICMPassPass(PassRegistry&); -void initializeLegacyLoopSinkPassPass(PassRegistry&); +void initializeLegacyPGOLoopSinkPassPass(PassRegistry&); void initializeLegalizerPass(PassRegistry&); void initializeGISelCSEAnalysisWrapperPassPass(PassRegistry &); void initializeGISelKnownBitsAnalysisPass(PassRegistry &); diff --git a/llvm/include/llvm/LinkAllPasses.h b/llvm/include/llvm/LinkAllPasses.h --- a/llvm/include/llvm/LinkAllPasses.h +++ b/llvm/include/llvm/LinkAllPasses.h @@ -126,7 +126,7 @@ (void) llvm::createLCSSAPass(); (void) llvm::createLegacyDivergenceAnalysisPass(); (void) llvm::createLICMPass(); - (void) llvm::createLoopSinkPass(); + (void) llvm::createPGOLoopSinkPass(); (void) llvm::createLazyValueInfoPass(); (void) llvm::createLoopExtractorPass(); (void) llvm::createLoopInterchangePass(); diff --git a/llvm/include/llvm/Transforms/Scalar.h b/llvm/include/llvm/Transforms/Scalar.h --- a/llvm/include/llvm/Transforms/Scalar.h +++ b/llvm/include/llvm/Transforms/Scalar.h @@ -143,10 +143,10 @@ //===----------------------------------------------------------------------===// // -// LoopSink - This pass sinks invariants from preheader to loop body where -// frequency is lower than loop preheader. +// PGOLoopSink - This pass sinks invariants from preheader to loop body where +// frequency is lower than loop preheader, as per the PGO profile. // -Pass *createLoopSinkPass(); +Pass *createPGOLoopSinkPass(); //===----------------------------------------------------------------------===// // diff --git a/llvm/include/llvm/Transforms/Scalar/LoopSink.h b/llvm/include/llvm/Transforms/Scalar/PGOLoopSink.h rename from llvm/include/llvm/Transforms/Scalar/LoopSink.h rename to llvm/include/llvm/Transforms/Scalar/PGOLoopSink.h --- a/llvm/include/llvm/Transforms/Scalar/LoopSink.h +++ b/llvm/include/llvm/Transforms/Scalar/PGOLoopSink.h @@ -1,4 +1,4 @@ -//===- LoopSink.h - Loop Sink Pass ------------------------------*- C++ -*-===// +//===- PGOLoopSink.h - PGO-Driven Loop Sink Pass ----------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -7,11 +7,12 @@ //===----------------------------------------------------------------------===// // // This file provides the interface for the Loop Sink pass. +// The pass depends on an actual PGO profile. // //===----------------------------------------------------------------------===// -#ifndef LLVM_TRANSFORMS_SCALAR_LOOPSINK_H -#define LLVM_TRANSFORMS_SCALAR_LOOPSINK_H +#ifndef LLVM_TRANSFORMS_SCALAR_PGOLOOPSINK_H +#define LLVM_TRANSFORMS_SCALAR_PGOLOOPSINK_H #include "llvm/Analysis/LoopInfo.h" #include "llvm/IR/PassManager.h" @@ -30,10 +31,10 @@ /// We do this as a separate pass so that during normal optimization all /// invariant operations can be held outside the loop body to simplify /// fundamental analyses and transforms of the loop. -class LoopSinkPass : public PassInfoMixin { +class PGOLoopSinkPass : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM); }; } -#endif // LLVM_TRANSFORMS_SCALAR_LOOPSINK_H +#endif // LLVM_TRANSFORMS_SCALAR_PGOLOOPSINK_H diff --git a/llvm/lib/Analysis/LoopPass.cpp b/llvm/lib/Analysis/LoopPass.cpp --- a/llvm/lib/Analysis/LoopPass.cpp +++ b/llvm/lib/Analysis/LoopPass.cpp @@ -228,7 +228,7 @@ // is that LPPassManager might run passes which do not require LCSSA // form (LoopPassPrinter for example). We should skip verification for // such passes. - // FIXME: Loop-sink currently break LCSSA. Fix it and reenable the + // FIXME: PGO-Loop-sink currently break LCSSA. Fix it and reenable the // verification! #if 0 if (mustPreserveAnalysisID(LCSSAVerificationPass::ID)) diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp --- a/llvm/lib/Passes/PassBuilder.cpp +++ b/llvm/lib/Passes/PassBuilder.cpp @@ -145,7 +145,6 @@ #include "llvm/Transforms/Scalar/LoopPredication.h" #include "llvm/Transforms/Scalar/LoopRotation.h" #include "llvm/Transforms/Scalar/LoopSimplifyCFG.h" -#include "llvm/Transforms/Scalar/LoopSink.h" #include "llvm/Transforms/Scalar/LoopStrengthReduce.h" #include "llvm/Transforms/Scalar/LoopUnrollAndJamPass.h" #include "llvm/Transforms/Scalar/LoopUnrollPass.h" @@ -161,6 +160,7 @@ #include "llvm/Transforms/Scalar/MergedLoadStoreMotion.h" #include "llvm/Transforms/Scalar/NaryReassociate.h" #include "llvm/Transforms/Scalar/NewGVN.h" +#include "llvm/Transforms/Scalar/PGOLoopSink.h" #include "llvm/Transforms/Scalar/PartiallyInlineLibCalls.h" #include "llvm/Transforms/Scalar/Reassociate.h" #include "llvm/Transforms/Scalar/RewriteStatepointsForGC.h" @@ -1174,11 +1174,11 @@ if (EnableHotColdSplit && !LTOPreLink) MPM.addPass(HotColdSplittingPass()); - // LoopSink pass sinks instructions hoisted by LICM, which serves as a + // PGOLoopSink pass sinks instructions hoisted by LICM, which serves as a // canonicalization pass that enables other optimizations. As a result, - // LoopSink pass needs to be a very late IR pass to avoid undoing LICM + // PGOLoopSink pass needs to be a very late IR pass to avoid undoing LICM // result too early. - OptimizePM.addPass(LoopSinkPass()); + OptimizePM.addPass(PGOLoopSinkPass()); // And finally clean up LCSSA form before generating code. OptimizePM.addPass(InstSimplifyPass()); @@ -1188,7 +1188,7 @@ // flattening of blocks. OptimizePM.addPass(DivRemPairsPass()); - // LoopSink (and other loop passes since the last simplifyCFG) might have + // PGOLoopSink (and other loop passes since the last simplifyCFG) might have // resulted in single-entry-single-exit or empty blocks. Clean up the CFG. OptimizePM.addPass(SimplifyCFGPass()); 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 @@ -208,7 +208,7 @@ FUNCTION_PASS("guard-widening", GuardWideningPass()) FUNCTION_PASS("load-store-vectorizer", LoadStoreVectorizerPass()) FUNCTION_PASS("loop-simplify", LoopSimplifyPass()) -FUNCTION_PASS("loop-sink", LoopSinkPass()) +FUNCTION_PASS("pgo-loop-sink", PGOLoopSinkPass()) FUNCTION_PASS("loop-unroll-and-jam", LoopUnrollAndJamPass()) FUNCTION_PASS("lowerinvoke", LowerInvokePass()) FUNCTION_PASS("mem2reg", PromotePass()) diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp --- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp +++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp @@ -839,11 +839,11 @@ if (CallGraphProfile) MPM.add(createCGProfileLegacyPass()); - // LoopSink pass sinks instructions hoisted by LICM, which serves as a + // PGOLoopSink pass sinks instructions hoisted by LICM, which serves as a // canonicalization pass that enables other optimizations. As a result, - // LoopSink pass needs to be a very late IR pass to avoid undoing LICM + // PGOLoopSink pass needs to be a very late IR pass to avoid undoing LICM // result too early. - MPM.add(createLoopSinkPass()); + MPM.add(createPGOLoopSinkPass()); // Get rid of LCSSA nodes. MPM.add(createInstSimplifyLegacyPass()); @@ -852,7 +852,7 @@ // flattening of blocks. MPM.add(createDivRemPairsPass()); - // LoopSink (and other loop passes since the last simplifyCFG) might have + // PGOLoopSink (and other loop passes since the last simplifyCFG) might have // resulted in single-entry-single-exit or empty blocks. Clean up the CFG. MPM.add(createCFGSimplificationPass()); diff --git a/llvm/lib/Transforms/Scalar/CMakeLists.txt b/llvm/lib/Transforms/Scalar/CMakeLists.txt --- a/llvm/lib/Transforms/Scalar/CMakeLists.txt +++ b/llvm/lib/Transforms/Scalar/CMakeLists.txt @@ -24,7 +24,6 @@ JumpThreading.cpp LICM.cpp LoopAccessAnalysisPrinter.cpp - LoopSink.cpp LoopDeletion.cpp LoopDataPrefetch.cpp LoopDistribute.cpp @@ -55,6 +54,7 @@ MergedLoadStoreMotion.cpp NaryReassociate.cpp NewGVN.cpp + PGOLoopSink.cpp PartiallyInlineLibCalls.cpp PlaceSafepoints.cpp Reassociate.cpp diff --git a/llvm/lib/Transforms/Scalar/LoopSink.cpp b/llvm/lib/Transforms/Scalar/PGOLoopSink.cpp rename from llvm/lib/Transforms/Scalar/LoopSink.cpp rename to llvm/lib/Transforms/Scalar/PGOLoopSink.cpp --- a/llvm/lib/Transforms/Scalar/LoopSink.cpp +++ b/llvm/lib/Transforms/Scalar/PGOLoopSink.cpp @@ -1,4 +1,4 @@ -//===-- LoopSink.cpp - Loop Sink Pass -------------------------------------===// +//===-- PGOLoopSink.cpp - PGO Loop Sink Pass -------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -30,7 +30,7 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Transforms/Scalar/LoopSink.h" +#include "llvm/Transforms/Scalar/PGOLoopSink.h" #include "llvm/ADT/Statistic.h" #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Analysis/AliasSetTracker.h" @@ -53,7 +53,7 @@ #include "llvm/Transforms/Utils/LoopUtils.h" using namespace llvm; -#define DEBUG_TYPE "loopsink" +#define DEBUG_TYPE "pgoloopsink" STATISTIC(NumLoopSunk, "Number of instructions sunk into loop"); STATISTIC(NumLoopSunkCloned, "Number of cloned instructions sunk into loop"); @@ -257,7 +257,7 @@ if (!Preheader) return false; - // Enable LoopSink only when runtime profile is available. + // Enable PGOLoopSink only when runtime profile is available. // With static profile, the sinking decision may be sub-optimal. if (!Preheader->getParent()->hasProfileData()) return false; @@ -311,7 +311,7 @@ return Changed; } -PreservedAnalyses LoopSinkPass::run(Function &F, FunctionAnalysisManager &FAM) { +PreservedAnalyses PGOLoopSinkPass::run(Function &F, FunctionAnalysisManager &FAM) { LoopInfo &LI = FAM.getResult(F); // Nothing to do if there are no loops. if (LI.empty()) @@ -348,10 +348,10 @@ } namespace { -struct LegacyLoopSinkPass : public LoopPass { +struct LegacyPGOLoopSinkPass : public LoopPass { static char ID; - LegacyLoopSinkPass() : LoopPass(ID) { - initializeLegacyLoopSinkPassPass(*PassRegistry::getPassRegistry()); + LegacyPGOLoopSinkPass() : LoopPass(ID) { + initializeLegacyPGOLoopSinkPassPass(*PassRegistry::getPassRegistry()); } bool runOnLoop(Loop *L, LPPassManager &LPM) override { @@ -375,11 +375,12 @@ }; } -char LegacyLoopSinkPass::ID = 0; -INITIALIZE_PASS_BEGIN(LegacyLoopSinkPass, "loop-sink", "Loop Sink", false, - false) +char LegacyPGOLoopSinkPass::ID = 0; +INITIALIZE_PASS_BEGIN(LegacyPGOLoopSinkPass, "pgo-loop-sink", "PGO Loop Sink", + false, false) INITIALIZE_PASS_DEPENDENCY(LoopPass) INITIALIZE_PASS_DEPENDENCY(BlockFrequencyInfoWrapperPass) -INITIALIZE_PASS_END(LegacyLoopSinkPass, "loop-sink", "Loop Sink", false, false) +INITIALIZE_PASS_END(LegacyPGOLoopSinkPass, "pgo-loop-sink", "PGO Loop Sink", + false, false) -Pass *llvm::createLoopSinkPass() { return new LegacyLoopSinkPass(); } +Pass *llvm::createPGOLoopSinkPass() { return new LegacyPGOLoopSinkPass(); } diff --git a/llvm/lib/Transforms/Scalar/Scalar.cpp b/llvm/lib/Transforms/Scalar/Scalar.cpp --- a/llvm/lib/Transforms/Scalar/Scalar.cpp +++ b/llvm/lib/Transforms/Scalar/Scalar.cpp @@ -61,7 +61,7 @@ initializeInstSimplifyLegacyPassPass(Registry); initializeJumpThreadingPass(Registry); initializeLegacyLICMPassPass(Registry); - initializeLegacyLoopSinkPassPass(Registry); + initializeLegacyPGOLoopSinkPassPass(Registry); initializeLoopFuseLegacyPass(Registry); initializeLoopDataPrefetchLegacyPassPass(Registry); initializeLoopDeletionLegacyPassPass(Registry); @@ -170,8 +170,8 @@ unwrap(PM)->add(createJumpThreadingPass()); } -void LLVMAddLoopSinkPass(LLVMPassManagerRef PM) { - unwrap(PM)->add(createLoopSinkPass()); +void LLVMAddPGOLoopSinkPass(LLVMPassManagerRef PM) { + unwrap(PM)->add(createPGOLoopSinkPass()); } void LLVMAddLICMPass(LLVMPassManagerRef PM) { diff --git a/llvm/test/CodeGen/AMDGPU/opt-pipeline.ll b/llvm/test/CodeGen/AMDGPU/opt-pipeline.ll --- a/llvm/test/CodeGen/AMDGPU/opt-pipeline.ll +++ b/llvm/test/CodeGen/AMDGPU/opt-pipeline.ll @@ -296,7 +296,7 @@ ; GCN-O1-NEXT: Scalar Evolution Analysis ; GCN-O1-NEXT: Block Frequency Analysis ; GCN-O1-NEXT: Loop Pass Manager -; GCN-O1-NEXT: Loop Sink +; GCN-O1-NEXT: PGO Loop Sink ; GCN-O1-NEXT: Lazy Branch Probability Analysis ; GCN-O1-NEXT: Lazy Block Frequency Analysis ; GCN-O1-NEXT: Optimization Remark Emitter @@ -649,7 +649,7 @@ ; GCN-O2-NEXT: Scalar Evolution Analysis ; GCN-O2-NEXT: Block Frequency Analysis ; GCN-O2-NEXT: Loop Pass Manager -; GCN-O2-NEXT: Loop Sink +; GCN-O2-NEXT: PGO Loop Sink ; GCN-O2-NEXT: Lazy Branch Probability Analysis ; GCN-O2-NEXT: Lazy Block Frequency Analysis ; GCN-O2-NEXT: Optimization Remark Emitter @@ -1007,7 +1007,7 @@ ; GCN-O3-NEXT: Scalar Evolution Analysis ; GCN-O3-NEXT: Block Frequency Analysis ; GCN-O3-NEXT: Loop Pass Manager -; GCN-O3-NEXT: Loop Sink +; GCN-O3-NEXT: PGO Loop Sink ; GCN-O3-NEXT: Lazy Branch Probability Analysis ; GCN-O3-NEXT: Lazy Block Frequency Analysis ; GCN-O3-NEXT: Optimization Remark Emitter 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 @@ -272,7 +272,7 @@ ; CHECK-O-NEXT: Running pass: LCSSAPass ; CHECK-O-NEXT: Finished llvm::Function pass manager run. ; CHECK-O-NEXT: Running pass: AlignmentFromAssumptionsPass -; CHECK-O-NEXT: Running pass: LoopSinkPass +; CHECK-O-NEXT: Running pass: PGOLoopSinkPass ; CHECK-O-NEXT: Running pass: InstSimplifyPass ; CHECK-O-NEXT: Running pass: DivRemPairsPass ; CHECK-O-NEXT: Running pass: SimplifyCFGPass 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 @@ -242,7 +242,7 @@ ; CHECK-POSTLINK-O-NEXT: Running pass: LCSSAPass ; CHECK-POSTLINK-O-NEXT: Finished llvm::Function pass manager run ; CHECK-POSTLINK-O-NEXT: Running pass: AlignmentFromAssumptionsPass -; CHECK-POSTLINK-O-NEXT: Running pass: LoopSinkPass +; CHECK-POSTLINK-O-NEXT: Running pass: PGOLoopSinkPass ; CHECK-POSTLINK-O-NEXT: Running pass: InstSimplifyPass ; CHECK-POSTLINK-O-NEXT: Running pass: DivRemPairsPass ; CHECK-POSTLINK-O-NEXT: Running pass: SimplifyCFGPass 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 @@ -210,7 +210,7 @@ ; CHECK-O-NEXT: Running pass: LCSSAPass ; CHECK-O-NEXT: Finished {{.*}}Function pass manager run ; CHECK-O-NEXT: Running pass: AlignmentFromAssumptionsPass -; CHECK-O-NEXT: Running pass: LoopSinkPass +; CHECK-O-NEXT: Running pass: PGOLoopSinkPass ; CHECK-O-NEXT: Running pass: InstSimplifyPass ; CHECK-O-NEXT: Running pass: DivRemPairsPass ; CHECK-O-NEXT: Running pass: SimplifyCFGPass 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 @@ -221,7 +221,7 @@ ; CHECK-O-NEXT: Running pass: LCSSAPass ; CHECK-O-NEXT: Finished {{.*}}Function pass manager run ; CHECK-O-NEXT: Running pass: AlignmentFromAssumptionsPass -; CHECK-O-NEXT: Running pass: LoopSinkPass +; CHECK-O-NEXT: Running pass: PGOLoopSinkPass ; CHECK-O-NEXT: Running pass: InstSimplifyPass ; CHECK-O-NEXT: Running pass: DivRemPairsPass ; CHECK-O-NEXT: Running pass: SimplifyCFGPass diff --git a/llvm/test/Other/opt-O2-pipeline.ll b/llvm/test/Other/opt-O2-pipeline.ll --- a/llvm/test/Other/opt-O2-pipeline.ll +++ b/llvm/test/Other/opt-O2-pipeline.ll @@ -300,7 +300,7 @@ ; CHECK-NEXT: Scalar Evolution Analysis ; CHECK-NEXT: Block Frequency Analysis ; CHECK-NEXT: Loop Pass Manager -; CHECK-NEXT: Loop Sink +; CHECK-NEXT: PGO Loop Sink ; CHECK-NEXT: Lazy Branch Probability Analysis ; CHECK-NEXT: Lazy Block Frequency Analysis ; CHECK-NEXT: Optimization Remark Emitter diff --git a/llvm/test/Other/opt-O3-pipeline.ll b/llvm/test/Other/opt-O3-pipeline.ll --- a/llvm/test/Other/opt-O3-pipeline.ll +++ b/llvm/test/Other/opt-O3-pipeline.ll @@ -305,7 +305,7 @@ ; CHECK-NEXT: Scalar Evolution Analysis ; CHECK-NEXT: Block Frequency Analysis ; CHECK-NEXT: Loop Pass Manager -; CHECK-NEXT: Loop Sink +; CHECK-NEXT: PGO Loop Sink ; CHECK-NEXT: Lazy Branch Probability Analysis ; CHECK-NEXT: Lazy Block Frequency Analysis ; CHECK-NEXT: Optimization Remark Emitter diff --git a/llvm/test/Other/opt-Os-pipeline.ll b/llvm/test/Other/opt-Os-pipeline.ll --- a/llvm/test/Other/opt-Os-pipeline.ll +++ b/llvm/test/Other/opt-Os-pipeline.ll @@ -286,7 +286,7 @@ ; CHECK-NEXT: Scalar Evolution Analysis ; CHECK-NEXT: Block Frequency Analysis ; CHECK-NEXT: Loop Pass Manager -; CHECK-NEXT: Loop Sink +; CHECK-NEXT: PGO Loop Sink ; CHECK-NEXT: Lazy Branch Probability Analysis ; CHECK-NEXT: Lazy Block Frequency Analysis ; CHECK-NEXT: Optimization Remark Emitter diff --git a/llvm/test/Other/pass-pipelines.ll b/llvm/test/Other/pass-pipelines.ll --- a/llvm/test/Other/pass-pipelines.ll +++ b/llvm/test/Other/pass-pipelines.ll @@ -104,7 +104,7 @@ ; SPLIT: Hot Cold Splitting ; CHECK-O2: FunctionPass Manager ; CHECK-O2: Loop Pass Manager -; CHECK-O2-NEXT: Loop Sink +; CHECK-O2-NEXT: PGO Loop Sink ; CHECK-O2: Simplify the CFG ; CHECK-O2-NOT: Manager ; diff --git a/llvm/test/Other/pr32085.ll b/llvm/test/Other/pr32085.ll --- a/llvm/test/Other/pr32085.ll +++ b/llvm/test/Other/pr32085.ll @@ -4,8 +4,8 @@ ;; Show that there's no difference after running another simplify CFG ; RUN: diff %t2.ll %t3.ll -; Test from LoopSink pass, leaves some single-entry single-exit basic blocks. -; After LoopSink, we get a basic block .exit.loopexit which has one entry and +; Test from PGOLoopSink pass, leaves some single-entry single-exit basic blocks. +; After PGOLoopSink, we get a basic block .exit.loopexit which has one entry and ; one exit, the only instruction is a branch. Make sure it doesn't show up. ; Make sure they disappear at -O1. diff --git a/llvm/test/Transforms/LICM/loopsink-pr38462.ll b/llvm/test/Transforms/LICM/pgoloopsink-pr38462.ll rename from llvm/test/Transforms/LICM/loopsink-pr38462.ll rename to llvm/test/Transforms/LICM/pgoloopsink-pr38462.ll --- a/llvm/test/Transforms/LICM/loopsink-pr38462.ll +++ b/llvm/test/Transforms/LICM/pgoloopsink-pr38462.ll @@ -1,4 +1,4 @@ -; RUN: opt -S -loop-sink < %s | FileCheck %s +; RUN: opt -S -pgo-loop-sink < %s | FileCheck %s target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-windows-msvc19.13.26128" diff --git a/llvm/test/Transforms/LICM/loopsink-pr39570.ll b/llvm/test/Transforms/LICM/pgoloopsink-pr39570.ll rename from llvm/test/Transforms/LICM/loopsink-pr39570.ll rename to llvm/test/Transforms/LICM/pgoloopsink-pr39570.ll --- a/llvm/test/Transforms/LICM/loopsink-pr39570.ll +++ b/llvm/test/Transforms/LICM/pgoloopsink-pr39570.ll @@ -1,4 +1,4 @@ -; RUN: opt -S -loop-sink < %s | FileCheck %s +; RUN: opt -S -pgo-loop-sink < %s | FileCheck %s ; CHECK: pr39570 ; Make sure not to assert. diff --git a/llvm/test/Transforms/LICM/loopsink-pr39695.ll b/llvm/test/Transforms/LICM/pgoloopsink-pr39695.ll rename from llvm/test/Transforms/LICM/loopsink-pr39695.ll rename to llvm/test/Transforms/LICM/pgoloopsink-pr39695.ll --- a/llvm/test/Transforms/LICM/loopsink-pr39695.ll +++ b/llvm/test/Transforms/LICM/pgoloopsink-pr39695.ll @@ -1,4 +1,4 @@ -; RUN: opt -S -loop-sink < %s | FileCheck %s +; RUN: opt -S -pgo-loop-sink < %s | FileCheck %s ; The load instruction should not be sunk into following loop. ; CHECK: @foo diff --git a/llvm/test/Transforms/LICM/loopsink.ll b/llvm/test/Transforms/LICM/pgoloopsink.ll rename from llvm/test/Transforms/LICM/loopsink.ll rename to llvm/test/Transforms/LICM/pgoloopsink.ll --- a/llvm/test/Transforms/LICM/loopsink.ll +++ b/llvm/test/Transforms/LICM/pgoloopsink.ll @@ -1,5 +1,5 @@ -; RUN: opt -S -loop-sink < %s | FileCheck %s -; RUN: opt -S -aa-pipeline=basic-aa -passes=loop-sink < %s | FileCheck %s +; RUN: opt -S -pgo-loop-sink < %s | FileCheck %s +; RUN: opt -S -aa-pipeline=basic-aa -passes=pgo-loop-sink < %s | FileCheck %s @g = global i32 0, align 4 diff --git a/llvm/test/Transforms/LICM/sink.ll b/llvm/test/Transforms/LICM/sink.ll --- a/llvm/test/Transforms/LICM/sink.ll +++ b/llvm/test/Transforms/LICM/sink.ll @@ -1,6 +1,6 @@ ; RUN: opt -S -licm < %s | FileCheck %s --check-prefix=CHECK-LICM -; RUN: opt -S -licm < %s | opt -S -loop-sink | FileCheck %s --check-prefix=CHECK-SINK -; RUN: opt -S < %s -passes='require,loop(licm),loop-sink' \ +; RUN: opt -S -licm < %s | opt -S -pgo-loop-sink | FileCheck %s --check-prefix=CHECK-SINK +; RUN: opt -S < %s -passes='require,loop(licm),pgo-loop-sink' \ ; RUN: | FileCheck %s --check-prefix=CHECK-SINK ; RUN: opt -S -licm -enable-mssa-loop-dependency=true -verify-memoryssa < %s | FileCheck %s --check-prefix=CHECK-LICM diff --git a/llvm/test/Transforms/Util/PR37334-break-crit-edges-require-dt.ll b/llvm/test/Transforms/Util/PR37334-break-crit-edges-require-dt.ll --- a/llvm/test/Transforms/Util/PR37334-break-crit-edges-require-dt.ll +++ b/llvm/test/Transforms/Util/PR37334-break-crit-edges-require-dt.ll @@ -1,7 +1,7 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py -; RUN: opt < %s -loop-sink -break-crit-edges -branch-prob -S | FileCheck %s -; RUN: opt < %s -loop-sink -break-crit-edges -lazy-block-freq -S | FileCheck %s -; RUN: opt < %s -loop-sink -break-crit-edges -lazy-branch-prob -S | FileCheck %s +; RUN: opt < %s -pgo-loop-sink -break-crit-edges -branch-prob -S | FileCheck %s +; RUN: opt < %s -pgo-loop-sink -break-crit-edges -lazy-block-freq -S | FileCheck %s +; RUN: opt < %s -pgo-loop-sink -break-crit-edges -lazy-branch-prob -S | FileCheck %s ; BreakCriticalEdges tries to update LI and DT if they are present. However, ; updating LI actually needs a DT, so we now require DT in diff --git a/llvm/utils/gn/secondary/llvm/lib/Transforms/Scalar/BUILD.gn b/llvm/utils/gn/secondary/llvm/lib/Transforms/Scalar/BUILD.gn --- a/llvm/utils/gn/secondary/llvm/lib/Transforms/Scalar/BUILD.gn +++ b/llvm/utils/gn/secondary/llvm/lib/Transforms/Scalar/BUILD.gn @@ -48,7 +48,6 @@ "LoopRerollPass.cpp", "LoopRotation.cpp", "LoopSimplifyCFG.cpp", - "LoopSink.cpp", "LoopStrengthReduce.cpp", "LoopUnrollAndJamPass.cpp", "LoopUnrollPass.cpp", @@ -66,6 +65,7 @@ "MergedLoadStoreMotion.cpp", "NaryReassociate.cpp", "NewGVN.cpp", + "PGOLoopSink.cpp", "PartiallyInlineLibCalls.cpp", "PlaceSafepoints.cpp", "Reassociate.cpp",