Skip to content

Commit 6f4daf7

Browse files
committed
[GR-53628] Infer stamp for phi built in LoopFragment.mergeEarlyExits
1 parent 9e468f5 commit 6f4daf7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

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

Lines changed: 2 additions & 2 deletions
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
@@ -108,7 +108,7 @@ protected LogicNode canonicalizeSymmetricConstant(ConstantReflectionProvider con
108108
if (type != null && nonConstant instanceof GetClassNode) {
109109
GetClassNode getClassNode = (GetClassNode) nonConstant;
110110
ValueNode object = getClassNode.getObject();
111-
assert ((ObjectStamp) object.stamp(view)).nonNull();
111+
assert ((ObjectStamp) object.stamp(view)).nonNull() : "getClassNode %s object %s should have a non-null stamp, got: %s".formatted(getClassNode, object, object.stamp(view));
112112
if (!type.isPrimitive() && (type.isConcrete() || type.isArray())) {
113113
return InstanceOfNode.create(TypeReference.createExactTrusted(type), object);
114114
}

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/nodes/loop/LoopFragment.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 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
@@ -628,6 +628,7 @@ protected void mergeEarlyExits() {
628628
phi.setNodeSourcePosition(merge.getNodeSourcePosition());
629629
phi.addInput(vpn);
630630
phi.addInput(newVpn);
631+
phi.inferStamp();
631632
introducedPhis.add(phi);
632633
replaceWith = phi;
633634
} else {

0 commit comments

Comments
 (0)