[llvm] 18d1df4 - llvm/lib/CodeGen/TargetSchedule.cpp:132:12: warning: Assert statement modifies 'NIter' (#90982)

via llvm-commits llvm-commits at lists.llvm.org
Sat May 4 11:16:06 PDT 2024


Author: akshaykumars614
Date: 2024-05-04T14:16:02-04:00
New Revision: 18d1df4633c3964e12ec46f3fa92e60ab21842fd

URL: https://github.com/llvm/llvm-project/commit/18d1df4633c3964e12ec46f3fa92e60ab21842fd
DIFF: https://github.com/llvm/llvm-project/commit/18d1df4633c3964e12ec46f3fa92e60ab21842fd.diff

LOG: llvm/lib/CodeGen/TargetSchedule.cpp:132:12: warning: Assert statement modifies 'NIter' (#90982)

Modified the assert statement

Added: 
    

Modified: 
    llvm/lib/CodeGen/TargetSchedule.cpp

Removed: 
    


################################################################################
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);


        


More information about the llvm-commits mailing list