1 /*
2 * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
2702 if( n->is_MachProj() && n->ideal_reg() == MachProjNode::fat_proj ) {
2703 // Fat-proj kills a slew of registers
2704 // This can add edges to 'n' and obscure whether or not it was a def,
2705 // hence the is_def flag.
2706 fat_proj_seen = true;
2707 RegMask rm = n->out_RegMask();// Make local copy
2708 while( rm.is_NotEmpty() ) {
2709 OptoReg::Name kill = rm.find_first_elem();
2710 rm.Remove(kill);
2711 anti_do_def( b, n, kill, is_def );
2712 }
2713 } else {
2714 // Get DEF'd registers the normal way
2715 anti_do_def( b, n, _regalloc->get_reg_first(n), is_def );
2716 anti_do_def( b, n, _regalloc->get_reg_second(n), is_def );
2717 }
2718
2719 // Kill projections on a branch should appear to occur on the
2720 // branch, not afterwards, so grab the masks from the projections
2721 // and process them.
2722 if (n->is_MachBranch() || n->is_Mach() && n->as_Mach()->ideal_Opcode() == Op_Jump) {
2723 for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) {
2724 Node* use = n->fast_out(i);
2725 if (use->is_Proj()) {
2726 RegMask rm = use->out_RegMask();// Make local copy
2727 while( rm.is_NotEmpty() ) {
2728 OptoReg::Name kill = rm.find_first_elem();
2729 rm.Remove(kill);
2730 anti_do_def( b, n, kill, false );
2731 }
2732 }
2733 }
2734 }
2735
2736 // Check each register used by this instruction for a following DEF/KILL
2737 // that must occur afterward and requires an anti-dependence edge.
2738 for( uint j=0; j<n->req(); j++ ) {
2739 Node *def = n->in(j);
2740 if( def ) {
2741 assert( !def->is_MachProj() || def->ideal_reg() != MachProjNode::fat_proj, "" );
2742 anti_do_use( b, n, _regalloc->get_reg_first(def) );
|
1 /*
2 * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
2702 if( n->is_MachProj() && n->ideal_reg() == MachProjNode::fat_proj ) {
2703 // Fat-proj kills a slew of registers
2704 // This can add edges to 'n' and obscure whether or not it was a def,
2705 // hence the is_def flag.
2706 fat_proj_seen = true;
2707 RegMask rm = n->out_RegMask();// Make local copy
2708 while( rm.is_NotEmpty() ) {
2709 OptoReg::Name kill = rm.find_first_elem();
2710 rm.Remove(kill);
2711 anti_do_def( b, n, kill, is_def );
2712 }
2713 } else {
2714 // Get DEF'd registers the normal way
2715 anti_do_def( b, n, _regalloc->get_reg_first(n), is_def );
2716 anti_do_def( b, n, _regalloc->get_reg_second(n), is_def );
2717 }
2718
2719 // Kill projections on a branch should appear to occur on the
2720 // branch, not afterwards, so grab the masks from the projections
2721 // and process them.
2722 if (n->is_MachBranch() || (n->is_Mach() && n->as_Mach()->ideal_Opcode() == Op_Jump)) {
2723 for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) {
2724 Node* use = n->fast_out(i);
2725 if (use->is_Proj()) {
2726 RegMask rm = use->out_RegMask();// Make local copy
2727 while( rm.is_NotEmpty() ) {
2728 OptoReg::Name kill = rm.find_first_elem();
2729 rm.Remove(kill);
2730 anti_do_def( b, n, kill, false );
2731 }
2732 }
2733 }
2734 }
2735
2736 // Check each register used by this instruction for a following DEF/KILL
2737 // that must occur afterward and requires an anti-dependence edge.
2738 for( uint j=0; j<n->req(); j++ ) {
2739 Node *def = n->in(j);
2740 if( def ) {
2741 assert( !def->is_MachProj() || def->ideal_reg() != MachProjNode::fat_proj, "" );
2742 anti_do_use( b, n, _regalloc->get_reg_first(def) );
|