changeset 60222:a1be565c0afe

8240070: Shenandoah: remove obsolete ShenandoahCommonGCStateLoads Reviewed-by: rkennke
author shade
date Wed, 26 Feb 2020 19:36:50 +0100
parents 495566ff7149
children 525cbaab106d
files src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.hpp src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp test/hotspot/jtreg/gc/shenandoah/compiler/TestCommonGCLoads.java
diffstat 4 files changed, 0 insertions(+), 111 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp	Wed Feb 26 19:36:43 2020 +0100
+++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp	Wed Feb 26 19:36:50 2020 +0100
@@ -151,31 +151,6 @@
   return false;
 }
 
-bool ShenandoahBarrierC2Support::try_common_gc_state_load(Node *n, PhaseIdealLoop *phase) {
-  assert(is_gc_state_load(n), "inconsistent");
-  Node* addp = n->in(MemNode::Address);
-  Node* dominator = NULL;
-  for (DUIterator_Fast imax, i = addp->fast_outs(imax); i < imax; i++) {
-    Node* u = addp->fast_out(i);
-    assert(is_gc_state_load(u), "inconsistent");
-    if (u != n && phase->is_dominator(u->in(0), n->in(0))) {
-      if (dominator == NULL) {
-        dominator = u;
-      } else {
-        if (phase->dom_depth(u->in(0)) < phase->dom_depth(dominator->in(0))) {
-          dominator = u;
-        }
-      }
-    }
-  }
-  if (dominator == NULL || has_safepoint_between(n->in(0), dominator->in(0), phase)) {
-    return false;
-  }
-  phase->igvn().replace_node(n, dominator);
-
-  return true;
-}
-
 #ifdef ASSERT
 bool ShenandoahBarrierC2Support::verify_helper(Node* in, Node_Stack& phis, VectorSet& visited, verify_type t, bool trace, Unique_Node_List& barriers_used) {
   assert(phis.size() == 0, "");
@@ -1966,7 +1941,6 @@
 
 void ShenandoahBarrierC2Support::optimize_after_expansion(VectorSet &visited, Node_Stack &stack, Node_List &old_new, PhaseIdealLoop* phase) {
   Node_List heap_stable_tests;
-  Node_List gc_state_loads;
   stack.push(phase->C->start(), 0);
   do {
     Node* n = stack.node();
@@ -1980,26 +1954,12 @@
       }
     } else {
       stack.pop();
-      if (ShenandoahCommonGCStateLoads && is_gc_state_load(n)) {
-        gc_state_loads.push(n);
-      }
       if (n->is_If() && is_heap_stable_test(n)) {
         heap_stable_tests.push(n);
       }
     }
   } while (stack.size() > 0);
 
-  bool progress;
-  do {
-    progress = false;
-    for (uint i = 0; i < gc_state_loads.size(); i++) {
-      Node* n = gc_state_loads.at(i);
-      if (n->outcnt() != 0) {
-        progress |= try_common_gc_state_load(n, phase);
-      }
-    }
-  } while (progress);
-
   for (uint i = 0; i < heap_stable_tests.size(); i++) {
     Node* n = heap_stable_tests.at(i);
     assert(is_heap_stable_test(n), "only evacuation test");
--- a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.hpp	Wed Feb 26 19:36:43 2020 +0100
+++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.hpp	Wed Feb 26 19:36:50 2020 +0100
@@ -54,7 +54,6 @@
   static Node* dom_mem(Node* mem, Node* ctrl, int alias, Node*& mem_ctrl, PhaseIdealLoop* phase);
   static Node* no_branches(Node* c, Node* dom, bool allow_one_proj, PhaseIdealLoop* phase);
   static bool is_heap_state_test(Node* iff, int mask);
-  static bool try_common_gc_state_load(Node *n, PhaseIdealLoop *phase);
   static bool has_safepoint_between(Node* start, Node* stop, PhaseIdealLoop *phase);
   static Node* find_bottom_mem(Node* ctrl, PhaseIdealLoop* phase);
   static void follow_barrier_uses(Node* n, Node* ctrl, Unique_Node_List& uses, PhaseIdealLoop* phase);
--- a/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp	Wed Feb 26 19:36:43 2020 +0100
+++ b/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp	Wed Feb 26 19:36:50 2020 +0100
@@ -377,9 +377,6 @@
           "Turn it off for maximum compatibility with reflection or JNI "   \
           "code that manipulates final fields.")                            \
                                                                             \
-  experimental(bool, ShenandoahCommonGCStateLoads, false,                   \
-         "Enable commonming for GC state loads in generated code.")         \
-                                                                            \
   develop(bool, ShenandoahVerifyOptoBarriers, false,                        \
           "Verify no missing barriers in C2")                               \
                                                                             \
--- a/test/hotspot/jtreg/gc/shenandoah/compiler/TestCommonGCLoads.java	Wed Feb 26 19:36:43 2020 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2018, Red Hat, Inc. 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/**
- * @test TestCommonGCLoads
- * @summary Test GC state load commoning works
- * @key gc
- * @requires vm.flavor == "server"
- * @requires vm.gc.Shenandoah & !vm.graal.enabled
- * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:-TieredCompilation
- *                   -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC
- *                   -XX:-ShenandoahCommonGCStateLoads
- *                   TestCommonGCLoads
- * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:-TieredCompilation
- *                   -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC
- *                   -XX:+ShenandoahCommonGCStateLoads
- *                   TestCommonGCLoads
- */
-
-public class TestCommonGCLoads {
-
-    static Object d = new Object();
-
-    static Target t1 = new Target();
-    static Target t2 = new Target();
-    static Target t3 = new Target();
-    static Target t4 = new Target();
-    static Target t5 = new Target();
-
-    static void test() {
-        t1.field = d;
-        t2.field = d;
-        t3.field = d;
-        t4.field = d;
-        t5.field = d;
-    }
-
-    static public void main(String[] args) {
-        for (int i = 0; i < 100_000; i++) {
-            test();
-        }
-    }
-
-    static class Target {
-        Object field;
-    }
-}