Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8252372: Check if cloning is required to move loads out of loops in PhaseIdealLoop::split_if_with_blocks_post() #3689

Closed
wants to merge 6 commits into from
Closed
Changes from 4 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
@@ -8880,6 +8880,61 @@ instruct castLL(iRegL dst)
ins_pipe(pipe_class_empty);
%}

instruct castFF(vRegF dst)
%{
match(Set dst (CastFF dst));

size(0);
format %{ "# castFF of $dst" %}
ins_encode(/* empty encoding */);
ins_cost(0);
ins_pipe(pipe_class_empty);
%}

instruct castDD(vRegD dst)
%{
match(Set dst (CastDD dst));

size(0);
format %{ "# castDD of $dst" %}
ins_encode(/* empty encoding */);
ins_cost(0);
ins_pipe(pipe_class_empty);
%}

instruct castVVD(vecD dst)
%{
match(Set dst (CastVV dst));

size(0);
format %{ "# castVV of $dst" %}
ins_encode(/* empty encoding */);
ins_cost(0);
ins_pipe(pipe_class_empty);
%}

instruct castVVX(vecX dst)
%{
match(Set dst (CastVV dst));

size(0);
format %{ "# castVV of $dst" %}
ins_encode(/* empty encoding */);
ins_cost(0);
ins_pipe(pipe_class_empty);
%}

instruct castVV(vReg dst)
%{
match(Set dst (CastVV dst));

size(0);
format %{ "# castVV of $dst" %}
ins_encode(/* empty encoding */);
ins_cost(0);
ins_pipe(pipe_class_empty);
%}

// ============================================================================
// Atomic operation instructions
//
@@ -5291,6 +5291,39 @@ instruct castLL( iRegL dst ) %{
ins_pipe(empty);
%}

instruct castFF( regF dst ) %{
match(Set dst (CastFF dst));
format %{ "! castFF of $dst" %}
ins_encode( /*empty encoding*/ );
ins_cost(0);
ins_pipe(empty);
%}

instruct castDD( regD dst ) %{
match(Set dst (CastDD dst));
format %{ "! castDD of $dst" %}
ins_encode( /*empty encoding*/ );
ins_cost(0);
ins_pipe(empty);
%}

instruct castVVD( vecD dst ) %{
match(Set dst (CastVV dst));
format %{ "! castVV of $dst" %}
ins_encode( /*empty encoding*/ );
ins_cost(0);
ins_pipe(empty);
%}

instruct castVVX( vecX dst ) %{
match(Set dst (CastVV dst));
format %{ "! castVV of $dst" %}
ins_encode( /*empty encoding*/ );
ins_cost(0);
ins_pipe(empty);
%}


//----------Arithmetic Instructions--------------------------------------------
// Addition Instructions
// Register Addition
@@ -10452,6 +10452,38 @@ instruct castLL(iRegLdst dst) %{
ins_pipe(pipe_class_default);
%}

instruct castFF(regF dst) %{
match(Set dst (CastFF dst));
format %{ " -- \t// castFF of $dst" %}
size(0);
ins_encode( /*empty*/ );
ins_pipe(pipe_class_default);
%}

instruct castDD(regD dst) %{
match(Set dst (CastDD dst));
format %{ " -- \t// castDD of $dst" %}
size(0);
ins_encode( /*empty*/ );
ins_pipe(pipe_class_default);
%}

instruct castVV8(iRegLdst dst) %{
match(Set dst (CastVV dst));
format %{ " -- \t// castVV of $dst" %}
size(0);
ins_encode( /*empty*/ );
ins_pipe(pipe_class_default);
%}

instruct castVV16(vecX dst) %{
match(Set dst (CastVV dst));
format %{ " -- \t// castVV of $dst" %}
size(0);
ins_encode( /*empty*/ );
ins_pipe(pipe_class_default);
%}

instruct checkCastPP(iRegPdst dst) %{
match(Set dst (CheckCastPP dst));
format %{ " -- \t// checkcastPP of $dst" %}
@@ -5366,6 +5366,30 @@ instruct castLL(iRegL dst) %{
ins_pipe(pipe_class_dummy);
%}

instruct castFF(regF dst) %{
match(Set dst (CastFF dst));
size(0);
format %{ "# castFF of $dst" %}
ins_encode(/*empty*/);
ins_pipe(pipe_class_dummy);
%}

instruct castDD(regD dst) %{
match(Set dst (CastDD dst));
size(0);
format %{ "# castDD of $dst" %}
ins_encode(/*empty*/);
ins_pipe(pipe_class_dummy);
%}

instruct castVV(iRegL dst) %{
match(Set dst (CastVV dst));
size(0);
format %{ "# castVV of $dst" %}
ins_encode(/*empty*/);
ins_pipe(pipe_class_dummy);
%}

//----------Conditional_store--------------------------------------------------
// Conditional-store of the updated heap-top.
// Used during allocation of the shared heap.
@@ -8055,3 +8055,25 @@ instruct vmasked_store64(memory mem, vec src, kReg mask) %{
ins_pipe( pipe_slow );
%}
#endif // _LP64

instruct castVV(vec dst)
%{
match(Set dst (CastVV dst));

size(0);
format %{ "# castVV of $dst" %}
ins_encode(/* empty encoding */);
ins_cost(0);
ins_pipe(empty);
%}

instruct castVVLeg(legVec dst)
%{
match(Set dst (CastVV dst));

size(0);
format %{ "# castVV of $dst" %}
ins_encode(/* empty encoding */);
ins_cost(0);
ins_pipe(empty);
%}
@@ -7246,6 +7246,22 @@ instruct castLL( eRegL dst ) %{
ins_pipe( empty );
%}

instruct castFF( regF dst ) %{
match(Set dst (CastFF dst));
format %{ "#castFF of $dst" %}
ins_encode( /*empty encoding*/ );
ins_cost(0);
ins_pipe( empty );
%}

instruct castDD( regD dst ) %{
match(Set dst (CastDD dst));
format %{ "#castDD of $dst" %}
ins_encode( /*empty encoding*/ );
ins_cost(0);
ins_pipe( empty );
%}

// Load-locked - same as a regular pointer load when used with compare-swap
instruct loadPLocked(eRegP dst, memory mem) %{
match(Set dst (LoadPLocked mem));
@@ -7645,6 +7645,28 @@ instruct castLL(rRegL dst)
ins_pipe(empty);
%}

instruct castFF(regF dst)
%{
match(Set dst (CastFF dst));

size(0);
format %{ "# castFF of $dst" %}
ins_encode(/* empty encoding */);
ins_cost(0);
ins_pipe(empty);
%}

instruct castDD(regD dst)
%{
match(Set dst (CastDD dst));

size(0);
format %{ "# castDD of $dst" %}
ins_encode(/* empty encoding */);
ins_cost(0);
ins_pipe(empty);
%}

// LoadP-locked same as a regular LoadP when used with compare-swap
instruct loadPLocked(rRegP dst, memory mem)
%{
@@ -764,6 +764,11 @@ int InstructForm::memory_operand(FormDict &globals) const {
bool InstructForm::captures_bottom_type(FormDict &globals) const {
if (_matrule && _matrule->_rChild &&
(!strcmp(_matrule->_rChild->_opType,"CastPP") || // new result type
!strcmp(_matrule->_rChild->_opType,"CastDD") ||
!strcmp(_matrule->_rChild->_opType,"CastFF") ||
!strcmp(_matrule->_rChild->_opType,"CastII") ||
!strcmp(_matrule->_rChild->_opType,"CastLL") ||
!strcmp(_matrule->_rChild->_opType,"CastVV") ||
!strcmp(_matrule->_rChild->_opType,"CastX2P") || // new result type
!strcmp(_matrule->_rChild->_opType,"DecodeN") ||
!strcmp(_matrule->_rChild->_opType,"EncodeP") ||
@@ -115,6 +115,37 @@ class CastLLNode: public ConstraintCastNode {
virtual uint ideal_reg() const { return Op_RegL; }
};

class CastFFNode: public ConstraintCastNode {
public:
CastFFNode(Node* n, const Type* t, bool carry_dependency = false)
: ConstraintCastNode(n, t, carry_dependency){
init_class_id(Class_CastFF);
}
virtual int Opcode() const;
virtual uint ideal_reg() const { return Op_RegF; }
};

class CastDDNode: public ConstraintCastNode {
public:
CastDDNode(Node* n, const Type* t, bool carry_dependency = false)
: ConstraintCastNode(n, t, carry_dependency){
init_class_id(Class_CastDD);
}
virtual int Opcode() const;
virtual uint ideal_reg() const { return Op_RegD; }
};

class CastVVNode: public ConstraintCastNode {
public:
CastVVNode(Node* n, const Type* t, bool carry_dependency = false)
: ConstraintCastNode(n, t, carry_dependency){
init_class_id(Class_CastVV);
}
virtual int Opcode() const;
virtual uint ideal_reg() const { return in(1)->ideal_reg(); }
};


//------------------------------CastPPNode-------------------------------------
// cast pointer to pointer (different type)
class CastPPNode: public ConstraintCastNode {
@@ -61,8 +61,11 @@ macro(CallLeafNoFP)
macro(CallRuntime)
macro(CallNative)
macro(CallStaticJava)
macro(CastDD)
macro(CastFF)
macro(CastII)
macro(CastLL)
macro(CastVV)
macro(CastX2P)
macro(CastP2X)
macro(CastPP)
Loading