diff --git a/src/hotspot/share/opto/addnode.cpp b/src/hotspot/share/opto/addnode.cpp index b44aa53f298c4..cc5643d85c110 100644 --- a/src/hotspot/share/opto/addnode.cpp +++ b/src/hotspot/share/opto/addnode.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2025, 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 @@ -1270,7 +1270,7 @@ Node* MaxNode::build_min_max(Node* a, Node* b, bool is_max, bool is_unsigned, co cmp = gvn.transform(CmpNode::make(b, a, bt, is_unsigned)); } Node* bol = gvn.transform(new BoolNode(cmp, BoolTest::lt)); - res = gvn.transform(CMoveNode::make(nullptr, bol, a, b, t)); + res = gvn.transform(CMoveNode::make(bol, a, b, t)); } if (hook != nullptr) { hook->destruct(&gvn); @@ -1299,7 +1299,7 @@ Node* MaxNode::build_min_max_diff_with_zero(Node* a, Node* b, bool is_max, const } Node* sub = gvn.transform(SubNode::make(a, b, bt)); Node* bol = gvn.transform(new BoolNode(cmp, BoolTest::lt)); - Node* res = gvn.transform(CMoveNode::make(nullptr, bol, sub, zero, t)); + Node* res = gvn.transform(CMoveNode::make(bol, sub, zero, t)); if (hook != nullptr) { hook->destruct(&gvn); } diff --git a/src/hotspot/share/opto/library_call.cpp b/src/hotspot/share/opto/library_call.cpp index 40b19eecd9f65..388e7818e7e16 100644 --- a/src/hotspot/share/opto/library_call.cpp +++ b/src/hotspot/share/opto/library_call.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2025, 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 @@ -2140,18 +2140,18 @@ bool LibraryCallKit::inline_number_methods(vmIntrinsics::ID id) { Node* arg = argument(0); Node* n = nullptr; switch (id) { - case vmIntrinsics::_numberOfLeadingZeros_i: n = new CountLeadingZerosINode( arg); break; - case vmIntrinsics::_numberOfLeadingZeros_l: n = new CountLeadingZerosLNode( arg); break; - case vmIntrinsics::_numberOfTrailingZeros_i: n = new CountTrailingZerosINode(arg); break; - case vmIntrinsics::_numberOfTrailingZeros_l: n = new CountTrailingZerosLNode(arg); break; - case vmIntrinsics::_bitCount_i: n = new PopCountINode( arg); break; - case vmIntrinsics::_bitCount_l: n = new PopCountLNode( arg); break; - case vmIntrinsics::_reverseBytes_c: n = new ReverseBytesUSNode(nullptr, arg); break; - case vmIntrinsics::_reverseBytes_s: n = new ReverseBytesSNode( nullptr, arg); break; - case vmIntrinsics::_reverseBytes_i: n = new ReverseBytesINode( nullptr, arg); break; - case vmIntrinsics::_reverseBytes_l: n = new ReverseBytesLNode( nullptr, arg); break; - case vmIntrinsics::_reverse_i: n = new ReverseINode(nullptr, arg); break; - case vmIntrinsics::_reverse_l: n = new ReverseLNode(nullptr, arg); break; + case vmIntrinsics::_numberOfLeadingZeros_i: n = new CountLeadingZerosINode( arg); break; + case vmIntrinsics::_numberOfLeadingZeros_l: n = new CountLeadingZerosLNode( arg); break; + case vmIntrinsics::_numberOfTrailingZeros_i: n = new CountTrailingZerosINode(arg); break; + case vmIntrinsics::_numberOfTrailingZeros_l: n = new CountTrailingZerosLNode(arg); break; + case vmIntrinsics::_bitCount_i: n = new PopCountINode( arg); break; + case vmIntrinsics::_bitCount_l: n = new PopCountLNode( arg); break; + case vmIntrinsics::_reverseBytes_c: n = new ReverseBytesUSNode( arg); break; + case vmIntrinsics::_reverseBytes_s: n = new ReverseBytesSNode( arg); break; + case vmIntrinsics::_reverseBytes_i: n = new ReverseBytesINode( arg); break; + case vmIntrinsics::_reverseBytes_l: n = new ReverseBytesLNode( arg); break; + case vmIntrinsics::_reverse_i: n = new ReverseINode( arg); break; + case vmIntrinsics::_reverse_l: n = new ReverseLNode( arg); break; default: fatal_unexpected_iid(id); break; } set_result(_gvn.transform(n)); @@ -8264,14 +8264,14 @@ bool LibraryCallKit::inline_fma(vmIntrinsics::ID id) { a = round_double_node(argument(0)); b = round_double_node(argument(2)); c = round_double_node(argument(4)); - result = _gvn.transform(new FmaDNode(control(), a, b, c)); + result = _gvn.transform(new FmaDNode(a, b, c)); break; case vmIntrinsics::_fmaF: assert(callee()->signature()->size() == 3, "fma has 3 parameters of size 1 each."); a = argument(0); b = argument(1); c = argument(2); - result = _gvn.transform(new FmaFNode(control(), a, b, c)); + result = _gvn.transform(new FmaFNode(a, b, c)); break; default: fatal_unexpected_iid(id); break; diff --git a/src/hotspot/share/opto/loopopts.cpp b/src/hotspot/share/opto/loopopts.cpp index 90b9bc84def14..a23b490626465 100644 --- a/src/hotspot/share/opto/loopopts.cpp +++ b/src/hotspot/share/opto/loopopts.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2025, 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 @@ -857,9 +857,9 @@ Node *PhaseIdealLoop::conditional_move( Node *region ) { } } } - Node *cmov = CMoveNode::make(cmov_ctrl, iff->in(1), phi->in(1+flip), phi->in(2-flip), _igvn.type(phi)); - register_new_node( cmov, cmov_ctrl ); - _igvn.replace_node( phi, cmov ); + Node* cmov = CMoveNode::make(iff->in(1), phi->in(1+flip), phi->in(2-flip), _igvn.type(phi)); + register_new_node(cmov, cmov_ctrl); + _igvn.replace_node(phi, cmov); #ifndef PRODUCT if (TraceLoopOpts) { tty->print("CMOV "); diff --git a/src/hotspot/share/opto/movenode.cpp b/src/hotspot/share/opto/movenode.cpp index dc65afff26f0f..82ac57cf1324b 100644 --- a/src/hotspot/share/opto/movenode.cpp +++ b/src/hotspot/share/opto/movenode.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2025, 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 @@ -102,7 +102,7 @@ Node *CMoveNode::Ideal(PhaseGVN *phase, bool can_reshape) { // Canonicalize the node by moving constants to the right input. if (in(Condition)->is_Bool() && phase->type(in(IfFalse))->singleton() && !phase->type(in(IfTrue))->singleton()) { BoolNode* b = in(Condition)->as_Bool()->negate(phase); - return make(in(Control), phase->transform(b), in(IfTrue), in(IfFalse), _type); + return make(phase->transform(b), in(IfTrue), in(IfFalse), _type); } return nullptr; @@ -186,15 +186,15 @@ const Type* CMoveNode::Value(PhaseGVN* phase) const { //------------------------------make------------------------------------------- // Make a correctly-flavored CMove. Since _type is directly determined // from the inputs we do not need to specify it here. -CMoveNode *CMoveNode::make(Node *c, Node *bol, Node *left, Node *right, const Type *t) { +CMoveNode* CMoveNode::make(Node* bol, Node* left, Node* right, const Type* t) { switch( t->basic_type() ) { - case T_INT: return new CMoveINode( bol, left, right, t->is_int() ); - case T_FLOAT: return new CMoveFNode( bol, left, right, t ); - case T_DOUBLE: return new CMoveDNode( bol, left, right, t ); - case T_LONG: return new CMoveLNode( bol, left, right, t->is_long() ); - case T_OBJECT: return new CMovePNode( c, bol, left, right, t->is_oopptr() ); - case T_ADDRESS: return new CMovePNode( c, bol, left, right, t->is_ptr() ); - case T_NARROWOOP: return new CMoveNNode( c, bol, left, right, t ); + case T_INT: return new CMoveINode(bol, left, right, t->is_int()); + case T_FLOAT: return new CMoveFNode(bol, left, right, t); + case T_DOUBLE: return new CMoveDNode(bol, left, right, t); + case T_LONG: return new CMoveLNode(bol, left, right, t->is_long()); + case T_OBJECT: return new CMovePNode(bol, left, right, t->is_oopptr()); + case T_ADDRESS: return new CMovePNode(bol, left, right, t->is_ptr()); + case T_NARROWOOP: return new CMoveNNode(bol, left, right, t); default: ShouldNotReachHere(); return nullptr; @@ -278,7 +278,7 @@ Node *CMoveINode::Ideal(PhaseGVN *phase, bool can_reshape) { if( in(Condition)->is_Bool() ) { BoolNode* b = in(Condition)->as_Bool(); BoolNode* b2 = b->negate(phase); - return make(in(Control), phase->transform(b2), in(IfTrue), in(IfFalse), _type); + return make(phase->transform(b2), in(IfTrue), in(IfFalse), _type); } } diff --git a/src/hotspot/share/opto/movenode.hpp b/src/hotspot/share/opto/movenode.hpp index 02db0c73079f8..59974f797029a 100644 --- a/src/hotspot/share/opto/movenode.hpp +++ b/src/hotspot/share/opto/movenode.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2025, 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 @@ -47,7 +47,7 @@ class CMoveNode : public TypeNode { virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type* Value(PhaseGVN* phase) const; virtual Node* Identity(PhaseGVN* phase); - static CMoveNode *make(Node *c, Node *bol, Node *left, Node *right, const Type *t); + static CMoveNode* make(Node* bol, Node* left, Node* right, const Type* t); // Helper function to spot cmove graph shapes static Node* is_cmove_id(PhaseTransform* phase, Node* cmp, Node* t, Node* f, BoolNode* b); static Node* Ideal_minmax(PhaseGVN* phase, CMoveNode* cmov); @@ -87,14 +87,14 @@ class CMoveLNode : public CMoveNode { //------------------------------CMovePNode------------------------------------- class CMovePNode : public CMoveNode { public: - CMovePNode( Node *c, Node *bol, Node *left, Node *right, const TypePtr* t ) : CMoveNode(bol,left,right,t) { init_req(Control,c); } + CMovePNode(Node* bol, Node* left, Node* right, const TypePtr* t) : CMoveNode(bol, left, right, t) {} virtual int Opcode() const; }; //------------------------------CMoveNNode------------------------------------- class CMoveNNode : public CMoveNode { public: - CMoveNNode( Node *c, Node *bol, Node *left, Node *right, const Type* t ) : CMoveNode(bol,left,right,t) { init_req(Control,c); } + CMoveNNode(Node* bol, Node* left, Node* right, const Type* t ) : CMoveNode(bol, left, right, t) {} virtual int Opcode() const; }; diff --git a/src/hotspot/share/opto/mulnode.hpp b/src/hotspot/share/opto/mulnode.hpp index c8d168685d9e5..a34f41d2362d9 100644 --- a/src/hotspot/share/opto/mulnode.hpp +++ b/src/hotspot/share/opto/mulnode.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2025, 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 @@ -388,7 +388,7 @@ inline Node* make_urshift(Node* a, Node* b) { // fused-multiply-add class FmaNode : public Node { public: - FmaNode(Node* c, Node* in1, Node* in2, Node* in3) : Node(c, in1, in2, in3) { + FmaNode(Node* in1, Node* in2, Node* in3) : Node(nullptr, in1, in2, in3) { assert(UseFMA, "Needs FMA instructions support."); } virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); @@ -398,7 +398,7 @@ class FmaNode : public Node { // fused-multiply-add double class FmaDNode : public FmaNode { public: - FmaDNode(Node* c, Node* in1, Node* in2, Node* in3) : FmaNode(c, in1, in2, in3) {} + FmaDNode(Node* in1, Node* in2, Node* in3) : FmaNode(in1, in2, in3) {} virtual int Opcode() const; const Type* bottom_type() const { return Type::DOUBLE; } virtual uint ideal_reg() const { return Op_RegD; } @@ -409,7 +409,7 @@ class FmaDNode : public FmaNode { // fused-multiply-add float class FmaFNode : public FmaNode { public: - FmaFNode(Node* c, Node* in1, Node* in2, Node* in3) : FmaNode(c, in1, in2, in3) {} + FmaFNode(Node* in1, Node* in2, Node* in3) : FmaNode(in1, in2, in3) {} virtual int Opcode() const; const Type* bottom_type() const { return Type::FLOAT; } virtual uint ideal_reg() const { return Op_RegF; } diff --git a/src/hotspot/share/opto/subnode.cpp b/src/hotspot/share/opto/subnode.cpp index 445eb16821443..369b37d836520 100644 --- a/src/hotspot/share/opto/subnode.cpp +++ b/src/hotspot/share/opto/subnode.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2025, 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 @@ -1416,9 +1416,7 @@ Node* BoolNode::make_predicate(Node* test_value, PhaseGVN* phase) { //--------------------------------as_int_value--------------------------------- Node* BoolNode::as_int_value(PhaseGVN* phase) { // Inverse to make_predicate. The CMove probably boils down to a Conv2B. - Node* cmov = CMoveNode::make(nullptr, this, - phase->intcon(0), phase->intcon(1), - TypeInt::BOOL); + Node* cmov = CMoveNode::make(this, phase->intcon(0), phase->intcon(1), TypeInt::BOOL); return phase->transform(cmov); } diff --git a/src/hotspot/share/opto/subnode.hpp b/src/hotspot/share/opto/subnode.hpp index 6ceaa851739d8..ca21e62867672 100644 --- a/src/hotspot/share/opto/subnode.hpp +++ b/src/hotspot/share/opto/subnode.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2025, 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 @@ -532,9 +532,9 @@ class SqrtFNode : public Node { // reverse bytes of an integer class ReverseBytesINode : public Node { public: - ReverseBytesINode(Node *c, Node *in1) : Node(c, in1) {} + ReverseBytesINode(Node* in) : Node(nullptr, in) {} virtual int Opcode() const; - const Type *bottom_type() const { return TypeInt::INT; } + const Type* bottom_type() const { return TypeInt::INT; } virtual uint ideal_reg() const { return Op_RegI; } }; @@ -542,9 +542,9 @@ class ReverseBytesINode : public Node { // reverse bytes of a long class ReverseBytesLNode : public Node { public: - ReverseBytesLNode(Node *c, Node *in1) : Node(c, in1) {} + ReverseBytesLNode(Node* in) : Node(nullptr, in) {} virtual int Opcode() const; - const Type *bottom_type() const { return TypeLong::LONG; } + const Type* bottom_type() const { return TypeLong::LONG; } virtual uint ideal_reg() const { return Op_RegL; } }; @@ -552,9 +552,9 @@ class ReverseBytesLNode : public Node { // reverse bytes of an unsigned short / char class ReverseBytesUSNode : public Node { public: - ReverseBytesUSNode(Node *c, Node *in1) : Node(c, in1) {} + ReverseBytesUSNode(Node* in1) : Node(nullptr, in1) {} virtual int Opcode() const; - const Type *bottom_type() const { return TypeInt::CHAR; } + const Type* bottom_type() const { return TypeInt::CHAR; } virtual uint ideal_reg() const { return Op_RegI; } }; @@ -562,9 +562,9 @@ class ReverseBytesUSNode : public Node { // reverse bytes of a short class ReverseBytesSNode : public Node { public: - ReverseBytesSNode(Node *c, Node *in1) : Node(c, in1) {} + ReverseBytesSNode(Node* in) : Node(nullptr, in) {} virtual int Opcode() const; - const Type *bottom_type() const { return TypeInt::SHORT; } + const Type* bottom_type() const { return TypeInt::SHORT; } virtual uint ideal_reg() const { return Op_RegI; } }; @@ -572,9 +572,9 @@ class ReverseBytesSNode : public Node { // reverse bits of an int class ReverseINode : public Node { public: - ReverseINode(Node *c, Node *in1) : Node(c, in1) {} + ReverseINode(Node* in) : Node(nullptr, in) {} virtual int Opcode() const; - const Type *bottom_type() const { return TypeInt::INT; } + const Type* bottom_type() const { return TypeInt::INT; } virtual uint ideal_reg() const { return Op_RegI; } virtual Node* Identity(PhaseGVN* phase); virtual const Type* Value(PhaseGVN* phase) const; @@ -584,9 +584,9 @@ class ReverseINode : public Node { // reverse bits of a long class ReverseLNode : public Node { public: - ReverseLNode(Node *c, Node *in1) : Node(c, in1) {} + ReverseLNode(Node* in) : Node(nullptr, in) {} virtual int Opcode() const; - const Type *bottom_type() const { return TypeLong::LONG; } + const Type* bottom_type() const { return TypeLong::LONG; } virtual uint ideal_reg() const { return Op_RegL; } virtual Node* Identity(PhaseGVN* phase); virtual const Type* Value(PhaseGVN* phase) const;