Mercurial > hg > graal-compiler
changeset 22677:4ea1c903f00f
Workaround for LIR constant optimization
author | Christian Wimmer <christian.wimmer@oracle.com> |
---|---|
date | Tue, 22 Sep 2015 17:26:22 -0700 |
parents | 1ec6d2962ff5 |
children | 36e61de8d971 |
files | graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanLifetimeAnalysisPhase.java |
diffstat | 1 files changed, 16 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanLifetimeAnalysisPhase.java Tue Sep 22 23:12:56 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanLifetimeAnalysisPhase.java Tue Sep 22 17:26:22 2015 -0700 @@ -46,6 +46,10 @@ import jdk.internal.jvmci.meta.JavaConstant; import jdk.internal.jvmci.meta.LIRKind; import jdk.internal.jvmci.meta.Value; +import jdk.internal.jvmci.options.Option; +import jdk.internal.jvmci.options.OptionType; +import jdk.internal.jvmci.options.OptionValue; +import jdk.internal.jvmci.options.StableOptionValue; import com.oracle.graal.compiler.common.alloc.ComputeBlockOrder; import com.oracle.graal.compiler.common.alloc.RegisterAllocationConfig; @@ -824,6 +828,12 @@ } } + public static class Options { + @Option(help = "Enable temporary workaround for LIR constant optimization (see GRAAL-1272).", type = OptionType.Debug)// + public static final OptionValue<Boolean> NeverSpillConstants = new StableOptionValue<>(false); + + } + /** * Returns a value for a interval definition, which can be used for re-materialization. * @@ -838,6 +848,12 @@ if (op instanceof LoadConstantOp) { LoadConstantOp move = (LoadConstantOp) op; if (move.getConstant() instanceof JavaConstant) { + + /* Temporary workaround until GRAAL-1272 is fixed. */ + if (Options.NeverSpillConstants.getValue()) { + return (JavaConstant) move.getConstant(); + } + /* * Check if the interval has any uses which would accept an stack location (priority * == ShouldHaveRegister). Rematerialization of such intervals can result in a