8286182: [BACKOUT] x86: Handle integral division overflow during parsing

8287035: [BACKOUT] PPC64: Handle integral division overflow during parsing

Reviewed-by: mdoerr, thartmann
This commit is contained in:
Quan Anh Mai 2022-05-19 19:12:28 +00:00 committed by Martin Doerr
parent 7b19226be2
commit 079312c835
25 changed files with 502 additions and 713 deletions

View file

@ -3565,46 +3565,6 @@ void Compile::final_graph_reshaping_main_switch(Node* n, Final_Reshape_Counts& f
}
break;
case Op_NoOvfModI:
if (UseDivMod) {
// Check if a%b and a/b both exist
Node* d = n->find_similar(Op_NoOvfDivI);
if (d) {
// Replace them with a fused divmod if supported
if (Matcher::has_match_rule(Op_NoOvfDivModI)) {
NoOvfDivModINode* divmod = NoOvfDivModINode::make(n);
d->subsume_by(divmod->div_proj(), this);
n->subsume_by(divmod->mod_proj(), this);
} else {
// replace a%b with a-((a/b)*b)
Node* mult = new MulINode(d, d->in(2));
Node* sub = new SubINode(d->in(1), mult);
n->subsume_by(sub, this);
}
}
}
break;
case Op_NoOvfModL:
if (UseDivMod) {
// Check if a%b and a/b both exist
Node* d = n->find_similar(Op_NoOvfDivL);
if (d) {
// Replace them with a fused divmod if supported
if (Matcher::has_match_rule(Op_NoOvfDivModL)) {
NoOvfDivModLNode* divmod = NoOvfDivModLNode::make(n);
d->subsume_by(divmod->div_proj(), this);
n->subsume_by(divmod->mod_proj(), this);
} else {
// replace a%b with a-((a/b)*b)
Node* mult = new MulLNode(d, d->in(2));
Node* sub = new SubLNode(d->in(1), mult);
n->subsume_by(sub, this);
}
}
}
break;
case Op_LoadVector:
case Op_StoreVector:
case Op_LoadVectorGather: