diff --git a/llvm/lib/Transforms/IPO/FunctionSpecialization.cpp b/llvm/lib/Transforms/IPO/FunctionSpecialization.cpp --- a/llvm/lib/Transforms/IPO/FunctionSpecialization.cpp +++ b/llvm/lib/Transforms/IPO/FunctionSpecialization.cpp @@ -66,40 +66,37 @@ STATISTIC(NumSpecsCreated, "Number of specializations created"); -static cl::opt ForceFunctionSpecialization( - "force-function-specialization", cl::init(false), cl::Hidden, - cl::desc("Force function specialization for every call site with a " - "constant argument")); - -static cl::opt MaxClonesThreshold( - "func-specialization-max-clones", cl::Hidden, - cl::desc("The maximum number of clones allowed for a single function " - "specialization"), - cl::init(3)); - -static cl::opt SmallFunctionThreshold( - "func-specialization-size-threshold", cl::Hidden, - cl::desc("Don't specialize functions that have less than this theshold " - "number of instructions"), - cl::init(100)); - -static cl::opt - AvgLoopIterationCount("func-specialization-avg-iters-cost", cl::Hidden, - cl::desc("Average loop iteration count cost"), - cl::init(10)); - -static cl::opt SpecializeOnAddresses( - "func-specialization-on-address", cl::init(false), cl::Hidden, - cl::desc("Enable function specialization on the address of global values")); +static cl::opt ForceSpecialization( + "force-specialization", cl::init(false), cl::Hidden, cl::desc( + "Force function specialization for every call site with a constant " + "argument")); + +static cl::opt MaxClones( + "funcspec-max-clones", cl::init(3), cl::Hidden, cl::desc( + "The maximum number of clones allowed for a single function " + "specialization")); + +static cl::opt MinFunctionSize( + "funcspec-min-function-size", cl::init(100), cl::Hidden, cl::desc( + "Don't specialize functions that have less than this number of " + "instructions")); + +static cl::opt AvgLoopIters( + "funcspec-avg-loop-iters", cl::init(10), cl::Hidden, cl::desc( + "Average loop iteration count")); + +static cl::opt SpecializeOnAddress( + "funcspec-on-address", cl::init(false), cl::Hidden, cl::desc( + "Enable function specialization on the address of global values")); // Disabled by default as it can significantly increase compilation times. // // https://llvm-compile-time-tracker.com // https://github.com/nikic/llvm-compile-time-tracker -static cl::opt EnableSpecializationForLiteralConstant( - "function-specialization-for-literal-constant", cl::init(false), cl::Hidden, - cl::desc("Enable specialization of functions that take a literal constant " - "as an argument.")); +static cl::opt SpecializeLiteralConstant( + "funcspec-for-literal-constant", cl::init(false), cl::Hidden, cl::desc( + "Enable specialization of functions that take a literal constant as an " + "argument")); Constant *FunctionSpecializer::getPromotableAlloca(AllocaInst *Alloca, CallInst *Call) { @@ -310,7 +307,7 @@ return AllSpecs[I].Gain > AllSpecs[J].Gain; }; const unsigned NSpecs = - std::min(NumCandidates * MaxClonesThreshold, unsigned(AllSpecs.size())); + std::min(NumCandidates * MaxClones, unsigned(AllSpecs.size())); SmallVector BestSpecs(NSpecs + 1); std::iota(BestSpecs.begin(), BestSpecs.begin() + NSpecs, 0); if (AllSpecs.size() > NSpecs) { @@ -482,7 +479,7 @@ getSpecializationBonus(A.Formal, A.Actual, Solver.getLoopInfo(*F)); // Discard unprofitable specialisations. - if (!ForceFunctionSpecialization && Gain <= 0) + if (!ForceSpecialization && Gain <= 0) continue; // Create a new specialisation entry. @@ -559,9 +556,8 @@ // Or if the lines of codes implies that this function is easy to get // inlined so that we shouldn't specialize it. if (Metrics.notDuplicatable || !Metrics.NumInsts.isValid() || - (!ForceFunctionSpecialization && - !F->hasFnAttribute(Attribute::NoInline) && - Metrics.NumInsts < SmallFunctionThreshold)) + (!ForceSpecialization && !F->hasFnAttribute(Attribute::NoInline) && + Metrics.NumInsts < MinFunctionSize)) return InstructionCost::getInvalid(); // Otherwise, set the specialization cost to be the cost of all the @@ -583,7 +579,7 @@ // Increase the cost if it is inside the loop. unsigned LoopDepth = LI.getLoopDepth(I->getParent()); - Cost *= std::pow((double)AvgLoopIterationCount, LoopDepth); + Cost *= std::pow((double)AvgLoopIters, LoopDepth); // Traverse recursively if there are more uses. // TODO: Any other instructions to be added here? @@ -664,7 +660,7 @@ } static bool isValidArgumentType(Type *Ty) { - return Ty->isPointerTy() || (EnableSpecializationForLiteralConstant && + return Ty->isPointerTy() || (SpecializeLiteralConstant && (Ty->isIntegerTy() || Ty->isFloatingPointTy() || Ty->isStructTy())); } @@ -711,7 +707,7 @@ if (auto *GV = dyn_cast(V)) { // Check if we want to specialize on the address of non-constant // global values. - if (!GV->isConstant() && !SpecializeOnAddresses) + if (!GV->isConstant() && !SpecializeOnAddress) return nullptr; if (!GV->getValueType()->isSingleValueType()) diff --git a/llvm/lib/Transforms/IPO/SCCP.cpp b/llvm/lib/Transforms/IPO/SCCP.cpp --- a/llvm/lib/Transforms/IPO/SCCP.cpp +++ b/llvm/lib/Transforms/IPO/SCCP.cpp @@ -42,8 +42,8 @@ STATISTIC(NumInstReplaced, "Number of instructions replaced with (simpler) instruction"); -static cl::opt FuncSpecializationMaxIters( - "func-specialization-max-iters", cl::init(1), cl::Hidden, cl::desc( +static cl::opt FuncSpecMaxIters( + "funcspec-max-iters", cl::init(1), cl::Hidden, cl::desc( "The maximum number of iterations function specialization is run")); static void findReturnsToZap(Function &F, @@ -158,7 +158,7 @@ if (IsFuncSpecEnabled) { unsigned Iters = 0; - while (Iters++ < FuncSpecializationMaxIters && Specializer.run()); + while (Iters++ < FuncSpecMaxIters && Specializer.run()); } // Iterate over all of the instructions in the module, replacing them with diff --git a/llvm/test/Transforms/FunctionSpecialization/bug55000-read-uninitialized-value.ll b/llvm/test/Transforms/FunctionSpecialization/bug55000-read-uninitialized-value.ll --- a/llvm/test/Transforms/FunctionSpecialization/bug55000-read-uninitialized-value.ll +++ b/llvm/test/Transforms/FunctionSpecialization/bug55000-read-uninitialized-value.ll @@ -1,4 +1,4 @@ -; RUN: opt -passes="ipsccp" -force-function-specialization -func-specialization-max-iters=2 -func-specialization-max-clones=1 -function-specialization-for-literal-constant=true -S < %s | FileCheck %s +; RUN: opt -passes="ipsccp" -force-specialization -funcspec-max-iters=2 -funcspec-max-clones=1 -funcspec-for-literal-constant=true -S < %s | FileCheck %s declare hidden i1 @compare(ptr) align 2 declare hidden { i8, ptr } @getType(ptr) align 2 diff --git a/llvm/test/Transforms/FunctionSpecialization/compiler-crash-60191.ll b/llvm/test/Transforms/FunctionSpecialization/compiler-crash-60191.ll --- a/llvm/test/Transforms/FunctionSpecialization/compiler-crash-60191.ll +++ b/llvm/test/Transforms/FunctionSpecialization/compiler-crash-60191.ll @@ -1,4 +1,4 @@ -; RUN: opt -S --passes="ipsccp" -force-function-specialization < %s | FileCheck %s +; RUN: opt -S --passes="ipsccp" -force-specialization < %s | FileCheck %s @A = private constant [6 x i32] [i32 1, i32 2, i32 0, i32 0, i32 0, i32 0], align 16 @B = external global ptr, align 8 diff --git a/llvm/test/Transforms/FunctionSpecialization/compiler-crash-promote-alloca.ll b/llvm/test/Transforms/FunctionSpecialization/compiler-crash-promote-alloca.ll --- a/llvm/test/Transforms/FunctionSpecialization/compiler-crash-promote-alloca.ll +++ b/llvm/test/Transforms/FunctionSpecialization/compiler-crash-promote-alloca.ll @@ -1,4 +1,4 @@ -; RUN: opt -S --passes="ipsccp" -force-function-specialization < %s | FileCheck %s +; RUN: opt -S --passes="ipsccp" -force-specialization < %s | FileCheck %s ; Tests that `bar` has been specialized and that the compiler did not crash ; while attempting to promote the alloca in `entry`. diff --git a/llvm/test/Transforms/FunctionSpecialization/constant-struct.ll b/llvm/test/Transforms/FunctionSpecialization/constant-struct.ll --- a/llvm/test/Transforms/FunctionSpecialization/constant-struct.ll +++ b/llvm/test/Transforms/FunctionSpecialization/constant-struct.ll @@ -1,7 +1,7 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py -; RUN: opt -passes="ipsccp" -force-function-specialization \ -; RUN: -function-specialization-for-literal-constant -S < %s | FileCheck %s +; RUN: opt -passes="ipsccp" -force-specialization \ +; RUN: -funcspec-for-literal-constant -S < %s | FileCheck %s define i32 @foo(i32 %y0, i32 %y1) { ; CHECK-LABEL: @foo( diff --git a/llvm/test/Transforms/FunctionSpecialization/function-specialization-always-inline.ll b/llvm/test/Transforms/FunctionSpecialization/function-specialization-always-inline.ll --- a/llvm/test/Transforms/FunctionSpecialization/function-specialization-always-inline.ll +++ b/llvm/test/Transforms/FunctionSpecialization/function-specialization-always-inline.ll @@ -1,4 +1,4 @@ -; RUN: opt -passes="ipsccp" -func-specialization-avg-iters-cost=3 -func-specialization-size-threshold=10 -S < %s | FileCheck %s +; RUN: opt -passes="ipsccp" -funcspec-avg-loop-iters=3 -funcspec-min-function-size=10 -S < %s | FileCheck %s ; CHECK-NOT: foo.{{[0-9]+}} diff --git a/llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-expression.ll b/llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-expression.ll --- a/llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-expression.ll +++ b/llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-expression.ll @@ -4,7 +4,7 @@ ; Note that this test case shows that function specialization pass would ; transform the function even if no specialization happened. -; RUN: opt -passes="ipsccp" -force-function-specialization -S < %s | FileCheck %s +; RUN: opt -passes="ipsccp" -force-specialization -S < %s | FileCheck %s %struct = type { i8, i16, i32, i64, i64} @Global = internal constant %struct {i8 0, i16 1, i32 2, i64 3, i64 4} diff --git a/llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-expression2.ll b/llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-expression2.ll --- a/llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-expression2.ll +++ b/llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-expression2.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py -; RUN: opt -passes="ipsccp" -force-function-specialization -S < %s | FileCheck %s +; RUN: opt -passes="ipsccp" -force-specialization -S < %s | FileCheck %s ; Check that we don't crash and specialise on a constant expression. diff --git a/llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-expression3.ll b/llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-expression3.ll --- a/llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-expression3.ll +++ b/llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-expression3.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py -; RUN: opt -passes="ipsccp" -force-function-specialization -S < %s | FileCheck %s +; RUN: opt -passes="ipsccp" -force-specialization -S < %s | FileCheck %s define i32 @main() { ; CHECK-LABEL: @main( diff --git a/llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-expression4.ll b/llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-expression4.ll --- a/llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-expression4.ll +++ b/llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-expression4.ll @@ -1,4 +1,4 @@ -; RUN: opt -passes="ipsccp" -force-function-specialization -S < %s | FileCheck %s +; RUN: opt -passes="ipsccp" -force-specialization -S < %s | FileCheck %s ; Check that we don't crash and specialise on a function call with byval attribute. diff --git a/llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-expression5.ll b/llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-expression5.ll --- a/llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-expression5.ll +++ b/llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-expression5.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py -; RUN: opt -passes="ipsccp" -force-function-specialization -func-specialization-on-address -S < %s | FileCheck %s +; RUN: opt -passes="ipsccp" -force-specialization -funcspec-on-address -S < %s | FileCheck %s ; Check that we don't crash and specialise on a scalar global variable with byval attribute. diff --git a/llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-integers.ll b/llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-integers.ll --- a/llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-integers.ll +++ b/llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-integers.ll @@ -1,4 +1,4 @@ -; RUN: opt -passes="ipsccp" -function-specialization-for-literal-constant=true -func-specialization-size-threshold=10 -S < %s | FileCheck %s +; RUN: opt -passes="ipsccp" -funcspec-for-literal-constant=true -funcspec-min-function-size=10 -S < %s | FileCheck %s ; Check that the literal constant parameter could be specialized. ; CHECK: @foo.1( diff --git a/llvm/test/Transforms/FunctionSpecialization/function-specialization-loop.ll b/llvm/test/Transforms/FunctionSpecialization/function-specialization-loop.ll --- a/llvm/test/Transforms/FunctionSpecialization/function-specialization-loop.ll +++ b/llvm/test/Transforms/FunctionSpecialization/function-specialization-loop.ll @@ -1,4 +1,4 @@ -; RUN: opt -passes="ipsccp" -func-specialization-avg-iters-cost=5 -func-specialization-size-threshold=10 -S < %s | FileCheck %s +; RUN: opt -passes="ipsccp" -funcspec-avg-loop-iters=5 -funcspec-min-function-size=10 -S < %s | FileCheck %s ; Check that the loop depth results in a larger specialization bonus. ; CHECK: @foo.1( diff --git a/llvm/test/Transforms/FunctionSpecialization/function-specialization-minsize2.ll b/llvm/test/Transforms/FunctionSpecialization/function-specialization-minsize2.ll --- a/llvm/test/Transforms/FunctionSpecialization/function-specialization-minsize2.ll +++ b/llvm/test/Transforms/FunctionSpecialization/function-specialization-minsize2.ll @@ -1,4 +1,4 @@ -; RUN: opt -passes="ipsccp" -func-specialization-size-threshold=3 -S < %s | FileCheck %s +; RUN: opt -passes="ipsccp" -funcspec-min-function-size=3 -S < %s | FileCheck %s ; Checks for callsites that have been annotated with MinSize. No specialisation ; expected here: diff --git a/llvm/test/Transforms/FunctionSpecialization/function-specialization-minsize3.ll b/llvm/test/Transforms/FunctionSpecialization/function-specialization-minsize3.ll --- a/llvm/test/Transforms/FunctionSpecialization/function-specialization-minsize3.ll +++ b/llvm/test/Transforms/FunctionSpecialization/function-specialization-minsize3.ll @@ -1,4 +1,4 @@ -; RUN: opt -passes="ipsccp" -func-specialization-size-threshold=3 -S < %s | FileCheck %s +; RUN: opt -passes="ipsccp" -funcspec-min-function-size=3 -S < %s | FileCheck %s ; Checks for callsites that have been annotated with MinSize. We only expect ; specialisation for the call that does not have the attribute: diff --git a/llvm/test/Transforms/FunctionSpecialization/function-specialization-nodup.ll b/llvm/test/Transforms/FunctionSpecialization/function-specialization-nodup.ll --- a/llvm/test/Transforms/FunctionSpecialization/function-specialization-nodup.ll +++ b/llvm/test/Transforms/FunctionSpecialization/function-specialization-nodup.ll @@ -1,4 +1,4 @@ -; RUN: opt -passes="ipsccp" -force-function-specialization -S < %s | FileCheck %s +; RUN: opt -passes="ipsccp" -force-specialization -S < %s | FileCheck %s ; Function @foo has function attribute 'noduplicate', so check that we don't ; specialize it: diff --git a/llvm/test/Transforms/FunctionSpecialization/function-specialization-nodup2.ll b/llvm/test/Transforms/FunctionSpecialization/function-specialization-nodup2.ll --- a/llvm/test/Transforms/FunctionSpecialization/function-specialization-nodup2.ll +++ b/llvm/test/Transforms/FunctionSpecialization/function-specialization-nodup2.ll @@ -1,4 +1,4 @@ -; RUN: opt -passes="ipsccp" -force-function-specialization -S < %s | FileCheck %s +; RUN: opt -passes="ipsccp" -force-specialization -S < %s | FileCheck %s ; Check that function foo does not gets specialised as it contains an intrinsic ; that is marked as NoDuplicate. diff --git a/llvm/test/Transforms/FunctionSpecialization/function-specialization-noexec.ll b/llvm/test/Transforms/FunctionSpecialization/function-specialization-noexec.ll --- a/llvm/test/Transforms/FunctionSpecialization/function-specialization-noexec.ll +++ b/llvm/test/Transforms/FunctionSpecialization/function-specialization-noexec.ll @@ -1,4 +1,4 @@ -; RUN: opt -passes="ipsccp" -force-function-specialization -S < %s | FileCheck %s +; RUN: opt -passes="ipsccp" -force-specialization -S < %s | FileCheck %s ; The if.then block is not executed, so check that we don't specialise here. diff --git a/llvm/test/Transforms/FunctionSpecialization/function-specialization-nonconst-glob.ll b/llvm/test/Transforms/FunctionSpecialization/function-specialization-nonconst-glob.ll --- a/llvm/test/Transforms/FunctionSpecialization/function-specialization-nonconst-glob.ll +++ b/llvm/test/Transforms/FunctionSpecialization/function-specialization-nonconst-glob.ll @@ -1,8 +1,8 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py -; RUN: opt -passes="ipsccp" -force-function-specialization -S < %s | FileCheck %s -; RUN: opt -passes="ipsccp" -force-function-specialization -func-specialization-on-address=0 -S < %s | FileCheck %s -; RUN: opt -passes="ipsccp" -force-function-specialization -func-specialization-on-address=1 -S < %s | FileCheck %s --check-prefix=ON-ADDRESS +; RUN: opt -passes="ipsccp" -force-specialization -S < %s | FileCheck %s +; RUN: opt -passes="ipsccp" -force-specialization -funcspec-on-address=0 -S < %s | FileCheck %s +; RUN: opt -passes="ipsccp" -force-specialization -funcspec-on-address=1 -S < %s | FileCheck %s --check-prefix=ON-ADDRESS ; Global B is not constant. We do not specialise on addresses unless we ; enable that: diff --git a/llvm/test/Transforms/FunctionSpecialization/function-specialization-poison.ll b/llvm/test/Transforms/FunctionSpecialization/function-specialization-poison.ll --- a/llvm/test/Transforms/FunctionSpecialization/function-specialization-poison.ll +++ b/llvm/test/Transforms/FunctionSpecialization/function-specialization-poison.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py -; RUN: opt -passes="ipsccp" -force-function-specialization -S < %s | FileCheck %s +; RUN: opt -passes="ipsccp" -force-specialization -S < %s | FileCheck %s ; Check that we don't crash and specialise on a poison value. diff --git a/llvm/test/Transforms/FunctionSpecialization/function-specialization-recursive.ll b/llvm/test/Transforms/FunctionSpecialization/function-specialization-recursive.ll --- a/llvm/test/Transforms/FunctionSpecialization/function-specialization-recursive.ll +++ b/llvm/test/Transforms/FunctionSpecialization/function-specialization-recursive.ll @@ -1,6 +1,6 @@ -; RUN: opt -passes="ipsccp,inline,instcombine" -force-function-specialization -func-specialization-max-iters=2 -S < %s | FileCheck %s --check-prefix=ITERS2 -; RUN: opt -passes="ipsccp,inline,instcombine" -force-function-specialization -func-specialization-max-iters=3 -S < %s | FileCheck %s --check-prefix=ITERS3 -; RUN: opt -passes="ipsccp,inline,instcombine" -force-function-specialization -func-specialization-max-iters=4 -S < %s | FileCheck %s --check-prefix=ITERS4 +; RUN: opt -passes="ipsccp,inline,instcombine" -force-specialization -funcspec-max-iters=2 -S < %s | FileCheck %s --check-prefix=ITERS2 +; RUN: opt -passes="ipsccp,inline,instcombine" -force-specialization -funcspec-max-iters=3 -S < %s | FileCheck %s --check-prefix=ITERS3 +; RUN: opt -passes="ipsccp,inline,instcombine" -force-specialization -funcspec-max-iters=4 -S < %s | FileCheck %s --check-prefix=ITERS4 @low = internal constant i32 0, align 4 @high = internal constant i32 6, align 4 diff --git a/llvm/test/Transforms/FunctionSpecialization/function-specialization-recursive2.ll b/llvm/test/Transforms/FunctionSpecialization/function-specialization-recursive2.ll --- a/llvm/test/Transforms/FunctionSpecialization/function-specialization-recursive2.ll +++ b/llvm/test/Transforms/FunctionSpecialization/function-specialization-recursive2.ll @@ -1,4 +1,4 @@ -; RUN: opt -passes="ipsccp" -force-function-specialization -func-specialization-max-iters=2 -S < %s | FileCheck %s +; RUN: opt -passes="ipsccp" -force-specialization -funcspec-max-iters=2 -S < %s | FileCheck %s ; Volatile store preventing recursive specialisation: ; diff --git a/llvm/test/Transforms/FunctionSpecialization/function-specialization-recursive3.ll b/llvm/test/Transforms/FunctionSpecialization/function-specialization-recursive3.ll --- a/llvm/test/Transforms/FunctionSpecialization/function-specialization-recursive3.ll +++ b/llvm/test/Transforms/FunctionSpecialization/function-specialization-recursive3.ll @@ -1,4 +1,4 @@ -; RUN: opt -passes="ipsccp" -force-function-specialization -func-specialization-max-iters=2 -S < %s | FileCheck %s +; RUN: opt -passes="ipsccp" -force-specialization -funcspec-max-iters=2 -S < %s | FileCheck %s ; Duplicate store preventing recursive specialisation: ; diff --git a/llvm/test/Transforms/FunctionSpecialization/function-specialization-recursive4.ll b/llvm/test/Transforms/FunctionSpecialization/function-specialization-recursive4.ll --- a/llvm/test/Transforms/FunctionSpecialization/function-specialization-recursive4.ll +++ b/llvm/test/Transforms/FunctionSpecialization/function-specialization-recursive4.ll @@ -1,4 +1,4 @@ -; RUN: opt -passes="ipsccp" -force-function-specialization -func-specialization-max-iters=2 -S < %s | FileCheck %s +; RUN: opt -passes="ipsccp" -force-specialization -funcspec-max-iters=2 -S < %s | FileCheck %s ; Alloca is not an integer type: ; diff --git a/llvm/test/Transforms/FunctionSpecialization/function-specialization-stats.ll b/llvm/test/Transforms/FunctionSpecialization/function-specialization-stats.ll --- a/llvm/test/Transforms/FunctionSpecialization/function-specialization-stats.ll +++ b/llvm/test/Transforms/FunctionSpecialization/function-specialization-stats.ll @@ -1,5 +1,5 @@ ; REQUIRES: asserts -; RUN: opt -stats -passes="ipsccp" -S -force-function-specialization < %s 2>&1 | FileCheck %s +; RUN: opt -stats -passes="ipsccp" -S -force-specialization < %s 2>&1 | FileCheck %s ; CHECK: 2 function-specialization - Number of specializations created diff --git a/llvm/test/Transforms/FunctionSpecialization/function-specialization.ll b/llvm/test/Transforms/FunctionSpecialization/function-specialization.ll --- a/llvm/test/Transforms/FunctionSpecialization/function-specialization.ll +++ b/llvm/test/Transforms/FunctionSpecialization/function-specialization.ll @@ -1,5 +1,5 @@ -; RUN: opt -passes="ipsccp" -func-specialization-size-threshold=3 -S < %s | FileCheck %s -; RUN: opt -passes="ipsccp" -func-specialization-size-threshold=3 -S < %s | FileCheck %s --check-prefix=NOFSPEC +; RUN: opt -passes="ipsccp" -funcspec-min-function-size=3 -S < %s | FileCheck %s +; RUN: opt -passes="ipsccp" -funcspec-min-function-size=3 -S < %s | FileCheck %s --check-prefix=NOFSPEC define i64 @main(i64 %x, i1 %flag) { ; diff --git a/llvm/test/Transforms/FunctionSpecialization/function-specialization2.ll b/llvm/test/Transforms/FunctionSpecialization/function-specialization2.ll --- a/llvm/test/Transforms/FunctionSpecialization/function-specialization2.ll +++ b/llvm/test/Transforms/FunctionSpecialization/function-specialization2.ll @@ -1,8 +1,8 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py -; RUN: opt -passes="ipsccp,deadargelim" -force-function-specialization -S < %s | FileCheck %s -; RUN: opt -passes="ipsccp,deadargelim" -func-specialization-max-iters=1 -force-function-specialization -S < %s | FileCheck %s -; RUN: opt -passes="ipsccp,deadargelim" -func-specialization-max-iters=0 -force-function-specialization -S < %s | FileCheck %s --check-prefix=DISABLED -; RUN: opt -passes="ipsccp,deadargelim" -func-specialization-avg-iters-cost=1 -force-function-specialization -S < %s | FileCheck %s +; RUN: opt -passes="ipsccp,deadargelim" -force-specialization -S < %s | FileCheck %s +; RUN: opt -passes="ipsccp,deadargelim" -funcspec-max-iters=1 -force-specialization -S < %s | FileCheck %s +; RUN: opt -passes="ipsccp,deadargelim" -funcspec-max-iters=0 -force-specialization -S < %s | FileCheck %s --check-prefix=DISABLED +; RUN: opt -passes="ipsccp,deadargelim" -funcspec-avg-loop-iters=1 -force-specialization -S < %s | FileCheck %s ; DISABLED-NOT: @func.1( ; DISABLED-NOT: @func.2( diff --git a/llvm/test/Transforms/FunctionSpecialization/function-specialization3.ll b/llvm/test/Transforms/FunctionSpecialization/function-specialization3.ll --- a/llvm/test/Transforms/FunctionSpecialization/function-specialization3.ll +++ b/llvm/test/Transforms/FunctionSpecialization/function-specialization3.ll @@ -1,8 +1,8 @@ -; RUN: opt -passes="ipsccp" -func-specialization-avg-iters-cost=3 -S < %s | \ +; RUN: opt -passes="ipsccp" -funcspec-avg-loop-iters=3 -S < %s | \ ; RUN: FileCheck %s --check-prefixes=COMMON,DISABLED -; RUN: opt -passes="ipsccp" -force-function-specialization -S < %s | \ +; RUN: opt -passes="ipsccp" -force-specialization -S < %s | \ ; RUN: FileCheck %s --check-prefixes=COMMON,FORCE -; RUN: opt -passes="ipsccp" -func-specialization-avg-iters-cost=3 -force-function-specialization -S < %s | \ +; RUN: opt -passes="ipsccp" -funcspec-avg-loop-iters=3 -force-specialization -S < %s | \ ; RUN: FileCheck %s --check-prefixes=COMMON,FORCE ; Test for specializing a constant global. diff --git a/llvm/test/Transforms/FunctionSpecialization/function-specialization4.ll b/llvm/test/Transforms/FunctionSpecialization/function-specialization4.ll --- a/llvm/test/Transforms/FunctionSpecialization/function-specialization4.ll +++ b/llvm/test/Transforms/FunctionSpecialization/function-specialization4.ll @@ -1,8 +1,8 @@ -; RUN: opt -passes="ipsccp" -force-function-specialization \ -; RUN: -func-specialization-max-clones=2 -S < %s | FileCheck %s +; RUN: opt -passes="ipsccp" -force-specialization \ +; RUN: -funcspec-max-clones=2 -S < %s | FileCheck %s -; RUN: opt -passes="ipsccp" -force-function-specialization \ -; RUN: -func-specialization-max-clones=1 -S < %s | FileCheck %s --check-prefix=CONST1 +; RUN: opt -passes="ipsccp" -force-specialization \ +; RUN: -funcspec-max-clones=1 -S < %s | FileCheck %s --check-prefix=CONST1 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" diff --git a/llvm/test/Transforms/FunctionSpecialization/function-specialization5.ll b/llvm/test/Transforms/FunctionSpecialization/function-specialization5.ll --- a/llvm/test/Transforms/FunctionSpecialization/function-specialization5.ll +++ b/llvm/test/Transforms/FunctionSpecialization/function-specialization5.ll @@ -1,4 +1,4 @@ -; RUN: opt -passes="ipsccp" -force-function-specialization -S < %s | FileCheck %s +; RUN: opt -passes="ipsccp" -force-specialization -S < %s | FileCheck %s ; There's nothing to specialize here as both calls are the same, so check that: ; diff --git a/llvm/test/Transforms/FunctionSpecialization/global-rank.ll b/llvm/test/Transforms/FunctionSpecialization/global-rank.ll --- a/llvm/test/Transforms/FunctionSpecialization/global-rank.ll +++ b/llvm/test/Transforms/FunctionSpecialization/global-rank.ll @@ -1,4 +1,4 @@ -; RUN: opt -S --passes="ipsccp" -func-specialization-max-clones=1 < %s | FileCheck %s +; RUN: opt -S --passes="ipsccp" -funcspec-max-clones=1 < %s | FileCheck %s define internal i32 @f(i32 noundef %x, ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) noinline { entry: %call = tail call i32 %p(i32 noundef %x) diff --git a/llvm/test/Transforms/FunctionSpecialization/identical-specializations.ll b/llvm/test/Transforms/FunctionSpecialization/identical-specializations.ll --- a/llvm/test/Transforms/FunctionSpecialization/identical-specializations.ll +++ b/llvm/test/Transforms/FunctionSpecialization/identical-specializations.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py -; RUN: opt -passes="ipsccp" -force-function-specialization -S < %s | FileCheck %s +; RUN: opt -passes="ipsccp" -force-specialization -S < %s | FileCheck %s define i64 @main(i64 %x, i64 %y, i1 %flag) { ; CHECK-LABEL: @main( diff --git a/llvm/test/Transforms/FunctionSpecialization/literal-const.ll b/llvm/test/Transforms/FunctionSpecialization/literal-const.ll --- a/llvm/test/Transforms/FunctionSpecialization/literal-const.ll +++ b/llvm/test/Transforms/FunctionSpecialization/literal-const.ll @@ -1,8 +1,8 @@ ; RUN: opt -S --passes="ipsccp" \ -; RUN: -force-function-specialization < %s | FileCheck %s -check-prefix CHECK-NOLIT +; RUN: -force-specialization < %s | FileCheck %s -check-prefix CHECK-NOLIT ; RUN: opt -S --passes="ipsccp" \ -; RUN: -function-specialization-for-literal-constant \ -; RUN: -force-function-specialization < %s | FileCheck %s -check-prefix CHECK-LIT +; RUN: -funcspec-for-literal-constant \ +; RUN: -force-specialization < %s | FileCheck %s -check-prefix CHECK-LIT define i32 @f0(i32 noundef %x) { entry: diff --git a/llvm/test/Transforms/FunctionSpecialization/no-spec-unused-arg.ll b/llvm/test/Transforms/FunctionSpecialization/no-spec-unused-arg.ll --- a/llvm/test/Transforms/FunctionSpecialization/no-spec-unused-arg.ll +++ b/llvm/test/Transforms/FunctionSpecialization/no-spec-unused-arg.ll @@ -1,4 +1,4 @@ -; RUN: opt -S --passes="ipsccp" -force-function-specialization -function-specialization-for-literal-constant < %s | FileCheck %s +; RUN: opt -S --passes="ipsccp" -force-specialization -funcspec-for-literal-constant < %s | FileCheck %s define internal i32 @f(i32 %x, i32 %y) noinline { ret i32 %x } diff --git a/llvm/test/Transforms/FunctionSpecialization/remove-dead-recursive-function.ll b/llvm/test/Transforms/FunctionSpecialization/remove-dead-recursive-function.ll --- a/llvm/test/Transforms/FunctionSpecialization/remove-dead-recursive-function.ll +++ b/llvm/test/Transforms/FunctionSpecialization/remove-dead-recursive-function.ll @@ -1,4 +1,4 @@ -; RUN: opt -passes="ipsccp" -func-specialization-size-threshold=3 -S < %s | FileCheck %s +; RUN: opt -passes="ipsccp" -funcspec-min-function-size=3 -S < %s | FileCheck %s define i64 @main(i64 %x, i1 %flag) { entry: diff --git a/llvm/test/Transforms/FunctionSpecialization/specialization-order.ll b/llvm/test/Transforms/FunctionSpecialization/specialization-order.ll --- a/llvm/test/Transforms/FunctionSpecialization/specialization-order.ll +++ b/llvm/test/Transforms/FunctionSpecialization/specialization-order.ll @@ -1,4 +1,4 @@ -; RUN: opt -S --passes="ipsccp,deadargelim" -force-function-specialization < %s | FileCheck %s +; RUN: opt -S --passes="ipsccp,deadargelim" -force-specialization < %s | FileCheck %s define dso_local i32 @add(i32 %x, i32 %y) { entry: %add = add nsw i32 %y, %x diff --git a/llvm/test/Transforms/FunctionSpecialization/specialize-multiple-arguments.ll b/llvm/test/Transforms/FunctionSpecialization/specialize-multiple-arguments.ll --- a/llvm/test/Transforms/FunctionSpecialization/specialize-multiple-arguments.ll +++ b/llvm/test/Transforms/FunctionSpecialization/specialize-multiple-arguments.ll @@ -1,8 +1,8 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py -; RUN: opt -passes="ipsccp" -func-specialization-max-clones=0 -func-specialization-size-threshold=14 -S < %s | FileCheck %s --check-prefix=NONE -; RUN: opt -passes="ipsccp" -func-specialization-max-clones=1 -func-specialization-size-threshold=14 -S < %s | FileCheck %s --check-prefix=ONE -; RUN: opt -passes="ipsccp" -func-specialization-max-clones=2 -func-specialization-size-threshold=14 -S < %s | FileCheck %s --check-prefix=TWO -; RUN: opt -passes="ipsccp" -func-specialization-max-clones=3 -func-specialization-size-threshold=14 -S < %s | FileCheck %s --check-prefix=THREE +; RUN: opt -passes="ipsccp" -funcspec-max-clones=0 -funcspec-min-function-size=14 -S < %s | FileCheck %s --check-prefix=NONE +; RUN: opt -passes="ipsccp" -funcspec-max-clones=1 -funcspec-min-function-size=14 -S < %s | FileCheck %s --check-prefix=ONE +; RUN: opt -passes="ipsccp" -funcspec-max-clones=2 -funcspec-min-function-size=14 -S < %s | FileCheck %s --check-prefix=TWO +; RUN: opt -passes="ipsccp" -funcspec-max-clones=3 -funcspec-min-function-size=14 -S < %s | FileCheck %s --check-prefix=THREE ; Make sure that we iterate correctly after sorting the specializations: ; FnSpecialization: Specializations for function compute