Home | History | Annotate | Download | only in Scalar

Lines Matching refs:UP

51              "unrolling to allow unrolling up to the max threshold."));
113 TargetTransformInfo::UnrollingPreferences UP;
115 // Set up the defaults
116 UP.Threshold = 150;
117 UP.PercentDynamicCostSavedThreshold = 50;
118 UP.DynamicCostSavingsDiscount = 100;
119 UP.OptSizeThreshold = 0;
120 UP.PartialThreshold = UP.Threshold;
121 UP.PartialOptSizeThreshold = 0;
122 UP.Count = 0;
123 UP.MaxCount = UINT_MAX;
124 UP.FullUnrollMaxCount = UINT_MAX;
125 UP.Partial = false;
126 UP.Runtime = false;
127 UP.AllowRemainder = true;
128 UP.AllowExpensiveTripCount = false;
129 UP.Force = false;
132 TTI.getUnrollingPreferences(L, UP);
136 UP.Threshold = UP.OptSizeThreshold;
137 UP.PartialThreshold = UP.PartialOptSizeThreshold;
142 UP.Threshold = UnrollThreshold;
143 UP.PartialThreshold = UnrollThreshold;
146 UP.PercentDynamicCostSavedThreshold =
149 UP.DynamicCostSavingsDiscount = UnrollDynamicCostSavingsDiscount;
151 UP.MaxCount = UnrollMaxCount;
153 UP.FullUnrollMaxCount = UnrollFullMaxCount;
155 UP.Partial = UnrollAllowPartial;
157 UP.AllowRemainder = UnrollAllowRemainder;
159 UP.Runtime = UnrollRuntime;
163 UP.Threshold = *UserThreshold;
164 UP.PartialThreshold = *UserThreshold;
167 UP.Count = *UserCount;
169 UP.Partial = *UserAllowPartial;
171 UP.Runtime = *UserRuntime;
173 return UP;
229 /// given iteration its condition would be resolved to true, we won't add up the
433 // the cost of it and all the instructions leading up to it.
691 // Calculates unroll count and writes it to UP.Count.
696 TargetTransformInfo::UnrollingPreferences &UP) {
706 UP.Count = UnrollCount;
707 UP.AllowExpensiveTripCount = true;
708 UP.Force = true;
709 if (UP.AllowRemainder &&
710 (LoopSize - BEInsns) * UP.Count + BEInsns < UP.Threshold)
717 UP.Count = PragmaCount;
718 UP.Runtime = true;
719 UP.AllowExpensiveTripCount = true;
720 UP.Force = true;
721 if (UP.AllowRemainder &&
722 (LoopSize - BEInsns) * UP.Count + BEInsns < PragmaUnrollThreshold)
727 UP.Count = TripCount;
728 if ((LoopSize - BEInsns) * UP.Count + BEInsns < PragmaUnrollThreshold)
745 UP.Threshold = std::max<unsigned>(UP.Threshold, PragmaUnrollThreshold);
746 UP.PartialThreshold =
747 std::max<unsigned>(UP.PartialThreshold, PragmaUnrollThreshold);
753 if (TripCount && TripCount <= UP.FullUnrollMaxCount) {
757 if (canUnrollCompletely(L, UP.Threshold, 100, UP.DynamicCostSavingsDiscount,
759 UP.Count = TripCount;
767 UP.Threshold + UP.DynamicCostSavingsDiscount))
768 if (canUnrollCompletely(L, UP.Threshold,
769 UP.PercentDynamicCostSavedThreshold,
770 UP.DynamicCostSavingsDiscount,
772 UP.Count = TripCount;
781 if (UP.Count == 0)
782 UP.Count = TripCount;
783 UP.Partial |= ExplicitUnroll;
784 if (!UP.Partial) {
787 UP.Count = 0;
790 if (UP.PartialThreshold != NoThreshold) {
792 UnrolledSize = (uint64_t)(LoopSize - BEInsns) * UP.Count + BEInsns;
793 if (UnrolledSize > UP.PartialThreshold)
794 UP.Count = (std::max(UP.PartialThreshold, 3u) - BEInsns) /
796 if (UP.Count > UP.MaxCount)
797 UP.Count = UP.MaxCount;
798 while (UP.Count != 0 && TripCount % UP.Count != 0)
799 UP.Count--;
800 if (UP.AllowRemainder && UP
805 UP.Count = DefaultUnrollRuntimeCount;
806 UnrolledSize = (LoopSize - BEInsns) * UP.Count + BEInsns;
807 while (UP.Count != 0 && UnrolledSize > UP.PartialThreshold) {
808 UP.Count >>= 1;
809 UnrolledSize = (LoopSize - BEInsns) * UP.Count + BEInsns;
812 if (UP.Count < 2) {
818 UP.Count = 0;
821 UP.Count = TripCount;
824 UP.Count != TripCount)
842 UP.Count = 0;
846 UP.Runtime |= PragmaEnableUnroll || PragmaCount > 0 || UserUnrollCount;
847 if (!UP.Runtime) {
850 UP.Count = 0;
853 if (UP.Count == 0)
854 UP.Count = DefaultUnrollRuntimeCount;
855 UnrolledSize = (LoopSize - BEInsns) * UP.Count + BEInsns;
859 while (UP.Count != 0 && UnrolledSize > UP.PartialThreshold) {
860 UP.Count >>= 1;
861 UnrolledSize = (LoopSize - BEInsns) * UP.Count + BEInsns;
865 unsigned OrigCount = UP.Count;
868 if (!UP.AllowRemainder && UP.Count != 0 && (TripMultiple % UP.Count) != 0) {
869 while (UP.Count != 0 && TripMultiple % UP.Count != 0)
870 UP.Count >>= 1;
876 << OrigCount << " to " << UP.Count << ".\n");
877 if (PragmaCount > 0 && !UP.AllowRemainder)
885 Twine(TripMultiple) + ". Unrolling instead " + Twine(UP.Count) +
889 if (UP.Count > UP.MaxCount)
890 UP.Count = UP.MaxCount;
891 DEBUG(dbgs() << " partially unrolling with count: " << UP.Count << "\n");
892 if (UP.Count < 2)
893 UP.Count = 0;
945 TargetTransformInfo::UnrollingPreferences UP = gatherUnrollingPreferences(
962 UP.AllowRemainder = false;
965 TripMultiple, LoopSize, UP);
966 if (!UP.Count)
969 if (TripCount && UP.Count > TripCount)
970 UP.Count = TripCount;
973 if (!UnrollLoop(L, UP.Count, TripCount, UP.Force, UP.Runtime,
974 UP.AllowExpensiveTripCount, TripMultiple, LI, SE, &DT, &AC,