Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8286197: C2: Optimize MemorySegment shape in int loop #8555

Closed
wants to merge 7 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions src/hotspot/share/opto/castnode.cpp
Original file line number Diff line number Diff line change
@@ -382,13 +382,18 @@ Node *CastLLNode::Ideal(PhaseGVN *phase, bool can_reshape) {
if (in1 != NULL && in1->Opcode() == Op_ConvI2L) {
const Type* t = Value(phase);
const Type* t_in = phase->type(in1);
if (t != Type::TOP && t_in != Type::TOP && t != t_in) {
if (t != Type::TOP && t_in != Type::TOP) {
const TypeLong* tl = t->is_long();
const TypeInt* ti = TypeInt::make(checked_cast<jint>(tl->_lo), checked_cast<jint>(tl->_hi), tl->_widen);
Node* castii = phase->transform(new CastIINode(in(0), in1->in(1), ti));
Node* convi2l = in1->clone();
convi2l->set_req(1, castii);
return convi2l;
const TypeLong* t_in_l = t_in->is_long();
assert(tl->_lo >= t_in_l->_lo && tl->_hi <= t_in_l->_hi, "CastLL type should be narrower than or equal to the type of its input");
assert((tl != t_in_l) == (tl->_lo > t_in_l->_lo || tl->_hi < t_in_l->_hi), "if type differs then this nodes's type must be narrower");
if (tl != t_in_l) {
const TypeInt* ti = TypeInt::make(checked_cast<jint>(tl->_lo), checked_cast<jint>(tl->_hi), tl->_widen);
Node* castii = phase->transform(new CastIINode(in(0), in1->in(1), ti));
Node* convi2l = in1->clone();
convi2l->set_req(1, castii);
return convi2l;
}
}
}
return NULL;
2 changes: 1 addition & 1 deletion src/hotspot/share/opto/loopopts.cpp
Original file line number Diff line number Diff line change
@@ -1081,7 +1081,7 @@ Node *PhaseIdealLoop::split_if_with_blocks_pre( Node *n ) {
return n;
}

// Check for having no control input; not pinned. Allow
// Check for having no control input; not pinned. Allow
// dominating control.
if (n->in(0)) {
Node *dom = idom(n_blk);