# HG changeset patch # User Josef Eisl # Date 1424205485 -3600 # Node ID cb7e8c0da978041730cde620fb207cedd192c755 # Parent ab8decaddb11a3f607ea821fbd72e3a4288b5882 Rename LIRLowTier to PostAllocationOptimizationStage. diff -r ab8decaddb11 -r cb7e8c0da978 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java Tue Feb 17 21:33:48 2015 +0100 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java Tue Feb 17 21:38:05 2015 +0100 @@ -45,7 +45,7 @@ import com.oracle.graal.lir.gen.*; import com.oracle.graal.lir.phases.*; import com.oracle.graal.lir.phases.PreAllocationOptimizationPhase.PreAllocationOptimizationContext; -import com.oracle.graal.lir.phases.LIRLowTierPhase.LIRLowTierContext; +import com.oracle.graal.lir.phases.PostAllocationOptimizationPhase.PostAllocationOptimizationContext; import com.oracle.graal.lir.phases.AllocationPhase.AllocationContext; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.cfg.*; @@ -358,8 +358,8 @@ AllocationContext midTierContext = new AllocationContext(); lirSuites.getAllocationStage().apply(target, lirGenRes, codeEmittingOrder, linearScanOrder, midTierContext); - LIRLowTierContext lowTierContext = new LIRLowTierContext(); - lirSuites.getLowTier().apply(target, lirGenRes, codeEmittingOrder, linearScanOrder, lowTierContext); + PostAllocationOptimizationContext lowTierContext = new PostAllocationOptimizationContext(); + lirSuites.getPostAllocationOptimizationStage().apply(target, lirGenRes, codeEmittingOrder, linearScanOrder, lowTierContext); return lirGenRes; } diff -r ab8decaddb11 -r cb7e8c0da978 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/BasicCompilerConfiguration.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/BasicCompilerConfiguration.java Tue Feb 17 21:33:48 2015 +0100 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/BasicCompilerConfiguration.java Tue Feb 17 21:38:05 2015 +0100 @@ -25,7 +25,7 @@ import com.oracle.graal.api.runtime.*; import com.oracle.graal.lir.phases.*; import com.oracle.graal.lir.phases.PreAllocationOptimizationPhase.*; -import com.oracle.graal.lir.phases.LIRLowTierPhase.*; +import com.oracle.graal.lir.phases.PostAllocationOptimizationPhase.*; import com.oracle.graal.lir.phases.AllocationPhase.*; import com.oracle.graal.phases.*; import com.oracle.graal.phases.tiers.*; @@ -53,8 +53,8 @@ return new AllocationStage(); } - public LIRPhaseSuite createLIRLowTier() { - return new LIRLowTier(); + public LIRPhaseSuite createPostAllocationOptimizationStage() { + return new PostAllocationOptimizationStage(); } } diff -r ab8decaddb11 -r cb7e8c0da978 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ControlFlowOptimizer.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ControlFlowOptimizer.java Tue Feb 17 21:33:48 2015 +0100 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ControlFlowOptimizer.java Tue Feb 17 21:38:05 2015 +0100 @@ -35,7 +35,7 @@ /** * This class performs basic optimizations on the control flow graph after LIR generation. */ -public final class ControlFlowOptimizer extends LIRLowTierPhase { +public final class ControlFlowOptimizer extends PostAllocationOptimizationPhase { /** * Performs control flow optimizations on the given LIR graph. diff -r ab8decaddb11 -r cb7e8c0da978 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/EdgeMoveOptimizer.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/EdgeMoveOptimizer.java Tue Feb 17 21:33:48 2015 +0100 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/EdgeMoveOptimizer.java Tue Feb 17 21:38:05 2015 +0100 @@ -48,7 +48,7 @@ * Because this optimization works best when a block contains only a few moves, it has a huge impact * on the number of blocks that are totally empty. */ -public final class EdgeMoveOptimizer extends LIRLowTierPhase { +public final class EdgeMoveOptimizer extends PostAllocationOptimizationPhase { @Override protected > void run(TargetDescription target, LIRGenerationResult lirGenRes, List codeEmittingOrder, List linearScanOrder) { diff -r ab8decaddb11 -r cb7e8c0da978 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/NullCheckOptimizer.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/NullCheckOptimizer.java Tue Feb 17 21:33:48 2015 +0100 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/NullCheckOptimizer.java Tue Feb 17 21:38:05 2015 +0100 @@ -31,7 +31,7 @@ import com.oracle.graal.lir.gen.*; import com.oracle.graal.lir.phases.*; -public final class NullCheckOptimizer extends LIRLowTierPhase { +public final class NullCheckOptimizer extends PostAllocationOptimizationPhase { @Override protected > void run(TargetDescription target, LIRGenerationResult lirGenRes, List codeEmittingOrder, List linearScanOrder) { diff -r ab8decaddb11 -r cb7e8c0da978 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/RedundantMoveElimination.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/RedundantMoveElimination.java Tue Feb 17 21:33:48 2015 +0100 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/RedundantMoveElimination.java Tue Feb 17 21:38:05 2015 +0100 @@ -41,7 +41,7 @@ /** * Removes move instructions, where the destination value is already in place. */ -public final class RedundantMoveElimination extends LIRLowTierPhase { +public final class RedundantMoveElimination extends PostAllocationOptimizationPhase { @Override protected > void run(TargetDescription target, LIRGenerationResult lirGenRes, List codeEmittingOrder, List linearScanOrder) { diff -r ab8decaddb11 -r cb7e8c0da978 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRLowTier.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRLowTier.java Tue Feb 17 21:33:48 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2015, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.lir.phases; - -import com.oracle.graal.lir.*; -import com.oracle.graal.lir.phases.LIRLowTierPhase.*; -import com.oracle.graal.options.*; - -public class LIRLowTier extends LIRPhaseSuite { - public static class Options { - // @formatter:off - @Option(help = "", type = OptionType.Debug) - public static final OptionValue LIROptEdgeMoveOptimizer = new OptionValue<>(true); - @Option(help = "", type = OptionType.Debug) - public static final OptionValue LIROptControlFlowOptmizer = new OptionValue<>(true); - @Option(help = "", type = OptionType.Debug) - public static final OptionValue LIROptRedundantMoveElimination = new OptionValue<>(true); - @Option(help = "", type = OptionType.Debug) - public static final OptionValue LIROptNullCheckOptimizer = new OptionValue<>(true); - // @formatter:on - } - - public LIRLowTier() { - if (Options.LIROptEdgeMoveOptimizer.getValue()) { - appendPhase(new EdgeMoveOptimizer()); - } - if (Options.LIROptControlFlowOptmizer.getValue()) { - appendPhase(new ControlFlowOptimizer()); - } - if (Options.LIROptRedundantMoveElimination.getValue()) { - appendPhase(new RedundantMoveElimination()); - } - if (Options.LIROptNullCheckOptimizer.getValue()) { - appendPhase(new NullCheckOptimizer()); - } - } -} diff -r ab8decaddb11 -r cb7e8c0da978 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRLowTierPhase.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRLowTierPhase.java Tue Feb 17 21:33:48 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2015, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.lir.phases; - -import java.util.*; - -import com.oracle.graal.api.code.*; -import com.oracle.graal.compiler.common.cfg.*; -import com.oracle.graal.lir.gen.*; - -public abstract class LIRLowTierPhase extends LIRPhase { - - public static final class LIRLowTierContext { - } - - @Override - protected final > void run(TargetDescription target, LIRGenerationResult lirGenRes, List codeEmittingOrder, List linearScanOrder, LIRLowTierContext context) { - run(target, lirGenRes, codeEmittingOrder, linearScanOrder); - } - - protected abstract > void run(TargetDescription target, LIRGenerationResult lirGenRes, List codeEmittingOrder, List linearScanOrder); - -} diff -r ab8decaddb11 -r cb7e8c0da978 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRSuites.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRSuites.java Tue Feb 17 21:33:48 2015 +0100 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRSuites.java Tue Feb 17 21:38:05 2015 +0100 @@ -26,19 +26,19 @@ import com.oracle.graal.lir.*; import com.oracle.graal.lir.gen.*; import com.oracle.graal.lir.phases.PreAllocationOptimizationPhase.PreAllocationOptimizationContext; -import com.oracle.graal.lir.phases.LIRLowTierPhase.LIRLowTierContext; +import com.oracle.graal.lir.phases.PostAllocationOptimizationPhase.PostAllocationOptimizationContext; import com.oracle.graal.lir.phases.AllocationPhase.AllocationContext; public class LIRSuites { private final LIRPhaseSuite preAllocOptStage; private final LIRPhaseSuite allocStage; - private final LIRPhaseSuite lowTier; + private final LIRPhaseSuite postAllocStage; - public LIRSuites(LIRPhaseSuite preAllocOptStage, LIRPhaseSuite allocStage, LIRPhaseSuite lowTier) { + public LIRSuites(LIRPhaseSuite preAllocOptStage, LIRPhaseSuite allocStage, LIRPhaseSuite postAllocStage) { this.preAllocOptStage = preAllocOptStage; this.allocStage = allocStage; - this.lowTier = lowTier; + this.postAllocStage = postAllocStage; } /** @@ -65,14 +65,14 @@ } /** - * {@link LIRLowTierPhase}s are executed after register allocation and before machine code + * {@link PostAllocationOptimizationPhase}s are executed after register allocation and before machine code * generation. *

- * A {@link LIRLowTierPhase} must not introduce new {@link Variable}s, {@link VirtualStackSlot}s + * A {@link PostAllocationOptimizationPhase} must not introduce new {@link Variable}s, {@link VirtualStackSlot}s * or {@link StackSlot}s. */ - public LIRPhaseSuite getLowTier() { - return lowTier; + public LIRPhaseSuite getPostAllocationOptimizationStage() { + return postAllocStage; } } diff -r ab8decaddb11 -r cb7e8c0da978 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/PostAllocationOptimizationPhase.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/PostAllocationOptimizationPhase.java Tue Feb 17 21:38:05 2015 +0100 @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2015, 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.graal.lir.phases; + +import java.util.*; + +import com.oracle.graal.api.code.*; +import com.oracle.graal.compiler.common.cfg.*; +import com.oracle.graal.lir.gen.*; + +public abstract class PostAllocationOptimizationPhase extends LIRPhase { + + public static final class PostAllocationOptimizationContext { + } + + @Override + protected final > void run(TargetDescription target, LIRGenerationResult lirGenRes, List codeEmittingOrder, List linearScanOrder, PostAllocationOptimizationContext context) { + run(target, lirGenRes, codeEmittingOrder, linearScanOrder); + } + + protected abstract > void run(TargetDescription target, LIRGenerationResult lirGenRes, List codeEmittingOrder, List linearScanOrder); + +} diff -r ab8decaddb11 -r cb7e8c0da978 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/PostAllocationOptimizationStage.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/PostAllocationOptimizationStage.java Tue Feb 17 21:38:05 2015 +0100 @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2015, 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.graal.lir.phases; + +import com.oracle.graal.lir.*; +import com.oracle.graal.lir.phases.PostAllocationOptimizationPhase.*; +import com.oracle.graal.options.*; + +public class PostAllocationOptimizationStage extends LIRPhaseSuite { + public static class Options { + // @formatter:off + @Option(help = "", type = OptionType.Debug) + public static final OptionValue LIROptEdgeMoveOptimizer = new OptionValue<>(true); + @Option(help = "", type = OptionType.Debug) + public static final OptionValue LIROptControlFlowOptmizer = new OptionValue<>(true); + @Option(help = "", type = OptionType.Debug) + public static final OptionValue LIROptRedundantMoveElimination = new OptionValue<>(true); + @Option(help = "", type = OptionType.Debug) + public static final OptionValue LIROptNullCheckOptimizer = new OptionValue<>(true); + // @formatter:on + } + + public PostAllocationOptimizationStage() { + if (Options.LIROptEdgeMoveOptimizer.getValue()) { + appendPhase(new EdgeMoveOptimizer()); + } + if (Options.LIROptControlFlowOptmizer.getValue()) { + appendPhase(new ControlFlowOptimizer()); + } + if (Options.LIROptRedundantMoveElimination.getValue()) { + appendPhase(new RedundantMoveElimination()); + } + if (Options.LIROptNullCheckOptimizer.getValue()) { + appendPhase(new NullCheckOptimizer()); + } + } +} diff -r ab8decaddb11 -r cb7e8c0da978 graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/CompilerConfiguration.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/CompilerConfiguration.java Tue Feb 17 21:33:48 2015 +0100 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/CompilerConfiguration.java Tue Feb 17 21:38:05 2015 +0100 @@ -25,7 +25,7 @@ import com.oracle.graal.api.runtime.*; import com.oracle.graal.lir.phases.*; import com.oracle.graal.lir.phases.PreAllocationOptimizationPhase.*; -import com.oracle.graal.lir.phases.LIRLowTierPhase.*; +import com.oracle.graal.lir.phases.PostAllocationOptimizationPhase.*; import com.oracle.graal.lir.phases.AllocationPhase.*; import com.oracle.graal.phases.*; @@ -41,5 +41,5 @@ LIRPhaseSuite createAllocationStage(); - LIRPhaseSuite createLIRLowTier(); + LIRPhaseSuite createPostAllocationOptimizationStage(); } diff -r ab8decaddb11 -r cb7e8c0da978 graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/Suites.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/Suites.java Tue Feb 17 21:33:48 2015 +0100 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/Suites.java Tue Feb 17 21:38:05 2015 +0100 @@ -133,7 +133,7 @@ public static LIRSuites createDefaultLIRSuites() { String selected = CompilerConfiguration.getValue(); if (selected.equals("")) { - return new LIRSuites(defaultConfiguration.createPreAllocationOptimizationStage(), defaultConfiguration.createAllocationStage(), defaultConfiguration.createLIRLowTier()); + return new LIRSuites(defaultConfiguration.createPreAllocationOptimizationStage(), defaultConfiguration.createAllocationStage(), defaultConfiguration.createPostAllocationOptimizationStage()); } else { return createLIRSuites(selected); } @@ -144,7 +144,7 @@ if (config == null) { throw new GraalInternalError("unknown compiler configuration: " + name); } - return new LIRSuites(config.createPreAllocationOptimizationStage(), config.createAllocationStage(), config.createLIRLowTier()); + return new LIRSuites(config.createPreAllocationOptimizationStage(), config.createAllocationStage(), config.createPostAllocationOptimizationStage()); } }