Skip to content

Commit 778a1a7

Browse files
committed
Fix call counts.
1 parent ca3d7b9 commit 778a1a7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/BenchmarkDotNet/Engines/EngineJitStage.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,19 @@ private IEnumerator<IterationData> EnumerateIterations()
9191
// Attempt to promote methods to tier1, but don't spend too much time in jit stage.
9292
StartedClock startedClock = parameters.TargetJob.ResolveValue(InfrastructureMode.ClockCharacteristic, parameters.Resolver).Start();
9393

94-
for (int tierCount = JitInfo.IsDPGO ? 2 : 1; tierCount >= 0; --tierCount)
94+
int remainingTiers = JitInfo.IsDPGO ? 2 : 1;
95+
while (remainingTiers > 0)
9596
{
96-
for (int callCount = JitInfo.TieredCallCountThreshold; callCount >= 0; --callCount)
97+
--remainingTiers;
98+
int remainingCalls = JitInfo.TieredCallCountThreshold;
99+
while (remainingCalls > 0)
97100
{
101+
--remainingCalls;
98102
++iterationIndex;
99103
yield return GetOverheadIterationData();
100104
yield return GetWorkloadIterationData();
101105

102-
if ((tierCount + callCount) > 0
106+
if ((remainingTiers + remainingCalls) > 0
103107
&& startedClock.GetElapsed().GetTimeValue() >= MaxTieringTime)
104108
{
105109
didStopEarly = true;

0 commit comments

Comments
 (0)