diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/core/common/GraalOptions.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/core/common/GraalOptions.java index 9c6f8f6e6f22..44ab94e458c5 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/core/common/GraalOptions.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/core/common/GraalOptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2025, 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 @@ -207,6 +207,9 @@ public final class GraalOptions { @Option(help = "", type = OptionType.Debug) public static final OptionKey ReplaceInputsWithConstantsBasedOnStamps = new OptionKey<>(true); + @Option(help = "", type=OptionType.Debug) + public static final OptionKey EnableFixReadsConditionalElimination = new OptionKey<>(true); + @Option(help = "Uses deoptimization to prune branches of code in the generated code that have never " + "been executed by the interpreter.", type = OptionType.Expert) public static final OptionKey RemoveNeverExecutedCode = new OptionKey<>(true); diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/phases/common/FixReadsPhase.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/phases/common/FixReadsPhase.java index 75650b02747e..f790aa6ccdfb 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/phases/common/FixReadsPhase.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/phases/common/FixReadsPhase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2025, 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 @@ -688,7 +688,7 @@ protected void run(StructuredGraph graph, CoreProviders context) { fixReadsClosure.processNodes(block); } - if (GraalOptions.RawConditionalElimination.getValue(graph.getOptions())) { + if (GraalOptions.RawConditionalElimination.getValue(graph.getOptions()) && GraalOptions.EnableFixReadsConditionalElimination.getValue(graph.getOptions())) { schedule.getCFG().visitDominatorTree(createVisitor(graph, schedule, context), false); } }