Skip to content

Commit

Permalink
8262355: Extending Type::isa_vect and Type::is_vect routines to TypeV…
Browse files Browse the repository at this point in the history
…ectMask since its a valid vector type.
  • Loading branch information
Jatin Bhateja committed Mar 21, 2021
1 parent 7751342 commit 661fbda
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/hotspot/share/opto/compile.cpp
Expand Up @@ -2440,7 +2440,7 @@ static bool is_vector_bitwise_op(Node* n) {
}

static bool is_vector_bitwise_cone_root(Node* n) {
if (!is_vector_bitwise_op(n)) {
if (n->bottom_type()->isa_vectmask() || !is_vector_bitwise_op(n)) {
return false;
}
for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) {
Expand Down
13 changes: 9 additions & 4 deletions src/hotspot/share/opto/type.hpp
Expand Up @@ -802,11 +802,16 @@ class TypeVect : public Type {
// Use bottom primitive type.
return make(get_const_basic_type(elem_bt), length);
}
static const TypeVect *makemask(const Type* elem, uint length);

// Used directly by Replicate nodes to construct singleton vector.
static const TypeVect *make(const Type* elem, uint length);

static const TypeVect *makemask(const BasicType elem_bt, uint length) {
// Use bottom primitive type.
return makemask(get_const_basic_type(elem_bt), length);
}
static const TypeVect *makemask(const Type* elem, uint length);


virtual const Type *xmeet( const Type *t) const;
virtual const Type *xdual() const; // Compute dual right now.

Expand Down Expand Up @@ -1708,12 +1713,12 @@ inline const TypeVectMask *Type::isa_vectmask() const {
}

inline const TypeVect *Type::is_vect() const {
assert( _base >= VectorA && _base <= VectorZ, "Not a Vector" );
assert( _base >= VectorM && _base <= VectorZ, "Not a Vector" );
return (TypeVect*)this;
}

inline const TypeVect *Type::isa_vect() const {
return (_base >= VectorA && _base <= VectorZ) ? (TypeVect*)this : NULL;
return (_base >= VectorM && _base <= VectorZ) ? (TypeVect*)this : NULL;
}

inline const TypePtr *Type::is_ptr() const {
Expand Down

0 comments on commit 661fbda

Please sign in to comment.