Skip to content

Commit

Permalink
8333713: C2 SuperWord: cleanup in vectornode.cpp/hpp
Browse files Browse the repository at this point in the history
Reviewed-by: chagedorn, kvn
  • Loading branch information
eme64 committed Jun 7, 2024
1 parent 944aeb8 commit e5383d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
18 changes: 5 additions & 13 deletions src/hotspot/share/opto/vectornode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ int VectorNode::opcode(int sopc, BasicType bt) {
return (is_integral_type(bt) ? Op_ReverseV : 0);
case Op_ReverseBytesS:
case Op_ReverseBytesUS:
// Subword operations in superword usually don't have precise info
// Subword operations in auto vectorization usually don't have precise info
// about signedness. But the behavior of reverseBytes for short and
// char are exactly the same.
return ((bt == T_SHORT || bt == T_CHAR) ? Op_ReverseBytesV : 0);
Expand Down Expand Up @@ -388,7 +388,7 @@ int VectorNode::scalar_opcode(int sopc, BasicType bt) {
}

// Limits on vector size (number of elements) for auto-vectorization.
bool VectorNode::vector_size_supported_superword(const BasicType bt, int size) {
bool VectorNode::vector_size_supported_auto_vectorization(const BasicType bt, int size) {
return Matcher::max_vector_size_auto_vectorization(bt) >= size &&
Matcher::min_vector_size(bt) <= size;
}
Expand All @@ -398,7 +398,7 @@ bool VectorNode::vector_size_supported_superword(const BasicType bt, int size) {
bool VectorNode::implemented(int opc, uint vlen, BasicType bt) {
if (is_java_primitive(bt) &&
(vlen > 1) && is_power_of_2(vlen) &&
vector_size_supported_superword(bt, vlen)) {
vector_size_supported_auto_vectorization(bt, vlen)) {
int vopc = VectorNode::opcode(opc, bt);
// For rotate operation we will do a lazy de-generation into
// OrV/LShiftV/URShiftV pattern if the target does not support
Expand All @@ -414,14 +414,6 @@ bool VectorNode::implemented(int opc, uint vlen, BasicType bt) {
return false;
}

bool VectorNode::is_type_transition_short_to_int(Node* n) {
return n->Opcode() == Op_MulAddS2I;
}

bool VectorNode::is_type_transition_to_int(Node* n) {
return is_type_transition_short_to_int(n);
}

bool VectorNode::is_muladds2i(const Node* n) {
return n->Opcode() == Op_MulAddS2I;
}
Expand Down Expand Up @@ -1419,7 +1411,7 @@ bool VectorCastNode::implemented(int opc, uint vlen, BasicType src_type, BasicTy
if (is_java_primitive(dst_type) &&
is_java_primitive(src_type) &&
(vlen > 1) && is_power_of_2(vlen) &&
VectorNode::vector_size_supported_superword(dst_type, vlen)) {
VectorNode::vector_size_supported_auto_vectorization(dst_type, vlen)) {
int vopc = VectorCastNode::opcode(opc, src_type);
return vopc > 0 && Matcher::match_rule_supported_auto_vectorization(vopc, vlen, dst_type);
}
Expand Down Expand Up @@ -1513,7 +1505,7 @@ Node* ReductionNode::make_identity_con_scalar(PhaseGVN& gvn, int sopc, BasicType
bool ReductionNode::implemented(int opc, uint vlen, BasicType bt) {
if (is_java_primitive(bt) &&
(vlen > 1) && is_power_of_2(vlen) &&
VectorNode::vector_size_supported_superword(bt, vlen)) {
VectorNode::vector_size_supported_auto_vectorization(bt, vlen)) {
int vopc = ReductionNode::opcode(opc, bt);
return vopc != opc && Matcher::match_rule_supported_auto_vectorization(vopc, vlen, bt);
}
Expand Down
4 changes: 1 addition & 3 deletions src/hotspot/share/opto/vectornode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,10 @@ class VectorNode : public TypeNode {
static int scalar_opcode(int vopc, BasicType bt); // vector_opc -> scalar_opc

// Limits on vector size (number of elements) for auto-vectorization.
static bool vector_size_supported_superword(const BasicType bt, int size);
static bool vector_size_supported_auto_vectorization(const BasicType bt, int size);
static bool implemented(int opc, uint vlen, BasicType bt);
static bool is_shift(Node* n);
static bool is_vshift_cnt(Node* n);
static bool is_type_transition_short_to_int(Node* n);
static bool is_type_transition_to_int(Node* n);
static bool is_muladds2i(const Node* n);
static bool is_roundopD(Node* n);
static bool is_scalar_rotate(Node* n);
Expand Down

1 comment on commit e5383d7

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.