@@ -161,22 +161,27 @@ class AddVDNode : public VectorNode {
161
161
// ------------------------------ReductionNode------------------------------------
162
162
// Perform reduction of a vector
163
163
class ReductionNode : public Node {
164
+ private:
165
+ const Type* _bottom_type;
164
166
public:
165
- ReductionNode (Node *ctrl, Node* in1, Node* in2) : Node(ctrl, in1, in2) {}
167
+ ReductionNode (Node *ctrl, Node* in1, Node* in2) : Node(ctrl, in1, in2),
168
+ _bottom_type (Type::get_const_basic_type(in1->bottom_type ()->basic_type())) {}
166
169
167
170
static ReductionNode* make (int opc, Node *ctrl, Node* in1, Node* in2, BasicType bt);
168
171
static int opcode (int opc, BasicType bt);
169
172
static bool implemented (int opc, uint vlen, BasicType bt);
170
173
static Node* make_reduction_input (PhaseGVN& gvn, int opc, BasicType bt);
171
174
172
175
virtual const Type* bottom_type () const {
173
- BasicType vbt = in (1 )->bottom_type ()->basic_type ();
174
- return Type::get_const_basic_type (vbt);
176
+ return _bottom_type;
175
177
}
176
178
177
179
virtual uint ideal_reg () const {
178
180
return bottom_type ()->ideal_reg ();
179
181
}
182
+
183
+ // Needed for proper cloning.
184
+ virtual uint size_of () const { return sizeof (*this ); }
180
185
};
181
186
182
187
// ------------------------------AddReductionVINode--------------------------------------
@@ -739,14 +744,16 @@ class LoadVectorGatherNode : public LoadVectorNode {
739
744
// ------------------------------StoreVectorNode--------------------------------
740
745
// Store Vector to memory
741
746
class StoreVectorNode : public StoreNode {
747
+ private:
748
+ const TypeVect* _vect_type;
742
749
public:
743
750
StoreVectorNode (Node* c, Node* mem, Node* adr, const TypePtr* at, Node* val)
744
- : StoreNode(c, mem, adr, at, val, MemNode::unordered) {
751
+ : StoreNode(c, mem, adr, at, val, MemNode::unordered), _vect_type(val-> bottom_type ()->is_vect()) {
745
752
init_class_id (Class_StoreVector);
746
753
set_mismatched_access ();
747
754
}
748
755
749
- const TypeVect* vect_type () const { return in (MemNode::ValueIn)-> bottom_type ()-> is_vect () ; }
756
+ const TypeVect* vect_type () const { return _vect_type ; }
750
757
uint length () const { return vect_type ()->length (); } // Vector length
751
758
752
759
virtual int Opcode () const ;
@@ -760,6 +767,9 @@ class StoreVectorNode : public StoreNode {
760
767
uint vlen);
761
768
762
769
uint element_size (void ) { return type2aelembytes (vect_type ()->element_basic_type ()); }
770
+
771
+ // Needed for proper cloning.
772
+ virtual uint size_of () const { return sizeof (*this ); }
763
773
};
764
774
765
775
// ------------------------------StoreVectorScatterNode------------------------------
0 commit comments