# HG changeset patch # User rkennke # Date 1559140772 -7200 # Wed May 29 16:39:32 2019 +0200 # Node ID c53c15bbecff08cbb3d298a72bf6c82e312d3a73 # Parent 08744769b9f66295ba8e7f47d30d33ae738bbe9e Revert MachMemBarNode related diffs vs. upstream diff --git a/src/hotspot/share/adlc/formssel.cpp b/src/hotspot/share/adlc/formssel.cpp --- a/src/hotspot/share/adlc/formssel.cpp +++ b/src/hotspot/share/adlc/formssel.cpp @@ -641,6 +641,22 @@ } +bool InstructForm::is_wide_memory_kill(FormDict &globals) const { + if( _matrule == NULL ) return false; + if( !_matrule->_opType ) return false; + + if( strcmp(_matrule->_opType,"MemBarRelease") == 0 ) return true; + if( strcmp(_matrule->_opType,"MemBarAcquire") == 0 ) return true; + if( strcmp(_matrule->_opType,"MemBarReleaseLock") == 0 ) return true; + if( strcmp(_matrule->_opType,"MemBarAcquireLock") == 0 ) return true; + if( strcmp(_matrule->_opType,"MemBarStoreStore") == 0 ) return true; + if( strcmp(_matrule->_opType,"MemBarVolatile") == 0 ) return true; + if( strcmp(_matrule->_opType,"StoreFence") == 0 ) return true; + if( strcmp(_matrule->_opType,"LoadFence") == 0 ) return true; + + return false; +} + int InstructForm::memory_operand(FormDict &globals) const { // Machine independent loads must be checked for anti-dependences // Check if instruction has a USE of a memory operand class, or a def. @@ -780,7 +796,7 @@ !strcmp(_matrule->_rChild->_opType,"ShenandoahReadBarrier") || #endif !strcmp(_matrule->_rChild->_opType,"CompareAndExchangeP") || - !strcmp(_matrule->_rChild->_opType,"CompareAndExchangeN"))) return true; + !strcmp(_matrule->_rChild->_opType,"CompareAndExchangeN"))) return true; else if ( is_ideal_load() == Form::idealP ) return true; else if ( is_ideal_store() != Form::none ) return true; @@ -1162,9 +1178,6 @@ else if (is_ideal_nop()) { return "MachNopNode"; } - else if (is_ideal_membar()) { - return "MachMemBarNode"; - } else if (is_ideal_jump()) { return "MachJumpNode"; } @@ -4112,8 +4125,7 @@ !strcmp(_opType,"StoreFence") || !strcmp(_opType,"MemBarVolatile") || !strcmp(_opType,"MemBarCPUOrder") || - !strcmp(_opType,"MemBarStoreStore") || - !strcmp(_opType,"OnSpinWait"); + !strcmp(_opType,"MemBarStoreStore"); } bool MatchRule::is_ideal_loadPC() const { diff --git a/src/hotspot/share/adlc/formssel.hpp b/src/hotspot/share/adlc/formssel.hpp --- a/src/hotspot/share/adlc/formssel.hpp +++ b/src/hotspot/share/adlc/formssel.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, 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 @@ -191,6 +191,7 @@ // loads from memory, so must check for anti-dependence virtual bool needs_anti_dependence_check(FormDict &globals) const; virtual int memory_operand(FormDict &globals) const; + bool is_wide_memory_kill(FormDict &globals) const; enum memory_operand_type { NO_MEMORY_OPERAND = -1, diff --git a/src/hotspot/share/adlc/output_c.cpp b/src/hotspot/share/adlc/output_c.cpp --- a/src/hotspot/share/adlc/output_c.cpp +++ b/src/hotspot/share/adlc/output_c.cpp @@ -3263,6 +3263,10 @@ // Analyze machine instructions that either USE or DEF memory. int memory_operand = instr->memory_operand(_globalNames); + // Some guys kill all of memory + if ( instr->is_wide_memory_kill(_globalNames) ) { + memory_operand = InstructForm::MANY_MEMORY_OPERANDS; + } if ( memory_operand != InstructForm::NO_MEMORY_OPERAND ) { if( memory_operand == InstructForm::MANY_MEMORY_OPERANDS ) { diff --git a/src/hotspot/share/adlc/output_h.cpp b/src/hotspot/share/adlc/output_h.cpp --- a/src/hotspot/share/adlc/output_h.cpp +++ b/src/hotspot/share/adlc/output_h.cpp @@ -2002,6 +2002,10 @@ // Analyze machine instructions that either USE or DEF memory. int memory_operand = instr->memory_operand(_globalNames); + // Some guys kill all of memory + if ( instr->is_wide_memory_kill(_globalNames) ) { + memory_operand = InstructForm::MANY_MEMORY_OPERANDS; + } if ( memory_operand != InstructForm::NO_MEMORY_OPERAND ) { if( memory_operand == InstructForm::MANY_MEMORY_OPERANDS ) { fprintf(fp," virtual const TypePtr *adr_type() const;\n"); diff --git a/src/hotspot/share/opto/machnode.cpp b/src/hotspot/share/opto/machnode.cpp --- a/src/hotspot/share/opto/machnode.cpp +++ b/src/hotspot/share/opto/machnode.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, 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 @@ -811,12 +811,6 @@ return &jvms_for_throw; } -uint MachMemBarNode::size_of() const { return sizeof(*this); } - -const TypePtr *MachMemBarNode::adr_type() const { - return _adr_type; -} - //============================================================================= #ifndef PRODUCT void labelOper::int_format(PhaseRegAlloc *ra, const MachNode *node, outputStream *st) const { diff --git a/src/hotspot/share/opto/machnode.hpp b/src/hotspot/share/opto/machnode.hpp --- a/src/hotspot/share/opto/machnode.hpp +++ b/src/hotspot/share/opto/machnode.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -1000,19 +1000,6 @@ virtual JVMState* jvms() const; }; -class MachMemBarNode : public MachNode { - virtual uint size_of() const; // Size is bigger -public: - const TypePtr* _adr_type; // memory effects of call or return - MachMemBarNode() : MachNode() { - init_class_id(Class_MachMemBar); - _adr_type = TypePtr::BOTTOM; // the default: all of memory - } - - void set_adr_type(const TypePtr* atp) { _adr_type = atp; } - virtual const TypePtr *adr_type() const; -}; - //------------------------------MachTempNode----------------------------------- // Node used by the adlc to construct inputs to represent temporary registers diff --git a/src/hotspot/share/opto/matcher.cpp b/src/hotspot/share/opto/matcher.cpp --- a/src/hotspot/share/opto/matcher.cpp +++ b/src/hotspot/share/opto/matcher.cpp @@ -1005,9 +1005,6 @@ m = n->is_SafePoint() ? match_sfpt(n->as_SafePoint()):match_tree(n); if (C->failing()) return NULL; if (m == NULL) { Matcher::soft_match_failure(); return NULL; } - if (n->is_MemBar()) { - m->as_MachMemBar()->set_adr_type(n->adr_type()); - } } else { // Nothing the matcher cares about if (n->is_Proj() && n->in(0) != NULL && n->in(0)->is_Multi()) { // Projections? // Convert to machine-dependent projection diff --git a/src/hotspot/share/opto/node.hpp b/src/hotspot/share/opto/node.hpp --- a/src/hotspot/share/opto/node.hpp +++ b/src/hotspot/share/opto/node.hpp @@ -107,7 +107,6 @@ class MachSpillCopyNode; class MachTempNode; class MachMergeNode; -class MachMemBarNode; class Matcher; class MemBarNode; class MemBarStoreStoreNode; @@ -661,7 +660,6 @@ DEFINE_CLASS_ID(MachConstant, Mach, 5) DEFINE_CLASS_ID(MachJump, MachConstant, 0) DEFINE_CLASS_ID(MachMerge, Mach, 6) - DEFINE_CLASS_ID(MachMemBar, Mach, 7) DEFINE_CLASS_ID(Type, Node, 2) DEFINE_CLASS_ID(Phi, Type, 0) @@ -856,7 +854,6 @@ DEFINE_CLASS_QUERY(MachSafePoint) DEFINE_CLASS_QUERY(MachSpillCopy) DEFINE_CLASS_QUERY(MachTemp) - DEFINE_CLASS_QUERY(MachMemBar) DEFINE_CLASS_QUERY(MachMerge) DEFINE_CLASS_QUERY(Mem) DEFINE_CLASS_QUERY(MemBar)