[llvm] [FuncSpec] Enable SpecializeLiteralConstant by default (PR #113442)
Hari Limaye via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 24 09:48:39 PDT 2024
================
@@ -682,10 +679,9 @@ bool FunctionSpecializer::run() {
(RequireMinSize && Metrics.NumInsts < MinFunctionSize))
continue;
- // TODO: For now only consider recursive functions when running multiple
- // times. This should change if specialization on literal constants gets
- // enabled.
- if (!Inserted && !Metrics.isRecursive && !SpecializeLiteralConstant)
+ // When specialization on literal constants is disabled, only consider
+ // recursive functions when running multiple times.
+ if (!SpecializeLiteralConstant && !Inserted && !Metrics.isRecursive)
----------------
hazzlim wrote:
No problem - I've added https://github.com/llvm/llvm-project/pull/113442/commits/4533583136a11f260b391c0bf9be2aeb72b389fc#diff-43f6ba03f40b792b303a3a0a05b40dccb7fe9898a649e93d71038be1ee6ebb0c
I've intentionally written it as a motivating case for removing this condition altogether, as it is an example of a non-recursive function that could be specialized on a successive iteration when `SpecializeConstantLiteral=false`.
Do you think that this makes? I don't believe it will have a significant impact on compile times - you could perhaps argue that my example is a tad contrived, however...
https://github.com/llvm/llvm-project/pull/113442
More information about the llvm-commits
mailing list