1 //===- BlockFrequencyImplInfo.cpp - Block Frequency Info Implementation ---===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // Loops should be simplified before this analysis.
12 //===----------------------------------------------------------------------===//
14 #include "llvm/Analysis/BlockFrequencyInfoImpl.h"
15 #include "llvm/ADT/APFloat.h"
16 #include "llvm/Support/raw_ostream.h"
21 #define DEBUG_TYPE "block-freq"
23 //===----------------------------------------------------------------------===//
25 // UnsignedFloat implementation.
27 //===----------------------------------------------------------------------===//
29 const int32_t UnsignedFloatBase::MaxExponent;
30 const int32_t UnsignedFloatBase::MinExponent;
33 static void appendDigit(std::string &Str, unsigned D) {
38 static void appendNumber(std::string &Str, uint64_t N) {
40 appendDigit(Str, N % 10);
45 static bool doesRoundUp(char Digit) {
58 static std::string toStringAPFloat(uint64_t D, int E, unsigned Precision) {
59 assert(E >= UnsignedFloatBase::MinExponent);
60 assert(E <= UnsignedFloatBase::MaxExponent);
62 // Find a new E, but don't let it increase past MaxExponent.
63 int LeadingZeros = UnsignedFloatBase::countLeadingZeros64(D);
64 int NewE = std::min(UnsignedFloatBase::MaxExponent, E + 63 - LeadingZeros);
65 int Shift = 63 - (NewE - E);
66 assert(Shift <= LeadingZeros);
67 assert(Shift == LeadingZeros || NewE == UnsignedFloatBase::MaxExponent);
71 // Check for a denormal.
72 unsigned AdjustedE = E + 16383;
74 assert(E == UnsignedFloatBase::MaxExponent);
78 // Build the float and print it.
79 uint64_t RawBits[2] = {D, AdjustedE};
80 APFloat Float(APFloat::x87DoubleExtended, APInt(80, RawBits));
81 SmallVector<char, 24> Chars;
82 Float.toString(Chars, Precision, 0);
83 return std::string(Chars.begin(), Chars.end());
86 static std::string stripTrailingZeros(const std::string &Float) {
87 size_t NonZero = Float.find_last_not_of('0');
88 assert(NonZero != std::string::npos && "no . in floating point string");
90 if (Float[NonZero] == '.')
93 return Float.substr(0, NonZero + 1);
96 std::string UnsignedFloatBase::toString(uint64_t D, int16_t E, int Width,
101 // Canonicalize exponent and digits.
109 if (int Shift = std::min(int16_t(countLeadingZeros64(D)), E)) {
116 } else if (E > -64) {
118 Below0 = D << (64 + E);
119 } else if (E > -120) {
120 Below0 = D >> (-E - 64);
121 Extra = D << (128 + E);
122 ExtraShift = -64 - E;
125 // Fall back on APFloat for very small and very large numbers.
126 if (!Above0 && !Below0)
127 return toStringAPFloat(D, E, Precision);
129 // Append the digits before the decimal.
131 size_t DigitsOut = 0;
133 appendNumber(Str, Above0);
134 DigitsOut = Str.size();
137 std::reverse(Str.begin(), Str.end());
139 // Return early if there's nothing after the decimal.
143 // Append the decimal and beyond.
145 uint64_t Error = UINT64_C(1) << (64 - Width);
147 // We need to shift Below0 to the right to make space for calculating
148 // digits. Save the precision we're losing in Extra.
149 Extra = (Below0 & 0xf) << 56 | (Extra >> 8);
152 size_t AfterDot = Str.size();
162 Below0 += (Extra >> 60);
163 Extra = Extra & (UINT64_MAX >> 4);
164 appendDigit(Str, Below0 >> 60);
165 Below0 = Below0 & (UINT64_MAX >> 4);
166 if (DigitsOut || Str.back() != '0')
169 } while (Error && (Below0 << 4 | Extra >> 60) >= Error / 2 &&
170 (!Precision || DigitsOut <= Precision || SinceDot < 2));
172 // Return early for maximum precision.
173 if (!Precision || DigitsOut <= Precision)
174 return stripTrailingZeros(Str);
176 // Find where to truncate.
178 std::max(Str.size() - (DigitsOut - Precision), AfterDot + 1);
180 // Check if there's anything to truncate.
181 if (Truncate >= Str.size())
182 return stripTrailingZeros(Str);
184 bool Carry = doesRoundUp(Str[Truncate]);
186 return stripTrailingZeros(Str.substr(0, Truncate));
188 // Round with the first truncated digit.
189 for (std::string::reverse_iterator I(Str.begin() + Truncate), E = Str.rend();
203 // Add "1" in front if we still need to carry.
204 return stripTrailingZeros(std::string(Carry, '1') + Str.substr(0, Truncate));
207 raw_ostream &UnsignedFloatBase::print(raw_ostream &OS, uint64_t D, int16_t E,
208 int Width, unsigned Precision) {
209 return OS << toString(D, E, Width, Precision);
212 void UnsignedFloatBase::dump(uint64_t D, int16_t E, int Width) {
213 print(dbgs(), D, E, Width, 0) << "[" << Width << ":" << D << "*2^" << E
217 static std::pair<uint64_t, int16_t>
218 getRoundedFloat(uint64_t N, bool ShouldRound, int64_t Shift) {
221 // Rounding caused an overflow.
222 return std::make_pair(UINT64_C(1), Shift + 64);
223 return std::make_pair(N, Shift);
226 std::pair<uint64_t, int16_t> UnsignedFloatBase::divide64(uint64_t Dividend,
228 // Input should be sanitized.
232 // Minimize size of divisor.
234 if (int Zeros = countTrailingZeros(Divisor)) {
239 // Check for powers of two.
241 return std::make_pair(Dividend, Shift);
243 // Maximize size of dividend.
244 if (int Zeros = countLeadingZeros64(Dividend)) {
249 // Start with the result of a divide.
250 uint64_t Quotient = Dividend / Divisor;
253 // Continue building the quotient with long division.
255 // TODO: continue with largers digits.
256 while (!(Quotient >> 63) && Dividend) {
257 // Shift Dividend, and check for overflow.
258 bool IsOverflow = Dividend >> 63;
263 bool DoesDivide = IsOverflow || Divisor <= Dividend;
264 Quotient = (Quotient << 1) | uint64_t(DoesDivide);
265 Dividend -= DoesDivide ? Divisor : 0;
269 if (Dividend >= getHalf(Divisor))
271 // Rounding caused an overflow in Quotient.
272 return std::make_pair(UINT64_C(1), Shift + 64);
274 return getRoundedFloat(Quotient, Dividend >= getHalf(Divisor), Shift);
277 std::pair<uint64_t, int16_t> UnsignedFloatBase::multiply64(uint64_t L,
279 // Separate into two 32-bit digits (U.L).
280 uint64_t UL = L >> 32, LL = L & UINT32_MAX, UR = R >> 32, LR = R & UINT32_MAX;
282 // Compute cross products.
283 uint64_t P1 = UL * UR, P2 = UL * LR, P3 = LL * UR, P4 = LL * LR;
285 // Sum into two 64-bit digits.
286 uint64_t Upper = P1, Lower = P4;
287 auto addWithCarry = [&](uint64_t N) {
288 uint64_t NewLower = Lower + (N << 32);
289 Upper += (N >> 32) + (NewLower < Lower);
295 // Check whether the upper digit is empty.
297 return std::make_pair(Lower, 0);
299 // Shift as little as possible to maximize precision.
300 unsigned LeadingZeros = countLeadingZeros64(Upper);
301 int16_t Shift = 64 - LeadingZeros;
303 Upper = Upper << LeadingZeros | Lower >> Shift;
304 bool ShouldRound = Shift && (Lower & UINT64_C(1) << (Shift - 1));
305 return getRoundedFloat(Upper, ShouldRound, Shift);
308 //===----------------------------------------------------------------------===//
310 // BlockMass implementation.
312 //===----------------------------------------------------------------------===//
313 BlockMass &BlockMass::operator*=(const BranchProbability &P) {
314 uint32_t N = P.getNumerator(), D = P.getDenominator();
315 assert(D && "divide by 0");
316 assert(N <= D && "fraction greater than 1");
318 // Fast path for multiplying by 1.0.
322 // Get as much precision as we can.
323 int Shift = countLeadingZeros(Mass);
324 uint64_t ShiftedQuotient = (Mass << Shift) / D;
325 uint64_t Product = ShiftedQuotient * N >> Shift;
327 // Now check for what's lost.
328 uint64_t Left = ShiftedQuotient * (D - N) >> Shift;
329 uint64_t Lost = Mass - Product - Left;
331 // TODO: prove this assertion.
332 assert(Lost <= UINT32_MAX);
334 // Take the product plus a portion of the spoils.
335 Mass = Product + Lost * N / D;
339 UnsignedFloat<uint64_t> BlockMass::toFloat() const {
341 return UnsignedFloat<uint64_t>(1, 0);
342 return UnsignedFloat<uint64_t>(getMass() + 1, -64);
345 void BlockMass::dump() const { print(dbgs()); }
347 static char getHexDigit(int N) {
353 raw_ostream &BlockMass::print(raw_ostream &OS) const {
354 for (int Digits = 0; Digits < 16; ++Digits)
355 OS << getHexDigit(Mass >> (60 - Digits * 4) & 0xf);
359 //===----------------------------------------------------------------------===//
361 // BlockFrequencyInfoImpl implementation.
363 //===----------------------------------------------------------------------===//
366 typedef BlockFrequencyInfoImplBase::BlockNode BlockNode;
367 typedef BlockFrequencyInfoImplBase::Distribution Distribution;
368 typedef BlockFrequencyInfoImplBase::Distribution::WeightList WeightList;
369 typedef BlockFrequencyInfoImplBase::Float Float;
370 typedef BlockFrequencyInfoImplBase::LoopData LoopData;
371 typedef BlockFrequencyInfoImplBase::Weight Weight;
372 typedef BlockFrequencyInfoImplBase::FrequencyData FrequencyData;
374 /// \brief Dithering mass distributer.
376 /// This class splits up a single mass into portions by weight, dithering to
377 /// spread out error. No mass is lost. The dithering precision depends on the
378 /// precision of the product of \a BlockMass and \a BranchProbability.
380 /// The distribution algorithm follows.
382 /// 1. Initialize by saving the sum of the weights in \a RemWeight and the
383 /// mass to distribute in \a RemMass.
385 /// 2. For each portion:
387 /// 1. Construct a branch probability, P, as the portion's weight divided
388 /// by the current value of \a RemWeight.
389 /// 2. Calculate the portion's mass as \a RemMass times P.
390 /// 3. Update \a RemWeight and \a RemMass at each portion by subtracting
391 /// the current portion's weight and mass.
392 struct DitheringDistributer {
396 DitheringDistributer(Distribution &Dist, const BlockMass &Mass);
398 BlockMass takeMass(uint32_t Weight);
402 DitheringDistributer::DitheringDistributer(Distribution &Dist,
403 const BlockMass &Mass) {
405 RemWeight = Dist.Total;
409 BlockMass DitheringDistributer::takeMass(uint32_t Weight) {
410 assert(Weight && "invalid weight");
411 assert(Weight <= RemWeight);
412 BlockMass Mass = RemMass * BranchProbability(Weight, RemWeight);
414 // Decrement totals (dither).
420 void Distribution::add(const BlockNode &Node, uint64_t Amount,
421 Weight::DistType Type) {
422 assert(Amount && "invalid weight of 0");
423 uint64_t NewTotal = Total + Amount;
425 // Check for overflow. It should be impossible to overflow twice.
426 bool IsOverflow = NewTotal < Total;
427 assert(!(DidOverflow && IsOverflow) && "unexpected repeated overflow");
428 DidOverflow |= IsOverflow;
438 Weights.push_back(W);
441 static void combineWeight(Weight &W, const Weight &OtherW) {
442 assert(OtherW.TargetNode.isValid());
447 assert(W.Type == OtherW.Type);
448 assert(W.TargetNode == OtherW.TargetNode);
449 assert(W.Amount < W.Amount + OtherW.Amount && "Unexpected overflow");
450 W.Amount += OtherW.Amount;
452 static void combineWeightsBySorting(WeightList &Weights) {
453 // Sort so edges to the same node are adjacent.
454 std::sort(Weights.begin(), Weights.end(),
456 const Weight &R) { return L.TargetNode < R.TargetNode; });
458 // Combine adjacent edges.
459 WeightList::iterator O = Weights.begin();
460 for (WeightList::const_iterator I = O, L = O, E = Weights.end(); I != E;
464 // Find the adjacent weights to the same node.
465 for (++L; L != E && I->TargetNode == L->TargetNode; ++L)
466 combineWeight(*O, *L);
469 // Erase extra entries.
470 Weights.erase(O, Weights.end());
473 static void combineWeightsByHashing(WeightList &Weights) {
474 // Collect weights into a DenseMap.
475 typedef DenseMap<BlockNode::IndexType, Weight> HashTable;
476 HashTable Combined(NextPowerOf2(2 * Weights.size()));
477 for (const Weight &W : Weights)
478 combineWeight(Combined[W.TargetNode.Index], W);
480 // Check whether anything changed.
481 if (Weights.size() == Combined.size())
484 // Fill in the new weights.
486 Weights.reserve(Combined.size());
487 for (const auto &I : Combined)
488 Weights.push_back(I.second);
490 static void combineWeights(WeightList &Weights) {
491 // Use a hash table for many successors to keep this linear.
492 if (Weights.size() > 128) {
493 combineWeightsByHashing(Weights);
497 combineWeightsBySorting(Weights);
499 static uint64_t shiftRightAndRound(uint64_t N, int Shift) {
504 return (N >> Shift) + (UINT64_C(1) & N >> (Shift - 1));
506 void Distribution::normalize() {
507 // Early exit for termination nodes.
511 // Only bother if there are multiple successors.
512 if (Weights.size() > 1)
513 combineWeights(Weights);
515 // Early exit when combined into a single successor.
516 if (Weights.size() == 1) {
518 Weights.front().Amount = 1;
522 // Determine how much to shift right so that the total fits into 32-bits.
524 // If we shift at all, shift by 1 extra. Otherwise, the lower limit of 1
525 // for each weight can cause a 32-bit overflow.
529 else if (Total > UINT32_MAX)
530 Shift = 33 - countLeadingZeros(Total);
532 // Early exit if nothing needs to be scaled.
536 // Recompute the total through accumulation (rather than shifting it) so that
537 // it's accurate after shifting.
540 // Sum the weights to each node and shift right if necessary.
541 for (Weight &W : Weights) {
542 // Scale down below UINT32_MAX. Since Shift is larger than necessary, we
543 // can round here without concern about overflow.
544 assert(W.TargetNode.isValid());
545 W.Amount = std::max(UINT64_C(1), shiftRightAndRound(W.Amount, Shift));
546 assert(W.Amount <= UINT32_MAX);
551 assert(Total <= UINT32_MAX);
554 void BlockFrequencyInfoImplBase::clear() {
555 // Swap with a default-constructed std::vector, since std::vector<>::clear()
556 // does not actually clear heap storage.
557 std::vector<FrequencyData>().swap(Freqs);
558 std::vector<WorkingData>().swap(Working);
562 /// \brief Clear all memory not needed downstream.
564 /// Releases all memory not used downstream. In particular, saves Freqs.
565 static void cleanup(BlockFrequencyInfoImplBase &BFI) {
566 std::vector<FrequencyData> SavedFreqs(std::move(BFI.Freqs));
568 BFI.Freqs = std::move(SavedFreqs);
571 void BlockFrequencyInfoImplBase::addToDist(Distribution &Dist,
572 const LoopData *OuterLoop,
573 const BlockNode &Pred,
574 const BlockNode &Succ,
579 auto isLoopHeader = [&OuterLoop](const BlockNode &Node) {
580 return OuterLoop && OuterLoop->isHeader(Node);
583 BlockNode Resolved = Working[Succ.Index].getResolvedNode();
586 auto debugSuccessor = [&](const char *Type) {
588 << " [" << Type << "] weight = " << Weight;
589 if (!isLoopHeader(Resolved))
590 dbgs() << ", succ = " << getBlockName(Succ);
591 if (Resolved != Succ)
592 dbgs() << ", resolved = " << getBlockName(Resolved);
595 (void)debugSuccessor;
598 if (isLoopHeader(Resolved)) {
599 DEBUG(debugSuccessor("backedge"));
600 Dist.addBackedge(OuterLoop->getHeader(), Weight);
604 if (Working[Resolved.Index].getContainingLoop() != OuterLoop) {
605 DEBUG(debugSuccessor(" exit "));
606 Dist.addExit(Resolved, Weight);
610 if (Resolved < Pred) {
611 // Irreducible backedge. Skip.
612 DEBUG(debugSuccessor(" skip "));
616 DEBUG(debugSuccessor(" local "));
617 Dist.addLocal(Resolved, Weight);
620 void BlockFrequencyInfoImplBase::addLoopSuccessorsToDist(
621 const LoopData *OuterLoop, LoopData &Loop, Distribution &Dist) {
622 // Copy the exit map into Dist.
623 for (const auto &I : Loop.Exits)
624 addToDist(Dist, OuterLoop, Loop.getHeader(), I.first, I.second.getMass());
626 // We don't need this map any more. Clear it to prevent quadratic memory
627 // usage in deeply nested loops with irreducible control flow.
631 /// \brief Get the maximum allowed loop scale.
633 /// Gives the maximum number of estimated iterations allowed for a loop. Very
634 /// large numbers cause problems downstream (even within 64-bits).
635 static Float getMaxLoopScale() { return Float(1, 12); }
637 /// \brief Compute the loop scale for a loop.
638 void BlockFrequencyInfoImplBase::computeLoopScale(LoopData &Loop) {
639 // Compute loop scale.
640 DEBUG(dbgs() << "compute-loop-scale: " << getBlockName(Loop.getHeader())
643 // LoopScale == 1 / ExitMass
644 // ExitMass == HeadMass - BackedgeMass
645 BlockMass ExitMass = BlockMass::getFull() - Loop.BackedgeMass;
647 // Block scale stores the inverse of the scale.
648 Loop.Scale = ExitMass.toFloat().inverse();
650 DEBUG(dbgs() << " - exit-mass = " << ExitMass << " (" << BlockMass::getFull()
651 << " - " << Loop.BackedgeMass << ")\n"
652 << " - scale = " << Loop.Scale << "\n");
654 if (Loop.Scale > getMaxLoopScale()) {
655 Loop.Scale = getMaxLoopScale();
656 DEBUG(dbgs() << " - reduced-to-max-scale: " << getMaxLoopScale() << "\n");
660 /// \brief Package up a loop.
661 void BlockFrequencyInfoImplBase::packageLoop(LoopData &Loop) {
662 DEBUG(dbgs() << "packaging-loop: " << getBlockName(Loop.getHeader()) << "\n");
663 Loop.IsPackaged = true;
664 DEBUG(for (const BlockNode &M
666 dbgs() << " - node: " << getBlockName(M.Index) << "\n";
670 void BlockFrequencyInfoImplBase::distributeMass(const BlockNode &Source,
672 Distribution &Dist) {
673 BlockMass Mass = Working[Source.Index].getMass();
674 DEBUG(dbgs() << " => mass: " << Mass << "\n");
676 // Distribute mass to successors as laid out in Dist.
677 DitheringDistributer D(Dist, Mass);
680 auto debugAssign = [&](const BlockNode &T, const BlockMass &M,
682 dbgs() << " => assign " << M << " (" << D.RemMass << ")";
684 dbgs() << " [" << Desc << "]";
686 dbgs() << " to " << getBlockName(T);
692 for (const Weight &W : Dist.Weights) {
693 // Check for a local edge (non-backedge and non-exit).
694 BlockMass Taken = D.takeMass(W.Amount);
695 if (W.Type == Weight::Local) {
696 Working[W.TargetNode.Index].getMass() += Taken;
697 DEBUG(debugAssign(W.TargetNode, Taken, nullptr));
701 // Backedges and exits only make sense if we're processing a loop.
702 assert(OuterLoop && "backedge or exit outside of loop");
704 // Check for a backedge.
705 if (W.Type == Weight::Backedge) {
706 OuterLoop->BackedgeMass += Taken;
707 DEBUG(debugAssign(BlockNode(), Taken, "back"));
711 // This must be an exit.
712 assert(W.Type == Weight::Exit);
713 OuterLoop->Exits.push_back(std::make_pair(W.TargetNode, Taken));
714 DEBUG(debugAssign(W.TargetNode, Taken, "exit"));
718 static void convertFloatingToInteger(BlockFrequencyInfoImplBase &BFI,
719 const Float &Min, const Float &Max) {
720 // Scale the Factor to a size that creates integers. Ideally, integers would
721 // be scaled so that Max == UINT64_MAX so that they can be best
722 // differentiated. However, the register allocator currently deals poorly
723 // with large numbers. Instead, push Min up a little from 1 to give some
724 // room to differentiate small, unequal numbers.
726 // TODO: fix issues downstream so that ScalingFactor can be Float(1,64)/Max.
727 Float ScalingFactor = Min.inverse();
728 if ((Max / Min).lg() < 60)
731 // Translate the floats to integers.
732 DEBUG(dbgs() << "float-to-int: min = " << Min << ", max = " << Max
733 << ", factor = " << ScalingFactor << "\n");
734 for (size_t Index = 0; Index < BFI.Freqs.size(); ++Index) {
735 Float Scaled = BFI.Freqs[Index].Floating * ScalingFactor;
736 BFI.Freqs[Index].Integer = std::max(UINT64_C(1), Scaled.toInt<uint64_t>());
737 DEBUG(dbgs() << " - " << BFI.getBlockName(Index) << ": float = "
738 << BFI.Freqs[Index].Floating << ", scaled = " << Scaled
739 << ", int = " << BFI.Freqs[Index].Integer << "\n");
743 /// \brief Unwrap a loop package.
745 /// Visits all the members of a loop, adjusting their BlockData according to
746 /// the loop's pseudo-node.
747 static void unwrapLoop(BlockFrequencyInfoImplBase &BFI, LoopData &Loop) {
748 DEBUG(dbgs() << "unwrap-loop-package: " << BFI.getBlockName(Loop.getHeader())
749 << ": mass = " << Loop.Mass << ", scale = " << Loop.Scale
751 Loop.Scale *= Loop.Mass.toFloat();
752 Loop.IsPackaged = false;
753 DEBUG(dbgs() << " => combined-scale = " << Loop.Scale << "\n");
755 // Propagate the head scale through the loop. Since members are visited in
756 // RPO, the head scale will be updated by the loop scale first, and then the
757 // final head scale will be used for updated the rest of the members.
758 for (const BlockNode &N : Loop.Nodes) {
759 const auto &Working = BFI.Working[N.Index];
760 Float &F = Working.isAPackage() ? BFI.getLoopPackage(N).Scale
761 : BFI.Freqs[N.Index].Floating;
762 Float New = Loop.Scale * F;
763 DEBUG(dbgs() << " - " << BFI.getBlockName(N) << ": " << F << " => " << New
769 void BlockFrequencyInfoImplBase::unwrapLoops() {
770 // Set initial frequencies from loop-local masses.
771 for (size_t Index = 0; Index < Working.size(); ++Index)
772 Freqs[Index].Floating = Working[Index].Mass.toFloat();
774 for (LoopData &Loop : Loops)
775 unwrapLoop(*this, Loop);
778 void BlockFrequencyInfoImplBase::finalizeMetrics() {
779 // Unwrap loop packages in reverse post-order, tracking min and max
781 auto Min = Float::getLargest();
782 auto Max = Float::getZero();
783 for (size_t Index = 0; Index < Working.size(); ++Index) {
784 // Update min/max scale.
785 Min = std::min(Min, Freqs[Index].Floating);
786 Max = std::max(Max, Freqs[Index].Floating);
789 // Convert to integers.
790 convertFloatingToInteger(*this, Min, Max);
792 // Clean up data structures.
795 // Print out the final stats.
800 BlockFrequencyInfoImplBase::getBlockFreq(const BlockNode &Node) const {
803 return Freqs[Node.Index].Integer;
806 BlockFrequencyInfoImplBase::getFloatingBlockFreq(const BlockNode &Node) const {
808 return Float::getZero();
809 return Freqs[Node.Index].Floating;
813 BlockFrequencyInfoImplBase::getBlockName(const BlockNode &Node) const {
814 return std::string();
818 BlockFrequencyInfoImplBase::printBlockFreq(raw_ostream &OS,
819 const BlockNode &Node) const {
820 return OS << getFloatingBlockFreq(Node);
824 BlockFrequencyInfoImplBase::printBlockFreq(raw_ostream &OS,
825 const BlockFrequency &Freq) const {
826 Float Block(Freq.getFrequency(), 0);
827 Float Entry(getEntryFreq(), 0);
829 return OS << Block / Entry;