This will consider function specialization for candidate constants in a
constant range where the range represents all the possible arguments.
Currently, this will only happen when
-function-specialization-for-literal-constant is supplied.
Arguments from calls that are constant ranges themselves are still
I have a feeling I might be missing something here. Is there a reason why this wasn't already the case?
Tests affected (function-specialization.NumFuncSpecialized)
I tried measuring performance (Cycles/Instructions) with perf on x86, but there was too much noise in the results to gather anything meaningful.
Looking into the specialisations themselves, it often looks good. For some it introduces inlining opportunities. However, whether or not these were objectively good changes should be handled by the cost analysis. This change simply considers more opportunities.