Skip to content

Commit

Permalink
remove is_invariant_vector
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Liu committed Nov 3, 2023
1 parent f499ce8 commit c193978
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/hotspot/cpu/aarch64/aarch64.ad
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/opto/superword.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 1 addition & 7 deletions src/hotspot/share/opto/vectornode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down Expand Up @@ -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) {
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/share/opto/vectornode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit c193978

Please sign in to comment.