< prev index next >

src/share/vm/opto/gcm.cpp

Print this page


   1 /*
   2  * Copyright (c) 1997, 2014, 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  *


 487   int load_alias_idx = C->get_alias_index(load->adr_type());
 488 #ifdef ASSERT
 489   if (load_alias_idx == Compile::AliasIdxBot && C->AliasLevel() > 0 &&
 490       (PrintOpto || VerifyAliases ||
 491        PrintMiscellaneous && (WizardMode || Verbose))) {
 492     // Load nodes should not consume all of memory.
 493     // Reporting a bottom type indicates a bug in adlc.
 494     // If some particular type of node validly consumes all of memory,
 495     // sharpen the preceding "if" to exclude it, so we can catch bugs here.
 496     tty->print_cr("*** Possible Anti-Dependence Bug:  Load consumes all of memory.");
 497     load->dump(2);
 498     if (VerifyAliases)  assert(load_alias_idx != Compile::AliasIdxBot, "");
 499   }
 500 #endif
 501   assert(load_alias_idx || (load->is_Mach() && load->as_Mach()->ideal_Opcode() == Op_StrComp),
 502          "String compare is only known 'load' that does not conflict with any stores");
 503   assert(load_alias_idx || (load->is_Mach() && load->as_Mach()->ideal_Opcode() == Op_StrEquals),
 504          "String equals is a 'load' that does not conflict with any stores");
 505   assert(load_alias_idx || (load->is_Mach() && load->as_Mach()->ideal_Opcode() == Op_StrIndexOf),
 506          "String indexOf is a 'load' that does not conflict with any stores");


 507   assert(load_alias_idx || (load->is_Mach() && load->as_Mach()->ideal_Opcode() == Op_AryEq),
 508          "Arrays equals is a 'load' that do not conflict with any stores");


 509 
 510   if (!C->alias_type(load_alias_idx)->is_rewritable()) {
 511     // It is impossible to spoil this load by putting stores before it,
 512     // because we know that the stores will never update the value
 513     // which 'load' must witness.
 514     return LCA;
 515   }
 516 
 517   node_idx_t load_index = load->_idx;
 518 
 519   // Note the earliest legal placement of 'load', as determined by
 520   // by the unique point in the dom tree where all memory effects
 521   // and other inputs are first available.  (Computed by schedule_early.)
 522   // For normal loads, 'early' is the shallowest place (dom graph wise)
 523   // to look for anti-deps between this load and any store.
 524   Block* early = get_block_for_node(load);
 525 
 526   // If we are subsuming loads, compute an "early" block that only considers
 527   // memory or address inputs. This block may be different than the
 528   // schedule_early block in that it could be at an even shallower depth in the


   1 /*
   2  * Copyright (c) 1997, 2015, 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  *


 487   int load_alias_idx = C->get_alias_index(load->adr_type());
 488 #ifdef ASSERT
 489   if (load_alias_idx == Compile::AliasIdxBot && C->AliasLevel() > 0 &&
 490       (PrintOpto || VerifyAliases ||
 491        PrintMiscellaneous && (WizardMode || Verbose))) {
 492     // Load nodes should not consume all of memory.
 493     // Reporting a bottom type indicates a bug in adlc.
 494     // If some particular type of node validly consumes all of memory,
 495     // sharpen the preceding "if" to exclude it, so we can catch bugs here.
 496     tty->print_cr("*** Possible Anti-Dependence Bug:  Load consumes all of memory.");
 497     load->dump(2);
 498     if (VerifyAliases)  assert(load_alias_idx != Compile::AliasIdxBot, "");
 499   }
 500 #endif
 501   assert(load_alias_idx || (load->is_Mach() && load->as_Mach()->ideal_Opcode() == Op_StrComp),
 502          "String compare is only known 'load' that does not conflict with any stores");
 503   assert(load_alias_idx || (load->is_Mach() && load->as_Mach()->ideal_Opcode() == Op_StrEquals),
 504          "String equals is a 'load' that does not conflict with any stores");
 505   assert(load_alias_idx || (load->is_Mach() && load->as_Mach()->ideal_Opcode() == Op_StrIndexOf),
 506          "String indexOf is a 'load' that does not conflict with any stores");
 507   assert(load_alias_idx || (load->is_Mach() && load->as_Mach()->ideal_Opcode() == Op_StrIndexOfChar),
 508          "String indexOfChar is a 'load' that does not conflict with any stores");
 509   assert(load_alias_idx || (load->is_Mach() && load->as_Mach()->ideal_Opcode() == Op_AryEq),
 510          "Arrays equals is a 'load' that does not conflict with any stores");
 511   assert(load_alias_idx || (load->is_Mach() && load->as_Mach()->ideal_Opcode() == Op_HasNegatives),
 512          "HasNegatives is a 'load' that does not conflict with any stores");
 513 
 514   if (!C->alias_type(load_alias_idx)->is_rewritable()) {
 515     // It is impossible to spoil this load by putting stores before it,
 516     // because we know that the stores will never update the value
 517     // which 'load' must witness.
 518     return LCA;
 519   }
 520 
 521   node_idx_t load_index = load->_idx;
 522 
 523   // Note the earliest legal placement of 'load', as determined by
 524   // by the unique point in the dom tree where all memory effects
 525   // and other inputs are first available.  (Computed by schedule_early.)
 526   // For normal loads, 'early' is the shallowest place (dom graph wise)
 527   // to look for anti-deps between this load and any store.
 528   Block* early = get_block_for_node(load);
 529 
 530   // If we are subsuming loads, compute an "early" block that only considers
 531   // memory or address inputs. This block may be different than the
 532   // schedule_early block in that it could be at an even shallower depth in the


< prev index next >