diff --git a/src/hotspot/cpu/aarch64/aarch64.ad b/src/hotspot/cpu/aarch64/aarch64.ad index f637648b227..456cd622836 100644 --- a/src/hotspot/cpu/aarch64/aarch64.ad +++ b/src/hotspot/cpu/aarch64/aarch64.ad @@ -2377,7 +2377,7 @@ int Matcher::min_vector_size(const BasicType bt) { return MIN2(size, max_size); } -int Matcher::superword_max_vector_size(const BasicType bt) { +int Matcher::max_vector_size_auto_vectorization(const BasicType bt) { return Matcher::max_vector_size(bt); } diff --git a/src/hotspot/cpu/aarch64/aarch64_vector.ad b/src/hotspot/cpu/aarch64/aarch64_vector.ad index 210efa0b760..d611c14f403 100644 --- a/src/hotspot/cpu/aarch64/aarch64_vector.ad +++ b/src/hotspot/cpu/aarch64/aarch64_vector.ad @@ -1,5 +1,5 @@ // -// Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2020, 2023, Arm Limited. All rights reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // @@ -126,7 +126,7 @@ source %{ } } - bool Matcher::match_rule_supported_superword(int opcode, int vlen, BasicType bt) { + bool Matcher::match_rule_supported_auto_vectorization(int opcode, int vlen, BasicType bt) { if (UseSVE == 0) { // These operations are not profitable to be vectorized on NEON, because no direct // NEON instructions support them. But the match rule support for them is profitable for diff --git a/src/hotspot/cpu/aarch64/aarch64_vector_ad.m4 b/src/hotspot/cpu/aarch64/aarch64_vector_ad.m4 index 3f4ed020f55..5c4e13d432f 100644 --- a/src/hotspot/cpu/aarch64/aarch64_vector_ad.m4 +++ b/src/hotspot/cpu/aarch64/aarch64_vector_ad.m4 @@ -1,5 +1,5 @@ // -// Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2020, 2023, Arm Limited. All rights reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // @@ -116,7 +116,7 @@ source %{ } } - bool Matcher::match_rule_supported_superword(int opcode, int vlen, BasicType bt) { + bool Matcher::match_rule_supported_auto_vectorization(int opcode, int vlen, BasicType bt) { if (UseSVE == 0) { // These operations are not profitable to be vectorized on NEON, because no direct // NEON instructions support them. But the match rule support for them is profitable for diff --git a/src/hotspot/cpu/arm/arm.ad b/src/hotspot/cpu/arm/arm.ad index e31ad91613a..01457aee7b6 100644 --- a/src/hotspot/cpu/arm/arm.ad +++ b/src/hotspot/cpu/arm/arm.ad @@ -1002,7 +1002,7 @@ bool Matcher::match_rule_supported(int opcode) { return true; // Per default match rules are supported. } -bool Matcher::match_rule_supported_superword(int opcode, int vlen, BasicType bt) { +bool Matcher::match_rule_supported_auto_vectorization(int opcode, int vlen, BasicType bt) { return match_rule_supported_vector(opcode, vlen, bt); } @@ -1074,7 +1074,7 @@ int Matcher::min_vector_size(const BasicType bt) { return 8/type2aelembytes(bt); } -int Matcher::superword_max_vector_size(const BasicType bt) { +int Matcher::max_vector_size_auto_vectorization(const BasicType bt) { return Matcher::max_vector_size(bt); } diff --git a/src/hotspot/cpu/ppc/ppc.ad b/src/hotspot/cpu/ppc/ppc.ad index be37ff1785b..c43f19be740 100644 --- a/src/hotspot/cpu/ppc/ppc.ad +++ b/src/hotspot/cpu/ppc/ppc.ad @@ -1,5 +1,5 @@ // -// Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2012, 2023 SAP SE. All rights reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // @@ -2173,7 +2173,7 @@ bool Matcher::match_rule_supported(int opcode) { return true; // Per default match rules are supported. } -bool Matcher::match_rule_supported_superword(int opcode, int vlen, BasicType bt) { +bool Matcher::match_rule_supported_auto_vectorization(int opcode, int vlen, BasicType bt) { return match_rule_supported_vector(opcode, vlen, bt); } @@ -2242,7 +2242,7 @@ int Matcher::min_vector_size(const BasicType bt) { return max_vector_size(bt); // Same as max. } -int Matcher::superword_max_vector_size(const BasicType bt) { +int Matcher::max_vector_size_auto_vectorization(const BasicType bt) { return Matcher::max_vector_size(bt); } diff --git a/src/hotspot/cpu/riscv/riscv.ad b/src/hotspot/cpu/riscv/riscv.ad index 458e381b3b0..493606aa0b1 100644 --- a/src/hotspot/cpu/riscv/riscv.ad +++ b/src/hotspot/cpu/riscv/riscv.ad @@ -1,5 +1,5 @@ // -// Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved. // Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2017,7 +2017,7 @@ int Matcher::min_vector_size(const BasicType bt) { return MIN2(size, max_size); } -int Matcher::superword_max_vector_size(const BasicType bt) { +int Matcher::max_vector_size_auto_vectorization(const BasicType bt) { return Matcher::max_vector_size(bt); } diff --git a/src/hotspot/cpu/riscv/riscv_v.ad b/src/hotspot/cpu/riscv/riscv_v.ad index c163325fc81..802a68caba7 100644 --- a/src/hotspot/cpu/riscv/riscv_v.ad +++ b/src/hotspot/cpu/riscv/riscv_v.ad @@ -1,5 +1,5 @@ // -// Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2020, 2023, Arm Limited. All rights reserved. // Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -46,7 +46,7 @@ source %{ } } - bool Matcher::match_rule_supported_superword(int opcode, int vlen, BasicType bt) { + bool Matcher::match_rule_supported_auto_vectorization(int opcode, int vlen, BasicType bt) { return match_rule_supported_vector(opcode, vlen, bt); } diff --git a/src/hotspot/cpu/s390/s390.ad b/src/hotspot/cpu/s390/s390.ad index 9f4e182a9e4..c28c5e4399a 100644 --- a/src/hotspot/cpu/s390/s390.ad +++ b/src/hotspot/cpu/s390/s390.ad @@ -1,5 +1,5 @@ // -// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2017, 2022 SAP SE. All rights reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // @@ -1513,7 +1513,7 @@ bool Matcher::match_rule_supported(int opcode) { return true; // Per default match rules are supported. } -bool Matcher::match_rule_supported_superword(int opcode, int vlen, BasicType bt) { +bool Matcher::match_rule_supported_auto_vectorization(int opcode, int vlen, BasicType bt) { return match_rule_supported_vector(opcode, vlen, bt); } @@ -1574,7 +1574,7 @@ int Matcher::min_vector_size(const BasicType bt) { return max_vector_size(bt); // Same as max. } -int Matcher::superword_max_vector_size(const BasicType bt) { +int Matcher::max_vector_size_auto_vectorization(const BasicType bt) { return Matcher::max_vector_size(bt); } diff --git a/src/hotspot/cpu/x86/x86.ad b/src/hotspot/cpu/x86/x86.ad index 671d3f7d212..99bf789f5b2 100644 --- a/src/hotspot/cpu/x86/x86.ad +++ b/src/hotspot/cpu/x86/x86.ad @@ -1699,7 +1699,7 @@ static inline bool is_pop_count_instr_target(BasicType bt) { (is_non_subword_integral_type(bt) && VM_Version::supports_avx512_vpopcntdq()); } -bool Matcher::match_rule_supported_superword(int opcode, int vlen, BasicType bt) { +bool Matcher::match_rule_supported_auto_vectorization(int opcode, int vlen, BasicType bt) { return match_rule_supported_vector(opcode, vlen, bt); } @@ -2280,7 +2280,7 @@ int Matcher::min_vector_size(const BasicType bt) { return MIN2(size,max_size); } -int Matcher::superword_max_vector_size(const BasicType bt) { +int Matcher::max_vector_size_auto_vectorization(const BasicType bt) { // Limit the max vector size for auto vectorization to 256 bits (32 bytes) // by default on Cascade Lake if (VM_Version::is_default_intel_cascade_lake()) { diff --git a/src/hotspot/share/opto/matcher.hpp b/src/hotspot/share/opto/matcher.hpp index a4a20975e88..84e48086f92 100644 --- a/src/hotspot/share/opto/matcher.hpp +++ b/src/hotspot/share/opto/matcher.hpp @@ -331,7 +331,7 @@ public: // Identify extra cases that we might want to vectorize automatically // And exclude cases which are not profitable to auto-vectorize. - static bool match_rule_supported_superword(int opcode, int vlen, BasicType bt); + static bool match_rule_supported_auto_vectorization(int opcode, int vlen, BasicType bt); // identify extra cases that we might want to provide match rules for // e.g. Op_ vector nodes and other intrinsics while guarding with vlen @@ -355,7 +355,7 @@ public: Matcher::min_vector_size(bt) <= size); } // Limits on max vector size (number of elements) for auto-vectorization. - static int superword_max_vector_size(const BasicType bt); + static int max_vector_size_auto_vectorization(const BasicType bt); // Actual max scalable vector register length. static int scalable_vector_reg_size(const BasicType bt); diff --git a/src/hotspot/share/opto/superword.cpp b/src/hotspot/share/opto/superword.cpp index 3d6d67dcf89..9b61e7ab641 100644 --- a/src/hotspot/share/opto/superword.cpp +++ b/src/hotspot/share/opto/superword.cpp @@ -177,7 +177,7 @@ void SuperWord::unrolling_analysis(int &local_loop_unroll_factor) { ignored_loop_nodes[i] = -1; } - int max_vector = Matcher::superword_max_vector_size(T_BYTE); + int max_vector = Matcher::max_vector_size_auto_vectorization(T_BYTE); // Process the loop, some/all of the stack entries will not be in order, ergo // need to preprocess the ignored initial state before we process the loop @@ -291,7 +291,7 @@ void SuperWord::unrolling_analysis(int &local_loop_unroll_factor) { if (is_java_primitive(bt) == false) continue; - int cur_max_vector = Matcher::superword_max_vector_size(bt); + int cur_max_vector = Matcher::max_vector_size_auto_vectorization(bt); // If a max vector exists which is not larger than _local_loop_unroll_factor // stop looking, we already have the max vector to map to. @@ -789,13 +789,13 @@ int SuperWord::get_vw_bytes_special(MemNode* s) { } } if (should_combine_adjacent) { - vw = MIN2(Matcher::superword_max_vector_size(btype)*type2aelembytes(btype), vw * 2); + vw = MIN2(Matcher::max_vector_size_auto_vectorization(btype)*type2aelembytes(btype), vw * 2); } } // Check for special case where there is a type conversion between different data size. int vectsize = max_vector_size_in_def_use_chain(s); - if (vectsize < Matcher::superword_max_vector_size(btype)) { + if (vectsize < Matcher::max_vector_size_auto_vectorization(btype)) { vw = MIN2(vectsize * type2aelembytes(btype), vw); } @@ -969,8 +969,8 @@ bool SuperWord::stmts_can_pack(Node* s1, Node* s2, int align) { if(!is_java_primitive(bt1) || !is_java_primitive(bt2)) return false; BasicType longer_bt = longer_type_for_conversion(s1); - if (Matcher::superword_max_vector_size(bt1) < 2 || - (longer_bt != T_ILLEGAL && Matcher::superword_max_vector_size(longer_bt) < 2)) { + if (Matcher::max_vector_size_auto_vectorization(bt1) < 2 || + (longer_bt != T_ILLEGAL && Matcher::max_vector_size_auto_vectorization(longer_bt) < 2)) { return false; // No vectors for this type } @@ -3018,7 +3018,7 @@ bool SuperWord::construct_bb() { // First see if we can map the reduction on the given system we are on, then // make a data entry operation for each reduction we see. BasicType bt = use->bottom_type()->basic_type(); - if (ReductionNode::implemented(use->Opcode(), Matcher::superword_max_vector_size(bt), bt)) { + if (ReductionNode::implemented(use->Opcode(), Matcher::max_vector_size_auto_vectorization(bt), bt)) { reduction_uses++; } } @@ -3172,10 +3172,10 @@ int SuperWord::max_vector_size_in_def_use_chain(Node* n) { vt = (newt == T_ILLEGAL) ? vt : newt; } - int max = Matcher::superword_max_vector_size(vt); + int max = Matcher::max_vector_size_auto_vectorization(vt); // If now there is no vectors for the longest type, the nodes with the longest // type in the def-use chain are not packed in SuperWord::stmts_can_pack. - return max < 2 ? Matcher::superword_max_vector_size(bt) : max; + return max < 2 ? Matcher::max_vector_size_auto_vectorization(bt) : max; } //-------------------------compute_vector_element_type----------------------- diff --git a/src/hotspot/share/opto/vectornode.cpp b/src/hotspot/share/opto/vectornode.cpp index b07aa387712..f5fdae79e32 100644 --- a/src/hotspot/share/opto/vectornode.cpp +++ b/src/hotspot/share/opto/vectornode.cpp @@ -389,7 +389,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) { - return Matcher::superword_max_vector_size(bt) >= size && + return Matcher::max_vector_size_auto_vectorization(bt) >= size && Matcher::min_vector_size(bt) <= size; } @@ -409,7 +409,7 @@ bool VectorNode::implemented(int opc, uint vlen, BasicType bt) { if (VectorNode::is_vector_integral_negate(vopc)) { return is_vector_integral_negate_supported(vopc, vlen, bt, false); } - return vopc > 0 && Matcher::match_rule_supported_superword(vopc, vlen, bt); + return vopc > 0 && Matcher::match_rule_supported_auto_vectorization(vopc, vlen, bt); } return false; } @@ -1434,7 +1434,7 @@ bool VectorCastNode::implemented(int opc, uint vlen, BasicType src_type, BasicTy (vlen > 1) && is_power_of_2(vlen) && VectorNode::vector_size_supported_superword(dst_type, vlen)) { int vopc = VectorCastNode::opcode(opc, src_type); - return vopc > 0 && Matcher::match_rule_supported_superword(vopc, vlen, dst_type); + return vopc > 0 && Matcher::match_rule_supported_auto_vectorization(vopc, vlen, dst_type); } return false; } @@ -1528,7 +1528,7 @@ bool ReductionNode::implemented(int opc, uint vlen, BasicType bt) { (vlen > 1) && is_power_of_2(vlen) && VectorNode::vector_size_supported_superword(bt, vlen)) { int vopc = ReductionNode::opcode(opc, bt); - return vopc != opc && Matcher::match_rule_supported_superword(vopc, vlen, bt); + return vopc != opc && Matcher::match_rule_supported_auto_vectorization(vopc, vlen, bt); } return false; }