From c1939789b505dfa1e15a5444d982bbf86e951fd3 Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Fri, 3 Nov 2023 02:56:16 +0000 Subject: [PATCH] remove is_invariant_vector --- src/hotspot/cpu/aarch64/aarch64.ad | 2 +- src/hotspot/share/opto/superword.cpp | 2 +- src/hotspot/share/opto/vectornode.cpp | 8 +------- src/hotspot/share/opto/vectornode.hpp | 1 - 4 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/hotspot/cpu/aarch64/aarch64.ad b/src/hotspot/cpu/aarch64/aarch64.ad index 16ec33df4d237..233f9b6af7c14 100644 --- a/src/hotspot/cpu/aarch64/aarch64.ad +++ b/src/hotspot/cpu/aarch64/aarch64.ad @@ -2587,7 +2587,7 @@ bool is_valid_sve_arith_imm_pattern(Node* n, Node* m) { return false; } - if (UseSVE == 0 || !VectorNode::is_invariant_vector(m)) { + if (UseSVE == 0 || m->Opcode() != Op_Replicate) { return false; } diff --git a/src/hotspot/share/opto/superword.cpp b/src/hotspot/share/opto/superword.cpp index 00803a84af545..0d459db400cbe 100644 --- a/src/hotspot/share/opto/superword.cpp +++ b/src/hotspot/share/opto/superword.cpp @@ -2712,7 +2712,7 @@ bool SuperWord::output() { C->record_failure(C2Compiler::retry_no_superword()); return false; // bailout } - if (VectorNode::is_invariant_vector(in1) && (node_isa_reduction == false) && (n->is_Add() || n->is_Mul())) { + if (in1->Opcode() == Op_Replicate && (node_isa_reduction == false) && (n->is_Add() || n->is_Mul())) { // Move invariant vector input into second position to avoid register spilling. Node* tmp = in1; in1 = in2; diff --git a/src/hotspot/share/opto/vectornode.cpp b/src/hotspot/share/opto/vectornode.cpp index c457b902501b5..b07aa38771293 100644 --- a/src/hotspot/share/opto/vectornode.cpp +++ b/src/hotspot/share/opto/vectornode.cpp @@ -604,12 +604,6 @@ bool VectorNode::is_vshift_cnt(Node* n) { return is_vshift_cnt_opcode(n->Opcode()); } -// Check if input is loop invariant vector. -bool VectorNode::is_invariant_vector(Node* n) { - // Only Replicate vector nodes are loop invariant for now. - return n->Opcode() == Op_Replicate; -} - // [Start, end) half-open range defining which operands are vectors void VectorNode::vector_operands(Node* n, uint* start, uint* end) { switch (n->Opcode()) { @@ -1579,7 +1573,7 @@ Node* VectorNode::degenerate_vector_rotate(Node* src, Node* cnt, bool is_rotate_ int shift = cnt_type->get_con() & shift_mask; shiftRCnt = phase->intcon(shift); shiftLCnt = phase->intcon(shift_mask + 1 - shift); - } else if (VectorNode::is_invariant_vector(cnt)) { + } else if (cnt->Opcode() == Op_Replicate) { // Scalar variable shift, handle replicates generated by auto vectorizer. cnt = cnt->in(1); if (bt == T_LONG) { diff --git a/src/hotspot/share/opto/vectornode.hpp b/src/hotspot/share/opto/vectornode.hpp index a595af5c5ae6d..2557da40e0d04 100644 --- a/src/hotspot/share/opto/vectornode.hpp +++ b/src/hotspot/share/opto/vectornode.hpp @@ -108,7 +108,6 @@ class VectorNode : public TypeNode { static bool is_vector_rotate_supported(int opc, uint vlen, BasicType bt); static bool is_vector_integral_negate_supported(int opc, uint vlen, BasicType bt, bool use_predicate); static bool is_populate_index_supported(BasicType bt); - static bool is_invariant_vector(Node* n); // Return true if every bit in this vector is 1. static bool is_all_ones_vector(Node* n); // Return true if every bit in this vector is 0.