diff --git a/llvm/lib/CodeGen/TargetSchedule.cpp b/llvm/lib/CodeGen/TargetSchedule.cpp index ce59b096992d8e..b5db2a671f7d04 100644 --- a/llvm/lib/CodeGen/TargetSchedule.cpp +++ b/llvm/lib/CodeGen/TargetSchedule.cpp @@ -129,7 +129,8 @@ resolveSchedClass(const MachineInstr *MI) const { unsigned NIter = 0; #endif while (SCDesc->isVariant()) { - assert(++NIter < 6 && "Variants are nested deeper than the magic number"); + ++NIter; + assert(NIter < 6 && "Variants are nested deeper than the magic number"); SchedClass = STI->resolveSchedClass(SchedClass, MI, this); SCDesc = SchedModel.getSchedClassDesc(SchedClass);