src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StampCanonicalizerTest.java
equal
deleted
inserted
replaced
25 package org.graalvm.compiler.core.test; |
25 package org.graalvm.compiler.core.test; |
26 |
26 |
27 import org.graalvm.compiler.core.common.type.IntegerStamp; |
27 import org.graalvm.compiler.core.common.type.IntegerStamp; |
28 import org.graalvm.compiler.nodes.StructuredGraph; |
28 import org.graalvm.compiler.nodes.StructuredGraph; |
29 import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions; |
29 import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions; |
30 import org.graalvm.compiler.phases.common.CanonicalizerPhase; |
|
31 import org.graalvm.compiler.phases.common.DeadCodeEliminationPhase; |
30 import org.graalvm.compiler.phases.common.DeadCodeEliminationPhase; |
32 import org.junit.Test; |
31 import org.junit.Test; |
33 |
32 |
34 /** |
33 /** |
35 * This class tests some specific patterns the stamp system should be able to canonicalize away |
34 * This class tests some specific patterns the stamp system should be able to canonicalize away |
109 testZeroReturn("distinctMask"); |
108 testZeroReturn("distinctMask"); |
110 } |
109 } |
111 |
110 |
112 private void testZeroReturn(String methodName) { |
111 private void testZeroReturn(String methodName) { |
113 StructuredGraph graph = parseEager(methodName, AllowAssumptions.YES); |
112 StructuredGraph graph = parseEager(methodName, AllowAssumptions.YES); |
114 new CanonicalizerPhase().apply(graph, getProviders()); |
113 createCanonicalizerPhase().apply(graph, getProviders()); |
115 new DeadCodeEliminationPhase().apply(graph); |
114 new DeadCodeEliminationPhase().apply(graph); |
116 assertConstantReturn(graph, 0); |
115 assertConstantReturn(graph, 0); |
117 } |
116 } |
118 } |
117 } |