< prev index next >

src/hotspot/share/opto/loopopts.cpp

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 1193,1207 **** //------------------------------split_if_with_blocks_post---------------------- // Do the real work in a non-recursive function. CFG hackery wants to be // in the post-order, so it can dirty the I-DOM info and not use the dirtied // info. ! void PhaseIdealLoop::split_if_with_blocks_post(Node *n) { // Cloning Cmp through Phi's involves the split-if transform. // FastLock is not used by an If ! if (n->is_Cmp() && !n->is_FastLock()) { Node *n_ctrl = get_ctrl(n); // Determine if the Node has inputs from some local Phi. // Returns the block to clone thru. Node *n_blk = has_local_phi_input(n); if (n_blk != n_ctrl) { --- 1193,1207 ---- //------------------------------split_if_with_blocks_post---------------------- // Do the real work in a non-recursive function. CFG hackery wants to be // in the post-order, so it can dirty the I-DOM info and not use the dirtied // info. ! void PhaseIdealLoop::split_if_with_blocks_post(Node *n, bool last_round) { // Cloning Cmp through Phi's involves the split-if transform. // FastLock is not used by an If ! if (n->is_Cmp() && !n->is_FastLock() && !last_round) { Node *n_ctrl = get_ctrl(n); // Determine if the Node has inputs from some local Phi. // Returns the block to clone thru. Node *n_blk = has_local_phi_input(n); if (n_blk != n_ctrl) {
*** 1449,1464 **** if( n_op == Op_Opaque2 && n->in(1) != NULL && get_loop(get_ctrl(n)) == get_loop(get_ctrl(n->in(1))) ) { _igvn.replace_node( n, n->in(1) ); } } //------------------------------split_if_with_blocks--------------------------- // Check for aggressive application of 'split-if' optimization, // using basic block level info. ! void PhaseIdealLoop::split_if_with_blocks(VectorSet &visited, Node_Stack &nstack) { Node* root = C->root(); visited.set(root->_idx); // first, mark root as visited // Do pre-visit work for root Node* n = split_if_with_blocks_pre(root); uint cnt = n->outcnt(); --- 1449,1470 ---- if( n_op == Op_Opaque2 && n->in(1) != NULL && get_loop(get_ctrl(n)) == get_loop(get_ctrl(n->in(1))) ) { _igvn.replace_node( n, n->in(1) ); } + + #if INCLUDE_ZGC + if (UseZGC) { + ZBarrierSetC2::loop_optimize_gc_barrier(this, n, last_round); + } + #endif } //------------------------------split_if_with_blocks--------------------------- // Check for aggressive application of 'split-if' optimization, // using basic block level info. ! void PhaseIdealLoop::split_if_with_blocks(VectorSet &visited, Node_Stack &nstack, bool last_round) { Node* root = C->root(); visited.set(root->_idx); // first, mark root as visited // Do pre-visit work for root Node* n = split_if_with_blocks_pre(root); uint cnt = n->outcnt();
*** 1480,1490 **** } else { // All of n's children have been processed, complete post-processing. if (cnt != 0 && !n->is_Con()) { assert(has_node(n), "no dead nodes"); ! split_if_with_blocks_post(n); } if (must_throttle_split_if()) { nstack.clear(); } if (nstack.is_empty()) { --- 1486,1496 ---- } else { // All of n's children have been processed, complete post-processing. if (cnt != 0 && !n->is_Con()) { assert(has_node(n), "no dead nodes"); ! split_if_with_blocks_post(n, last_round); } if (must_throttle_split_if()) { nstack.clear(); } if (nstack.is_empty()) {
*** 3021,3040 **** // bool PhaseIdealLoop::partial_peel( IdealLoopTree *loop, Node_List &old_new ) { assert(!loop->_head->is_CountedLoop(), "Non-counted loop only"); if (!loop->_head->is_Loop()) { ! return false; ! } ! LoopNode *head = loop->_head->as_Loop(); if (head->is_partial_peel_loop() || head->partial_peel_has_failed()) { return false; } // Check for complex exit control ! for (uint ii = 0; ii < loop->_body.size(); ii++) { Node *n = loop->_body.at(ii); int opc = n->Opcode(); if (n->is_Call() || opc == Op_Catch || opc == Op_CatchProj || --- 3027,3046 ---- // bool PhaseIdealLoop::partial_peel( IdealLoopTree *loop, Node_List &old_new ) { assert(!loop->_head->is_CountedLoop(), "Non-counted loop only"); if (!loop->_head->is_Loop()) { ! return false; } ! ! LoopNode *head = loop->_head->as_Loop(); if (head->is_partial_peel_loop() || head->partial_peel_has_failed()) { return false; } // Check for complex exit control ! for(uint ii = 0; ii < loop->_body.size(); ii++ ) { Node *n = loop->_body.at(ii); int opc = n->Opcode(); if (n->is_Call() || opc == Op_Catch || opc == Op_CatchProj ||
*** 3057,3072 **** // which is executed on every path thru loop. IfNode *peel_if = NULL; IfNode *peel_if_cmpu = NULL; Node *iff = loop->tail(); ! while (iff != head) { ! if (iff->is_If()) { Node *ctrl = get_ctrl(iff->in(1)); if (ctrl->is_top()) return false; // Dead test on live IF. // If loop-varying exit-test, check for induction variable ! if (loop->is_member(get_loop(ctrl)) && loop->is_loop_exit(iff) && is_possible_iv_test(iff)) { Node* cmp = iff->in(1)->in(1); if (cmp->Opcode() == Op_CmpI) { peel_if = iff->as_If(); --- 3063,3078 ---- // which is executed on every path thru loop. IfNode *peel_if = NULL; IfNode *peel_if_cmpu = NULL; Node *iff = loop->tail(); ! while( iff != head ) { ! if( iff->is_If() ) { Node *ctrl = get_ctrl(iff->in(1)); if (ctrl->is_top()) return false; // Dead test on live IF. // If loop-varying exit-test, check for induction variable ! if( loop->is_member(get_loop(ctrl)) && loop->is_loop_exit(iff) && is_possible_iv_test(iff)) { Node* cmp = iff->in(1)->in(1); if (cmp->Opcode() == Op_CmpI) { peel_if = iff->as_If();
*** 3076,3086 **** } } } iff = idom(iff); } - // Prefer signed compare over unsigned compare. IfNode* new_peel_if = NULL; if (peel_if == NULL) { if (!PartialPeelAtUnsignedTests || peel_if_cmpu == NULL) { return false; // No peel point found --- 3082,3091 ----
*** 3124,3134 **** VectorSet not_peel(area); Node_List peel_list(area); Node_List worklist(area); Node_List sink_list(area); ! if (!may_require_nodes(loop->est_loop_clone_sz(2))) { return false; } // Set of cfg nodes to peel are those that are executable from // the head through last_peel. --- 3129,3139 ---- VectorSet not_peel(area); Node_List peel_list(area); Node_List worklist(area); Node_List sink_list(area); ! if (!may_require_nodes(est_loop_clone_sz(2, loop->_body.size()))) { return false; } // Set of cfg nodes to peel are those that are executable from // the head through last_peel.
< prev index next >