767 #endif
768 } // switch
769 }
770
771 if (UseSuperWord) {
772 if (!cl->is_reduction_loop()) {
773 phase->mark_reductions(this);
774 }
775
776 // Only attempt slp analysis when user controls do not prohibit it
777 if (LoopMaxUnroll > _local_loop_unroll_factor) {
778 // Once policy_slp_analysis succeeds, mark the loop with the
779 // maximal unroll factor so that we minimize analysis passes
780 if (future_unroll_ct >= _local_loop_unroll_factor) {
781 policy_unroll_slp_analysis(cl, phase, future_unroll_ct);
782 }
783 }
784 }
785
786 int slp_max_unroll_factor = cl->slp_max_unroll();
787 if (cl->has_passed_slp()) {
788 if (slp_max_unroll_factor >= future_unroll_ct) return true;
789 // Normal case: loop too big
790 return false;
791 }
792
793 // Check for being too big
794 if (body_size > (uint)_local_loop_unroll_limit) {
795 if (xors_in_loop >= 4 && body_size < (uint)LoopUnrollLimit*4) return true;
796 // Normal case: loop too big
797 return false;
798 }
799
800 if (cl->do_unroll_only()) {
801 if (TraceSuperWordLoopUnrollAnalysis) {
802 tty->print_cr("policy_unroll passed vector loop(vlen=%d,factor = %d)\n", slp_max_unroll_factor, future_unroll_ct);
803 }
804 }
805
806 // Unroll once! (Each trip will soon do double iterations)
807 return true;
808 }
809
810 void IdealLoopTree::policy_unroll_slp_analysis(CountedLoopNode *cl, PhaseIdealLoop *phase, int future_unroll_ct) {
811 // Enable this functionality target by target as needed
812 if (SuperWordLoopUnrollAnalysis) {
813 if (!cl->was_slp_analyzed()) {
814 SuperWord sw(phase);
815 sw.transform_loop(this, false);
|
767 #endif
768 } // switch
769 }
770
771 if (UseSuperWord) {
772 if (!cl->is_reduction_loop()) {
773 phase->mark_reductions(this);
774 }
775
776 // Only attempt slp analysis when user controls do not prohibit it
777 if (LoopMaxUnroll > _local_loop_unroll_factor) {
778 // Once policy_slp_analysis succeeds, mark the loop with the
779 // maximal unroll factor so that we minimize analysis passes
780 if (future_unroll_ct >= _local_loop_unroll_factor) {
781 policy_unroll_slp_analysis(cl, phase, future_unroll_ct);
782 }
783 }
784 }
785
786 int slp_max_unroll_factor = cl->slp_max_unroll();
787 if ((LoopMaxUnroll < slp_max_unroll_factor) && FLAG_IS_DEFAULT(LoopMaxUnroll) && UseSubwordForMaxVector) {
788 LoopMaxUnroll = slp_max_unroll_factor;
789 }
790 if (cl->has_passed_slp()) {
791 if (slp_max_unroll_factor >= future_unroll_ct) return true;
792 // Normal case: loop too big
793 return false;
794 }
795
796 // Check for being too big
797 if (body_size > (uint)_local_loop_unroll_limit) {
798 if ((UseSubwordForMaxVector || xors_in_loop >= 4) && body_size < (uint)LoopUnrollLimit * 4) return true;
799 // Normal case: loop too big
800 return false;
801 }
802
803 if (cl->do_unroll_only()) {
804 if (TraceSuperWordLoopUnrollAnalysis) {
805 tty->print_cr("policy_unroll passed vector loop(vlen=%d,factor = %d)\n", slp_max_unroll_factor, future_unroll_ct);
806 }
807 }
808
809 // Unroll once! (Each trip will soon do double iterations)
810 return true;
811 }
812
813 void IdealLoopTree::policy_unroll_slp_analysis(CountedLoopNode *cl, PhaseIdealLoop *phase, int future_unroll_ct) {
814 // Enable this functionality target by target as needed
815 if (SuperWordLoopUnrollAnalysis) {
816 if (!cl->was_slp_analyzed()) {
817 SuperWord sw(phase);
818 sw.transform_loop(this, false);
|