Skip to content

Commit fbcf4fc

Browse files
franferraxRealCLanger
authored andcommitted
8332644: Improve graph optimizations
Reviewed-by: mbalao, andrew Backport-of: 7c16d649a8118d2e7ee77cedba87e620c83294b4
1 parent 15586dc commit fbcf4fc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/hotspot/share/opto/loopnode.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2128,7 +2128,7 @@ Node *LoopLimitNode::Ideal(PhaseGVN *phase, bool can_reshape) {
21282128

21292129
const TypeInt* init_t = phase->type(in(Init) )->is_int();
21302130
const TypeInt* limit_t = phase->type(in(Limit))->is_int();
2131-
int stride_p;
2131+
jlong stride_p;
21322132
jlong lim, ini;
21332133
julong max;
21342134
if (stride_con > 0) {
@@ -2137,10 +2137,10 @@ Node *LoopLimitNode::Ideal(PhaseGVN *phase, bool can_reshape) {
21372137
ini = init_t->_lo;
21382138
max = (julong)max_jint;
21392139
} else {
2140-
stride_p = -stride_con;
2140+
stride_p = -(jlong)stride_con;
21412141
lim = init_t->_hi;
21422142
ini = limit_t->_lo;
2143-
max = (julong)min_jint;
2143+
max = (julong)(juint)min_jint; // double cast to get 0x0000000080000000, not 0xffffffff80000000
21442144
}
21452145
julong range = lim - ini + stride_p;
21462146
if (range <= max) {

0 commit comments

Comments
 (0)