@@ -199,6 +199,16 @@ bool SuperWord::transform_loop(IdealLoopTree* lpt, bool do_optimization) {
199199 return success;
200200}
201201
202+ // ------------------------------max vector size------------------------------
203+ int SuperWord::max_vector_size (BasicType bt) {
204+ int max_vector = Matcher::max_vector_size (bt);
205+ int sw_max_vector_limit = SuperWordMaxVectorSize / type2aelembytes (bt);
206+ if (max_vector > sw_max_vector_limit) {
207+ max_vector = sw_max_vector_limit;
208+ }
209+ return max_vector;
210+ }
211+
202212// ------------------------------early unrolling analysis------------------------------
203213void SuperWord::unrolling_analysis (int &local_loop_unroll_factor) {
204214 bool is_slp = true ;
@@ -217,7 +227,7 @@ void SuperWord::unrolling_analysis(int &local_loop_unroll_factor) {
217227 ignored_loop_nodes[i] = -1 ;
218228 }
219229
220- int max_vector = Matcher:: max_vector_size (T_BYTE);
230+ int max_vector = max_vector_size (T_BYTE);
221231
222232 // Process the loop, some/all of the stack entries will not be in order, ergo
223233 // need to preprocess the ignored initial state before we process the loop
@@ -352,7 +362,7 @@ void SuperWord::unrolling_analysis(int &local_loop_unroll_factor) {
352362
353363 if (is_java_primitive (bt) == false ) continue ;
354364
355- int cur_max_vector = Matcher:: max_vector_size (bt);
365+ int cur_max_vector = max_vector_size (bt);
356366
357367 // If a max vector exists which is not larger than _local_loop_unroll_factor
358368 // stop looking, we already have the max vector to map to.
@@ -991,7 +1001,7 @@ int SuperWord::get_vw_bytes_special(MemNode* s) {
9911001 }
9921002 }
9931003 if (should_combine_adjacent) {
994- vw = MIN2 (Matcher:: max_vector_size (btype)*type2aelembytes (btype), vw * 2 );
1004+ vw = MIN2 (max_vector_size (btype)*type2aelembytes (btype), vw * 2 );
9951005 }
9961006 }
9971007
@@ -1689,7 +1699,7 @@ void SuperWord::combine_packs() {
16891699 Node_List* p1 = _packset.at (i);
16901700 if (p1 != NULL ) {
16911701 BasicType bt = velt_basic_type (p1->at (0 ));
1692- uint max_vlen = Matcher:: max_vector_size (bt); // Max elements in vector
1702+ uint max_vlen = max_vector_size (bt); // Max elements in vector
16931703 assert (is_power_of_2 (max_vlen), " sanity" );
16941704 uint psize = p1->size ();
16951705 if (!is_power_of_2 (psize)) {
0 commit comments