Skip to content

Commit

Permalink
Revert "llvm/lib/CodeGen/TargetSchedule.cpp:132:12: warning: Assert s…
Browse files Browse the repository at this point in the history
…tatement modifies 'NIter'" (#91079)

Reverts #90982

NIter was only declared in !NDEBUG, and only used for assertions - so it
was correct that it was incremented inside the assertion. (& in fact now
the non-asserts build fails, because the variable is incremented even
though it isn't declared)
  • Loading branch information
dwblaikie committed May 4, 2024
1 parent 18d1df4 commit 0044856
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions llvm/lib/CodeGen/TargetSchedule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ resolveSchedClass(const MachineInstr *MI) const {
unsigned NIter = 0;
#endif
while (SCDesc->isVariant()) {
++NIter;
assert(NIter < 6 && "Variants are nested deeper than the magic number");
assert(++NIter < 6 && "Variants are nested deeper than the magic number");

SchedClass = STI->resolveSchedClass(SchedClass, MI, this);
SCDesc = SchedModel.getSchedClassDesc(SchedClass);
Expand Down

0 comments on commit 0044856

Please sign in to comment.