[PATCH] D112129: [FuncSpec] Enable it only with -O3
Arthur Eubanks via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 3 08:34:12 PDT 2021
aeubanks added inline comments.
================
Comment at: llvm/lib/Passes/PassBuilderPipelines.cpp:1402
- if (EnableFunctionSpecialization)
+ if (EnableFunctionSpecialization && Level.getSpeedupLevel() > 2)
MPM.addPass(FunctionSpecializationPass());
----------------
SjoerdMeijer wrote:
> ChuanqiXu wrote:
> > Do we need to consider SizeLevel here?
> I think this is fine as it is, because if the Speed level is 3, we know we are not optimising for size:
>
> https://github.com/llvm/llvm-project/blob/a3c05982ac05637a8f40207db83c04a1710033d5/llvm/include/llvm/Passes/OptimizationLevel.h#L32
isn't this the same as ` && Level == OptimizationLevel::O3`? any reason why the two checks are slightly different? I think `== OptimizationLevel::O3` is a bit more consistent with the other code nearby.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D112129/new/
https://reviews.llvm.org/D112129
More information about the llvm-commits
mailing list