Skip to content

Commit da9b05c

Browse files
Automatic merge of master into galahad
2 parents d8ef3cd + 29ad308 commit da9b05c

File tree

51 files changed

+611
-359
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+611
-359
lines changed

common.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@
4545
"labsjdk-ee-21-llvm": {"name": "labsjdk", "version": "ee-21.0.2+13-jvmci-23.1-b33-sulong", "platformspecific": true },
4646
"graalvm-ee-21": {"name": "graalvm-java21", "version": "23.1.3", "platformspecific": true },
4747

48-
"oraclejdk-latest": {"name": "jpg-jdk", "version": "23", "build_id": "jdk-23+22", "platformspecific": true, "extrabundles": ["static-libs"]},
49-
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-23+22-jvmci-b01", "platformspecific": true },
50-
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-23+22-jvmci-b01-debug", "platformspecific": true },
51-
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-23+22-jvmci-b01-sulong", "platformspecific": true },
52-
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-23+22-jvmci-b01", "platformspecific": true },
53-
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-23+22-jvmci-b01-debug", "platformspecific": true },
54-
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-23+22-jvmci-b01-sulong", "platformspecific": true }
48+
"oraclejdk-latest": {"name": "jpg-jdk", "version": "23", "build_id": "jdk-23+23", "platformspecific": true, "extrabundles": ["static-libs"]},
49+
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-23+23-jvmci-b01", "platformspecific": true },
50+
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-23+23-jvmci-b01-debug", "platformspecific": true },
51+
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-23+23-jvmci-b01-sulong", "platformspecific": true },
52+
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-23+23-jvmci-b01", "platformspecific": true },
53+
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-23+23-jvmci-b01-debug", "platformspecific": true },
54+
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-23+23-jvmci-b01-sulong", "platformspecific": true }
5555
},
5656

5757
"eclipse": {

compiler/ci/ci_common/gate.jsonnet

+5-5
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
},
8585

8686
test:: s.base(no_warning_as_error=true),
87-
test_zgc:: s.base(no_warning_as_error=true, extra_vm_args="-XX:+UseZGC"),
87+
test_zgc:: s.base(no_warning_as_error=true, extra_vm_args="-XX:+UseZGC -XX:-ZGenerational"),
8888
test_serialgc:: s.base(no_warning_as_error=true, extra_vm_args="-XX:+UseSerialGC"),
8989

9090

@@ -127,7 +127,7 @@
127127
"-Dpolyglot.engine.CompileImmediately=true " +
128128
"-Dpolyglot.engine.BackgroundCompilation=false " +
129129
"-Dtck.inlineVerifierInstrument=false " +
130-
"-XX:+UseZGC",
130+
"-XX:+UseZGC -XX:-ZGenerational",
131131
extra_unittest_args="--verbose truffle") + {
132132
environment+: {"TRACE_COMPILATION": "true"},
133133
logs+: ["*/*_compilation.log"]
@@ -145,19 +145,19 @@
145145
},
146146

147147
ctw:: s.base("build,ctw", no_warning_as_error=true),
148-
ctw_zgc:: s.base("build,ctw", no_warning_as_error=true, extra_vm_args="-XX:+UseZGC"),
148+
ctw_zgc:: s.base("build,ctw", no_warning_as_error=true, extra_vm_args="-XX:+UseZGC -XX:-ZGenerational"),
149149

150150
ctw_economy:: s.base("build,ctweconomy", extra_vm_args="-Djdk.graal.CompilerConfiguration=economy"),
151151
ctw_phaseplan_fuzzing:: s.base("build,ctwphaseplanfuzzing"),
152152

153153
# Runs some benchmarks as tests
154154
benchmarktest:: s.base("build,benchmarktest") + jmh_benchmark_test,
155-
benchmarktest_zgc:: s.base("build,benchmarktest", extra_vm_args="-XX:+UseZGC") + jmh_benchmark_test,
155+
benchmarktest_zgc:: s.base("build,benchmarktest", extra_vm_args="-XX:+UseZGC -XX:-ZGenerational") + jmh_benchmark_test,
156156

157157
bootstrap:: s.base("build,bootstrap", no_warning_as_error=true),
158158
bootstrap_lite:: s.base("build,bootstraplite", no_warning_as_error=true),
159159
bootstrap_full:: s.base("build,bootstrapfullverify", no_warning_as_error=true),
160-
bootstrap_full_zgc:: s.base("build,bootstrapfullverify", no_warning_as_error=true, extra_vm_args="-XX:+UseZGC"),
160+
bootstrap_full_zgc:: s.base("build,bootstrapfullverify", no_warning_as_error=true, extra_vm_args="-XX:+UseZGC -XX:-ZGenerational"),
161161
bootstrap_economy:: s.base("build,bootstrapeconomy", no_warning_as_error=true, extra_vm_args="-Djdk.graal.CompilerConfiguration=economy"),
162162

163163
style:: c.deps.eclipse + c.deps.jdt + s.base("style,fullbuild,javadoc") + galahad.include,

compiler/mx.compiler/mx_graal_benchmark.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ def build_jvmci_vm_variants(raw_name, raw_config_name, extra_args, variants, inc
128128
('serialgc', ['-XX:+UseSerialGC'], 12),
129129
('pargc', ['-XX:+UseParallelGC'], 12),
130130
('g1gc', ['-XX:+UseG1GC'], 12),
131-
('zgc', ['-XX:+UseZGC'], 12),
131+
('zgc', ['-XX:+UseZGC', '-XX:-ZGenerational'], 12),
132132
# ('gen-zgc', ['-XX:+UseZGC', '-XX:+ZGenerational'], 12), # GR-45919 not yet supported
133-
('zgc-avx2', ['-XX:+UseZGC', '-XX:UseAVX=2'], 12),
134-
('zgc-avx3', ['-XX:+UseZGC', '-XX:UseAVX=3'], 12),
133+
('zgc-avx2', ['-XX:+UseZGC', '-XX:-ZGenerational', '-XX:UseAVX=2'], 12),
134+
('zgc-avx3', ['-XX:+UseZGC', '-XX:-ZGenerational', '-XX:UseAVX=3'], 12),
135135
('no-comp-oops', ['-XX:-UseCompressedOops'], 0),
136136
('no-profile-info', ['-Djvmci.UseProfilingInformation=false'], 0),
137137
('no-splitting', ['-Dpolyglot.engine.Splitting=false'], 0),
@@ -155,7 +155,7 @@ def build_jvmci_vm_variants(raw_name, raw_config_name, extra_args, variants, inc
155155
mx_benchmark.add_java_vm(JvmciJdkVm('server', 'default', ['-server', '-XX:-EnableJVMCI']), _suite, 2)
156156
mx_benchmark.add_java_vm(JvmciJdkVm('server', 'default-serialgc', ['-server', '-XX:-EnableJVMCI', '-XX:+UseSerialGC']), _suite, 2)
157157
mx_benchmark.add_java_vm(JvmciJdkVm('server', 'default-pargc', ['-server', '-XX:-EnableJVMCI', '-XX:+UseParallelGC']), _suite, 2)
158-
mx_benchmark.add_java_vm(JvmciJdkVm('server', 'default-zgc', ['-server', '-XX:-EnableJVMCI', '-XX:+UseZGC']), _suite, 2)
158+
mx_benchmark.add_java_vm(JvmciJdkVm('server', 'default-zgc', ['-server', '-XX:-EnableJVMCI', '-XX:+UseZGC', '-XX:-ZGenerational']), _suite, 2)
159159
mx_benchmark.add_java_vm(JvmciJdkVm('server', 'default-gen-zgc', ['-server', '-XX:-EnableJVMCI', '-XX:+UseZGC', '-XX:+ZGenerational']), _suite, 2)
160160
mx_benchmark.add_java_vm(JvmciJdkVm('server', 'default-no-tiered-comp', ['-server', '-XX:-EnableJVMCI', '-XX:-TieredCompilation']), _suite, 2)
161161
mx_benchmark.add_java_vm(JvmciJdkVm('server', 'hosted', ['-server', '-XX:+EnableJVMCI']), _suite, 3)

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/ea/PartialEscapeAnalysisIterationTest.java

+22-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -27,13 +27,14 @@
2727
import java.lang.ref.WeakReference;
2828
import java.util.List;
2929

30+
import org.junit.Assert;
31+
import org.junit.Test;
32+
3033
import jdk.graal.compiler.nodes.extended.BoxNode;
3134
import jdk.graal.compiler.nodes.extended.UnboxNode;
3235
import jdk.graal.compiler.nodes.java.StoreFieldNode;
3336
import jdk.graal.compiler.nodes.virtual.CommitAllocationNode;
3437
import jdk.graal.compiler.virtual.phases.ea.PartialEscapePhase;
35-
import org.junit.Assert;
36-
import org.junit.Test;
3738

3839
public class PartialEscapeAnalysisIterationTest extends EATestBase {
3940

@@ -151,4 +152,22 @@ public void testNoLoopIteration() {
151152
Assert.assertTrue(allocations.get(0).isAlive());
152153
}
153154
}
155+
156+
public static int foldFloatLessThanSelf(short y) {
157+
Double x = (double) y;
158+
int i = 0;
159+
while (x < x) {
160+
if (i++ >= 100) {
161+
break;
162+
}
163+
x = x + 1;
164+
}
165+
return i;
166+
}
167+
168+
@Test
169+
public void testFloatLessThanSelf() {
170+
prepareGraph("foldFloatLessThanSelf", true);
171+
new PartialEscapePhase(true, false, createCanonicalizerPhase(), null, graph.getOptions()).apply(graph, context);
172+
}
154173
}

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/JVMCIVersionCheck.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ public final class JVMCIVersionCheck {
5555
private static final Map<String, Map<String, Version>> JVMCI_MIN_VERSIONS = Map.of(
5656
"21", Map.of(DEFAULT_VENDOR_ENTRY, createLegacyVersion(23, 1, 33)),
5757
"23", Map.of(
58-
"Oracle Corporation", createLabsJDKVersion("23+22", 1),
59-
DEFAULT_VENDOR_ENTRY, createLabsJDKVersion("23+22", 1)));
58+
"Oracle Corporation", createLabsJDKVersion("23+23", 1),
59+
DEFAULT_VENDOR_ENTRY, createLabsJDKVersion("23+23", 1)));
6060
private static final int NA = 0;
6161
/**
6262
* Minimum Java release supported by Graal.

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/nodes/calc/CompareNode.java

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -313,7 +313,13 @@ private static LogicNode optimizeConditional(Constant constant, ConditionalNode
313313
return null;
314314
}
315315

316-
protected abstract LogicNode duplicateModified(ValueNode newW, ValueNode newY, boolean unorderedIsTrue, NodeView view);
316+
/*
317+
* Build a new node representing this comparison applied to the given operands. This may
318+
* involve a change of type (e.g., a floating-point comparison replaced by an equivalent
319+
* integer comparison). The result should be canonicalized. Therefore, it is not necessarily
320+
* an instance of the same class as the node it is being duplicated from.
321+
*/
322+
protected abstract LogicNode duplicateModified(ValueNode newX, ValueNode newY, boolean unorderedIsTrue, NodeView view);
317323
}
318324

319325
public static LogicNode createCompareNode(StructuredGraph graph, CanonicalCondition condition, ValueNode x, ValueNode y, ConstantReflectionProvider constantReflection, NodeView view) {

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/nodes/calc/FloatEqualsNode.java

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -42,7 +42,6 @@
4242
import jdk.graal.compiler.nodes.spi.CanonicalizerTool;
4343
import jdk.graal.compiler.nodes.util.GraphUtil;
4444
import jdk.graal.compiler.options.OptionValues;
45-
4645
import jdk.vm.ci.meta.ConstantReflectionProvider;
4746
import jdk.vm.ci.meta.MetaAccessProvider;
4847
import jdk.vm.ci.meta.TriState;
@@ -130,11 +129,11 @@ public LogicNode canonical(ConstantReflectionProvider constantReflection, MetaAc
130129
}
131130

132131
@Override
133-
protected CompareNode duplicateModified(ValueNode newX, ValueNode newY, boolean unorderedIsTrue, NodeView view) {
132+
protected LogicNode duplicateModified(ValueNode newX, ValueNode newY, boolean unorderedIsTrue, NodeView view) {
134133
if (newX.stamp(view) instanceof FloatStamp && newY.stamp(view) instanceof FloatStamp) {
135-
return new FloatEqualsNode(newX, newY);
134+
return FloatEqualsNode.create(newX, newY, view);
136135
} else if (newX.stamp(view) instanceof IntegerStamp && newY.stamp(view) instanceof IntegerStamp) {
137-
return new IntegerEqualsNode(newX, newY);
136+
return IntegerEqualsNode.create(newX, newY, view);
138137
}
139138
throw GraalError.shouldNotReachHereUnexpectedValue(newX.stamp(view)); // ExcludeFromJacocoGeneratedReport
140139
}

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/nodes/calc/FloatLessThanNode.java

+12-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -41,7 +41,6 @@
4141
import jdk.graal.compiler.nodes.spi.CanonicalizerTool;
4242
import jdk.graal.compiler.nodes.util.GraphUtil;
4343
import jdk.graal.compiler.options.OptionValues;
44-
4544
import jdk.vm.ci.meta.ConstantReflectionProvider;
4645
import jdk.vm.ci.meta.MetaAccessProvider;
4746
import jdk.vm.ci.meta.TriState;
@@ -96,18 +95,24 @@ public LogicNode canonical(ConstantReflectionProvider constantReflection, MetaAc
9695
if (result != null) {
9796
return result;
9897
}
99-
if (GraphUtil.unproxify(forX) == GraphUtil.unproxify(forY) && !unorderedIsTrue) {
100-
return LogicConstantNode.contradiction();
98+
if (GraphUtil.unproxify(forX) == GraphUtil.unproxify(forY)) {
99+
if (!unorderedIsTrue || (((FloatStamp) forX.stamp(view)).isNonNaN() && ((FloatStamp) forY.stamp(view)).isNonNaN())) {
100+
/*
101+
* If x is NaN and an unordered result is false, x < x is false. Otherwise, if x
102+
* cannot be NaN, x < x is false too.
103+
*/
104+
return LogicConstantNode.contradiction();
105+
}
101106
}
102107
return null;
103108
}
104109

105110
@Override
106-
protected CompareNode duplicateModified(ValueNode newX, ValueNode newY, boolean unorderedIsTrue, NodeView view) {
111+
protected LogicNode duplicateModified(ValueNode newX, ValueNode newY, boolean unorderedIsTrue, NodeView view) {
107112
if (newX.stamp(NodeView.DEFAULT) instanceof FloatStamp && newY.stamp(NodeView.DEFAULT) instanceof FloatStamp) {
108-
return new FloatLessThanNode(newX, newY, unorderedIsTrue);
113+
return FloatLessThanNode.create(newX, newY, unorderedIsTrue, view);
109114
} else if (newX.stamp(NodeView.DEFAULT) instanceof IntegerStamp && newY.stamp(NodeView.DEFAULT) instanceof IntegerStamp) {
110-
return new IntegerLessThanNode(newX, newY);
115+
return IntegerLessThanNode.create(newX, newY, view);
111116
}
112117
throw GraalError.shouldNotReachHere(newX.stamp(view) + " " + newY.stamp(view)); // ExcludeFromJacocoGeneratedReport
113118
}

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/nodes/calc/IntegerBelowNode.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -86,10 +86,10 @@ public Node canonical(CanonicalizerTool tool, ValueNode forX, ValueNode forY) {
8686

8787
public static class BelowOp extends LowerOp {
8888
@Override
89-
protected CompareNode duplicateModified(ValueNode newX, ValueNode newY, boolean unorderedIsTrue, NodeView view) {
89+
protected LogicNode duplicateModified(ValueNode newX, ValueNode newY, boolean unorderedIsTrue, NodeView view) {
9090
assert newX.stamp(NodeView.DEFAULT) instanceof IntegerStamp : Assertions.errorMessageContext("newX", newX);
9191
assert newY.stamp(NodeView.DEFAULT) instanceof IntegerStamp : Assertions.errorMessageContext("newY", newY);
92-
return new IntegerBelowNode(newX, newY);
92+
return IntegerBelowNode.create(newX, newY, view);
9393
}
9494

9595
@Override

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/nodes/calc/IntegerEqualsNode.java

+4-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,6 @@
2525
package jdk.graal.compiler.nodes.calc;
2626

2727
import jdk.graal.compiler.core.common.calc.CanonicalCondition;
28-
import jdk.graal.compiler.core.common.type.AbstractPointerStamp;
29-
import jdk.graal.compiler.core.common.type.FloatStamp;
3028
import jdk.graal.compiler.core.common.type.IntegerStamp;
3129
import jdk.graal.compiler.core.common.type.Stamp;
3230
import jdk.graal.compiler.debug.Assertions;
@@ -110,13 +108,9 @@ protected LogicNode optimizeNormalizeCompare(ConstantReflectionProvider constant
110108
}
111109

112110
@Override
113-
protected CompareNode duplicateModified(ValueNode newX, ValueNode newY, boolean unorderedIsTrue, NodeView view) {
114-
if (newX.stamp(view) instanceof FloatStamp && newY.stamp(view) instanceof FloatStamp) {
115-
return new FloatEqualsNode(newX, newY);
116-
} else if (newX.stamp(view) instanceof IntegerStamp && newY.stamp(view) instanceof IntegerStamp) {
117-
return new IntegerEqualsNode(newX, newY);
118-
} else if (newX.stamp(view) instanceof AbstractPointerStamp && newY.stamp(view) instanceof AbstractPointerStamp) {
119-
return new IntegerEqualsNode(newX, newY);
111+
protected LogicNode duplicateModified(ValueNode newX, ValueNode newY, boolean unorderedIsTrue, NodeView view) {
112+
if (newX.stamp(view) instanceof IntegerStamp && newY.stamp(view) instanceof IntegerStamp) {
113+
return IntegerEqualsNode.create(newX, newY, view);
120114
}
121115
throw GraalError.shouldNotReachHere(newX.stamp(view) + " " + newY.stamp(view)); // ExcludeFromJacocoGeneratedReport
122116
}

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/nodes/calc/IntegerLessThanNode.java

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,6 @@
2929
import jdk.graal.compiler.core.common.GraalOptions;
3030
import jdk.graal.compiler.core.common.NumUtil;
3131
import jdk.graal.compiler.core.common.calc.CanonicalCondition;
32-
import jdk.graal.compiler.core.common.type.FloatStamp;
3332
import jdk.graal.compiler.core.common.type.IntegerStamp;
3433
import jdk.graal.compiler.core.common.type.Stamp;
3534
import jdk.graal.compiler.debug.Assertions;
@@ -105,13 +104,15 @@ public static boolean subtractMayOverflow(long x, long y, long maxValue) {
105104

106105
public static class LessThanOp extends LowerOp {
107106
@Override
108-
protected CompareNode duplicateModified(ValueNode newX, ValueNode newY, boolean unorderedIsTrue, NodeView view) {
109-
if (newX.stamp(view) instanceof FloatStamp && newY.stamp(view) instanceof FloatStamp) {
110-
return new FloatLessThanNode(newX, newY, unorderedIsTrue); // TODO: Is the last arg
111-
// supposed to be true?
112-
} else if (newX.stamp(view) instanceof IntegerStamp && newY.stamp(view) instanceof IntegerStamp) {
113-
return new IntegerLessThanNode(newX, newY);
107+
protected LogicNode duplicateModified(ValueNode newX, ValueNode newY, boolean unorderedIsTrue, NodeView view) {
108+
if (newX.stamp(view) instanceof IntegerStamp && newY.stamp(view) instanceof IntegerStamp) {
109+
return IntegerLessThanNode.create(newX, newY, view);
114110
}
111+
/*
112+
* We cannot model the replacement of an integer compare by a floating-point compare
113+
* because we don't know how to handle the unordered case. The unorderedIsTrue parameter
114+
* cannot be trusted since its value is arbitrary for the original integer compare.
115+
*/
115116
throw GraalError.shouldNotReachHere(newX.stamp(view) + " " + newY.stamp(view)); // ExcludeFromJacocoGeneratedReport
116117
}
117118

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/nodes/calc/IntegerLowerThanNode.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -132,6 +132,9 @@ public abstract static class LowerOp extends CompareOp {
132132
@Override
133133
public LogicNode canonical(ConstantReflectionProvider constantReflection, MetaAccessProvider metaAccess, OptionValues options, Integer smallestCompareWidth, CanonicalCondition condition,
134134
boolean unorderedIsTrue, ValueNode forX, ValueNode forY, NodeView view) {
135+
if (forX == forY) {
136+
return LogicConstantNode.contradiction();
137+
}
135138
LogicNode result = super.canonical(constantReflection, metaAccess, options, smallestCompareWidth, condition, unorderedIsTrue, forX, forY, view);
136139
if (result != null) {
137140
return result;

0 commit comments

Comments
 (0)