From 9fa3783a11079ce48afc42d8da633c0b8c9f7526 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Tue, 10 Nov 2015 11:47:38 +0100 Subject: Clean up optimizer settings. --- .../scala/tools/nsc/settings/ScalaSettings.scala | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'src/compiler/scala/tools/nsc/settings/ScalaSettings.scala') diff --git a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala index cbd9ee1a55..794c0ba324 100644 --- a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala +++ b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala @@ -225,23 +225,21 @@ trait ScalaSettings extends AbsScalaSettings val YskipInlineInfoAttribute = BooleanSetting("-Yskip-inline-info-attribute", "Do not add the ScalaInlineInfo attribute to classfiles generated by -Ybackend:GenASM") object YoptChoices extends MultiChoiceEnumeration { - val unreachableCode = Choice("unreachable-code", "Eliminate unreachable code, exception handlers protecting no instructions, debug information of eliminated variables.") + val unreachableCode = Choice("unreachable-code", "Eliminate unreachable code, exception handlers guarding no instructions, redundant metadata (debug information, line numbers).") val simplifyJumps = Choice("simplify-jumps", "Simplify branching instructions, eliminate unnecessary ones.") - val emptyLineNumbers = Choice("empty-line-numbers", "Eliminate unnecessary line number information.") - val emptyLabels = Choice("empty-labels", "Eliminate and collapse redundant labels in the bytecode.") val compactLocals = Choice("compact-locals", "Eliminate empty slots in the sequence of local variables.") - val copyPropagation = Choice("copy-propagation", "Eliminate redundant local variables (locals that are copies of others).") + val copyPropagation = Choice("copy-propagation", "Eliminate redundant local variables and unused values (including closures). Enables unreachable-code.") val nullnessTracking = Choice("nullness-tracking", "Track nullness / non-nullness of local variables and apply optimizations.") - val closureElimination = Choice("closure-elimination" , "Rewrite closure invocations to the implementation method and eliminate closures.") - val inlineProject = Choice("inline-project", "Inline only methods defined in the files being compiled.") - val inlineGlobal = Choice("inline-global", "Inline methods from any source, including classfiles on the compile classpath.") + val closureInvocations = Choice("closure-invocations" , "Rewrite closure invocations to the implementation method.") + val inlineProject = Choice("inline-project", "Inline only methods defined in the files being compiled. Enables unreachable-code.") + val inlineGlobal = Choice("inline-global", "Inline methods from any source, including classfiles on the compile classpath. Enables unreachable-code.") val lNone = Choice("l:none", "Don't enable any optimizations.") private val defaultChoices = List(unreachableCode) val lDefault = Choice("l:default", "Enable default optimizations: "+ defaultChoices.mkString(","), expandsTo = defaultChoices) - private val methodChoices = List(unreachableCode, simplifyJumps, emptyLineNumbers, emptyLabels, compactLocals, copyPropagation, nullnessTracking, closureElimination) + private val methodChoices = List(unreachableCode, simplifyJumps, compactLocals, copyPropagation, nullnessTracking, closureInvocations) val lMethod = Choice("l:method", "Enable intra-method optimizations: "+ methodChoices.mkString(","), expandsTo = methodChoices) private val projectChoices = List(lMethod, inlineProject) @@ -260,19 +258,17 @@ trait ScalaSettings extends AbsScalaSettings def YoptNone = Yopt.isSetByUser && Yopt.value.isEmpty def YoptUnreachableCode = !Yopt.isSetByUser || Yopt.contains(YoptChoices.unreachableCode) def YoptSimplifyJumps = Yopt.contains(YoptChoices.simplifyJumps) - def YoptEmptyLineNumbers = Yopt.contains(YoptChoices.emptyLineNumbers) - def YoptEmptyLabels = Yopt.contains(YoptChoices.emptyLabels) def YoptCompactLocals = Yopt.contains(YoptChoices.compactLocals) def YoptCopyPropagation = Yopt.contains(YoptChoices.copyPropagation) def YoptNullnessTracking = Yopt.contains(YoptChoices.nullnessTracking) - def YoptClosureElimination = Yopt.contains(YoptChoices.closureElimination) + def YoptClosureInvocations = Yopt.contains(YoptChoices.closureInvocations) def YoptInlineProject = Yopt.contains(YoptChoices.inlineProject) def YoptInlineGlobal = Yopt.contains(YoptChoices.inlineGlobal) def YoptInlinerEnabled = YoptInlineProject || YoptInlineGlobal - def YoptBuildCallGraph = YoptInlinerEnabled || YoptClosureElimination - def YoptAddToBytecodeRepository = YoptBuildCallGraph || YoptInlinerEnabled || YoptClosureElimination + def YoptBuildCallGraph = YoptInlinerEnabled || YoptClosureInvocations + def YoptAddToBytecodeRepository = YoptBuildCallGraph || YoptInlinerEnabled || YoptClosureInvocations val YoptInlineHeuristics = ChoiceSetting( name = "-Yopt-inline-heuristics", -- cgit v1.2.3