[llvm] llvm/lib/CodeGen/TargetSchedule.cpp:132:12: warning: Assert statement modifies 'NIter' (PR #90982)
via llvm-commits
llvm-commits at lists.llvm.org
Fri May 3 17:12:57 PDT 2024
https://github.com/akshaykumars614 updated https://github.com/llvm/llvm-project/pull/90982
>From a1f497d85414acfe3c86273bb359e5aac2d27068 Mon Sep 17 00:00:00 2001
From: akshaykumars614 <akshaykumars614 at gmail.com>
Date: Fri, 3 May 2024 12:59:03 -0400
Subject: [PATCH] closes #90328
llvm/lib/CodeGen/TargetSchedule.cpp:132:12: warning: Assert statement modifies 'NIter'
Modified the assert statement
---
llvm/lib/CodeGen/TargetSchedule.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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