From a574b8fa68043715dd096859f7b0bb2fca928b9a Mon Sep 17 00:00:00 2001 From: Doug Simon Date: Tue, 30 Apr 2024 10:41:54 +0200 Subject: [PATCH] prevent unnecessary graph dumps --- .../LoopSafepointStateVerificationTest.java | 4 +++- .../test/TestDoNotMoveAllocationIntrinsic.java | 17 +++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/LoopSafepointStateVerificationTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/LoopSafepointStateVerificationTest.java index 362a540c9db9..5e44ebf52d61 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/LoopSafepointStateVerificationTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/LoopSafepointStateVerificationTest.java @@ -26,6 +26,7 @@ import java.util.Optional; +import jdk.graal.compiler.debug.DebugOptions; import org.junit.Assert; import org.junit.Test; @@ -72,7 +73,8 @@ OptionValues testOptions() { @SuppressWarnings("try") public void test01() { try (AutoCloseable c = new TTY.Filter()) { - OptionValues opt = new OptionValues(testOptions(), GraalOptions.FullUnroll, false); + // Do not capture graphs for expected compilation failures. + OptionValues opt = new OptionValues(testOptions(), GraalOptions.FullUnroll, false, DebugOptions.DumpOnError, false); test(opt, "snippet01"); Assert.fail("Should have detected that the phase in this class does not retain the mustNotSafepoint flag of a loop begin"); } catch (Throwable t) { diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/TestDoNotMoveAllocationIntrinsic.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/TestDoNotMoveAllocationIntrinsic.java index 0d3cc8991cb1..9087448ccf0a 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/TestDoNotMoveAllocationIntrinsic.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/TestDoNotMoveAllocationIntrinsic.java @@ -24,14 +24,20 @@ */ package jdk.graal.compiler.hotspot.test; +import jdk.graal.compiler.code.CompilationResult; +import jdk.graal.compiler.core.common.CompilationIdentifier; +import jdk.graal.compiler.core.test.GraalCompilerTest; +import jdk.graal.compiler.debug.DebugOptions; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.options.OptionValues; +import jdk.vm.ci.meta.ResolvedJavaMethod; import org.junit.Assert; import org.junit.Test; import jdk.graal.compiler.api.directives.GraalDirectives; -import jdk.graal.compiler.core.test.SubprocessTest; import jdk.graal.compiler.debug.TTY; -public class TestDoNotMoveAllocationIntrinsic extends SubprocessTest { +public class TestDoNotMoveAllocationIntrinsic extends GraalCompilerTest { static Object O; @@ -59,6 +65,13 @@ public static void snippet02Local() { O = array; } + @Override + protected CompilationResult compile(ResolvedJavaMethod installedCodeOwner, StructuredGraph graph, CompilationResult compilationResult, CompilationIdentifier compilationId, OptionValues options) { + // Do not capture graphs for expected compilation failures. + OptionValues newOptions = new OptionValues(options, DebugOptions.DumpOnError, false); + return super.compile(installedCodeOwner, graph, compilationResult, compilationId, newOptions); + } + @Test @SuppressWarnings("try") public void test02Local() throws Exception {