Skip to content

Commit 423292f

Browse files
committed
do not materialize instanceofs at logic negation usages (as seen in non
canonical graphs)
1 parent cd4954b commit 423292f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/replacements/InstanceOfSnippetsTemplates.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import jdk.graal.compiler.nodes.FixedGuardNode;
3737
import jdk.graal.compiler.nodes.IfNode;
3838
import jdk.graal.compiler.nodes.LogicConstantNode;
39+
import jdk.graal.compiler.nodes.LogicNegationNode;
3940
import jdk.graal.compiler.nodes.LogicNode;
4041
import jdk.graal.compiler.nodes.NodeView;
4142
import jdk.graal.compiler.nodes.PhiNode;
@@ -138,7 +139,7 @@ protected boolean canMaterialize(Node usage) {
138139
ConditionalNode cn = (ConditionalNode) usage;
139140
return cn.trueValue().isConstant() && cn.falseValue().isConstant();
140141
}
141-
if (usage instanceof IfNode || usage instanceof FixedGuardNode || usage instanceof ShortCircuitOrNode || usage instanceof ConditionAnchorNode) {
142+
if (usage instanceof IfNode || usage instanceof FixedGuardNode || usage instanceof ShortCircuitOrNode || usage instanceof ConditionAnchorNode || usage instanceof LogicNegationNode) {
142143
return false;
143144
}
144145
return true;

0 commit comments

Comments
 (0)