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 @@ -165,10 +165,6 @@ cl::desc("Perform mandatory inlinings module-wide, before performing " "inlining")); -static cl::opt EnableO3NonTrivialUnswitching( - "enable-npm-O3-nontrivial-unswitch", cl::init(true), cl::Hidden, - cl::desc("Enable non-trivial loop unswitching for -O3")); - static cl::opt EnableEagerlyInvalidateAnalyses( "eagerly-invalidate-analyses", cl::init(true), cl::Hidden, cl::desc("Eagerly invalidate more analyses in default pipelines")); @@ -567,8 +563,7 @@ LPM1.addPass(LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap, /*AllowSpeculation=*/true)); LPM1.addPass( - SimpleLoopUnswitchPass(/* NonTrivial */ Level == OptimizationLevel::O3 && - EnableO3NonTrivialUnswitching)); + SimpleLoopUnswitchPass(/* NonTrivial */ Level == OptimizationLevel::O3)); if (EnableLoopFlatten) LPM1.addPass(LoopFlattenPass()); diff --git a/llvm/test/Transforms/SimpleLoopUnswitch/pipeline.ll b/llvm/test/Transforms/SimpleLoopUnswitch/pipeline.ll --- a/llvm/test/Transforms/SimpleLoopUnswitch/pipeline.ll +++ b/llvm/test/Transforms/SimpleLoopUnswitch/pipeline.ll @@ -1,7 +1,6 @@ ; RUN: opt < %s -S -passes="default" | FileCheck %s -check-prefixes=TRIVIAL,CHECK ; RUN: opt < %s -S -passes="default" | FileCheck %s -check-prefixes=TRIVIAL,CHECK ; RUN: opt < %s -S -passes="default" | FileCheck %s -check-prefixes=NONTRIVIAL,CHECK -; RUN: opt < %s -S -passes="default" -enable-npm-O3-nontrivial-unswitch=0 | FileCheck %s -check-prefixes=TRIVIAL,CHECK ; RUN: opt < %s -S -passes="default" | FileCheck %s -check-prefixes=TRIVIAL,CHECK ; RUN: opt < %s -S -passes="default" | FileCheck %s -check-prefixes=TRIVIAL,CHECK