summaryrefslogtreecommitdiff
path: root/src/hotspot/share/opto/loopnode.cpp
diff options
context:
space:
mode:
authorGoetz Lindenmaier <goetz@openjdk.org>2026-11-18 15:59:08 +0000
committerGoetz Lindenmaier <goetz@openjdk.org>2026-11-18 15:59:08 +0000
commit8cdd95ea41ee695463e28c3798b83151c8bdfa4f (patch)
treed67483b924baee916e7c67e6c5b84f92447704f1 /src/hotspot/share/opto/loopnode.cpp
parente047bc2ed6c2256fd72824d2b83b0eaab94f3029 (diff)
parent10ebaa9a96d18973cfd08ec6828965886945f14f (diff)
downloadopenjdk-master.tar.gz
openjdk-master.zip
Diffstat (limited to 'src/hotspot/share/opto/loopnode.cpp')
-rw-r--r--src/hotspot/share/opto/loopnode.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/hotspot/share/opto/loopnode.cpp b/src/hotspot/share/opto/loopnode.cpp
index 083179d491f..dc7b7c37bee 100644
--- a/src/hotspot/share/opto/loopnode.cpp
+++ b/src/hotspot/share/opto/loopnode.cpp
@@ -2749,6 +2749,7 @@ const TypeInt* PhaseIdealLoop::filtered_type( Node *n, Node* n_ctrl) {
Node* region = phi->in(0);
assert(n_ctrl == nullptr || n_ctrl == region, "ctrl parameter must be region");
if (region && region != C->top()) {
+ // Compute the union over the types of the paths/inputs.
for (uint i = 1; i < phi->req(); i++) {
Node* val = phi->in(i);
Node* use_c = region->in(i);
@@ -2759,10 +2760,17 @@ const TypeInt* PhaseIdealLoop::filtered_type( Node *n, Node* n_ctrl) {
} else {
filtered_t = filtered_t->meet(val_t)->is_int();
}
+ } else {
+ // We found no constriant, so we have to assume that this path
+ // is unconstrained, i.e. it could have the whole int range.
+ filtered_t = TypeInt::INT;
}
}
}
}
+
+ // The filtered type may be worse than what we already know
+ // about n, so take the intersection.
const TypeInt* n_t = _igvn.type(n)->is_int();
if (filtered_t != nullptr) {
n_t = n_t->join(filtered_t)->is_int();
@@ -2773,6 +2781,8 @@ const TypeInt* PhaseIdealLoop::filtered_type( Node *n, Node* n_ctrl) {
//------------------------------filtered_type_from_dominators--------------------------------
// Return a possibly more restrictive type for val based on condition control flow of dominators
+// Note: we can also return "nullptr", which means "no constraint", and should be interpreted
+// as if we returned TypeInt::INT.
const TypeInt* PhaseIdealLoop::filtered_type_from_dominators( Node* val, Node *use_ctrl) {
if (val->is_Con()) {
return val->bottom_type()->is_int();