src/share/vm/opto/reg_split.cpp

Print this page


   1 /*
   2  * Copyright (c) 2000, 2009, 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  *
  23  */
  24 
  25 #include "incls/_precompiled.incl"
  26 #include "incls/_reg_split.cpp.incl"








  27 
  28 //------------------------------Split--------------------------------------
  29 // Walk the graph in RPO and for each lrg which spills, propagate reaching
  30 // definitions.  During propagation, split the live range around regions of
  31 // High Register Pressure (HRP).  If a Def is in a region of Low Register
  32 // Pressure (LRP), it will not get spilled until we encounter a region of
  33 // HRP between it and one of its uses.  We will spill at the transition
  34 // point between LRP and HRP.  Uses in the HRP region will use the spilled
  35 // Def.  The first Use outside the HRP region will generate a SpillCopy to
  36 // hoist the live range back up into a register, and all subsequent uses
  37 // will use that new Def until another HRP region is encountered.  Defs in
  38 // HRP regions will get trailing SpillCopies to push the LRG down into the
  39 // stack immediately.
  40 //
  41 // As a side effect, unlink from (hence make dead) coalesced copies.
  42 //
  43 
  44 static const char out_of_nodes[] = "out of nodes during split";
  45 
  46 //------------------------------get_spillcopy_wide-----------------------------


   1 /*
   2  * Copyright (c) 2000, 2010, 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  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "libadt/vectset.hpp"
  27 #include "memory/allocation.inline.hpp"
  28 #include "opto/addnode.hpp"
  29 #include "opto/c2compiler.hpp"
  30 #include "opto/callnode.hpp"
  31 #include "opto/cfgnode.hpp"
  32 #include "opto/chaitin.hpp"
  33 #include "opto/loopnode.hpp"
  34 #include "opto/machnode.hpp"
  35 
  36 //------------------------------Split--------------------------------------
  37 // Walk the graph in RPO and for each lrg which spills, propagate reaching
  38 // definitions.  During propagation, split the live range around regions of
  39 // High Register Pressure (HRP).  If a Def is in a region of Low Register
  40 // Pressure (LRP), it will not get spilled until we encounter a region of
  41 // HRP between it and one of its uses.  We will spill at the transition
  42 // point between LRP and HRP.  Uses in the HRP region will use the spilled
  43 // Def.  The first Use outside the HRP region will generate a SpillCopy to
  44 // hoist the live range back up into a register, and all subsequent uses
  45 // will use that new Def until another HRP region is encountered.  Defs in
  46 // HRP regions will get trailing SpillCopies to push the LRG down into the
  47 // stack immediately.
  48 //
  49 // As a side effect, unlink from (hence make dead) coalesced copies.
  50 //
  51 
  52 static const char out_of_nodes[] = "out of nodes during split";
  53 
  54 //------------------------------get_spillcopy_wide-----------------------------