Skip to content

Commit

Permalink
prevent unnecessary graph dumps
Browse files Browse the repository at this point in the history
  • Loading branch information
dougxc committed Apr 30, 2024
1 parent cd02cc3 commit 6f059a5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import java.util.Optional;

import jdk.graal.compiler.debug.DebugOptions;
import org.junit.Assert;
import org.junit.Test;

Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 6f059a5

Please sign in to comment.