mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-22 12:04:39 +02:00
5091921: Sign flip issues in loop optimizer
Fix integer overflow problem in the code generated by loop optimizer. Reviewed-by: never
This commit is contained in:
parent
1e12174562
commit
1ac79543d0
40 changed files with 4195 additions and 214 deletions
|
@ -236,6 +236,7 @@ static Node* split_if(IfNode *iff, PhaseIterGVN *igvn) {
|
|||
}
|
||||
Node* predicate_c = NULL;
|
||||
Node* predicate_x = NULL;
|
||||
bool counted_loop = r->is_CountedLoop();
|
||||
|
||||
Node *region_c = new (igvn->C, req_c + 1) RegionNode(req_c + 1);
|
||||
Node *phi_c = con1;
|
||||
|
@ -294,16 +295,16 @@ static Node* split_if(IfNode *iff, PhaseIterGVN *igvn) {
|
|||
if (predicate_c != NULL) {
|
||||
assert(predicate_x == NULL, "only one predicate entry expected");
|
||||
// Clone loop predicates to each path
|
||||
iff_c_t = igvn->clone_loop_predicates(predicate_c, iff_c_t);
|
||||
iff_c_f = igvn->clone_loop_predicates(predicate_c, iff_c_f);
|
||||
iff_c_t = igvn->clone_loop_predicates(predicate_c, iff_c_t, !counted_loop);
|
||||
iff_c_f = igvn->clone_loop_predicates(predicate_c, iff_c_f, !counted_loop);
|
||||
}
|
||||
Node *iff_x_t = phase->transform(new (igvn->C, 1) IfTrueNode (iff_x));
|
||||
Node *iff_x_f = phase->transform(new (igvn->C, 1) IfFalseNode(iff_x));
|
||||
if (predicate_x != NULL) {
|
||||
assert(predicate_c == NULL, "only one predicate entry expected");
|
||||
// Clone loop predicates to each path
|
||||
iff_x_t = igvn->clone_loop_predicates(predicate_x, iff_x_t);
|
||||
iff_x_f = igvn->clone_loop_predicates(predicate_x, iff_x_f);
|
||||
iff_x_t = igvn->clone_loop_predicates(predicate_x, iff_x_t, !counted_loop);
|
||||
iff_x_f = igvn->clone_loop_predicates(predicate_x, iff_x_f, !counted_loop);
|
||||
}
|
||||
|
||||
// Merge the TRUE paths
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue