Perform rudimentary check on graph size for no-change assertions.

Rationale:
This will find blatant violations of asserting a no-change
pass change if the graph size changed nevertheless.

Bug: 78171933

Test: test-art-host,target
Change-Id: I07b38e71c75dd6f728246d096976c8333b363329
diff --git a/compiler/optimizing/graph_checker.h b/compiler/optimizing/graph_checker.h
index dbedc40..3a2bb7a 100644
--- a/compiler/optimizing/graph_checker.h
+++ b/compiler/optimizing/graph_checker.h
@@ -38,13 +38,11 @@
     seen_ids_.ClearAllBits();
   }
 
-  // Check the whole graph (in reverse post-order).
-  void Run() {
-    // VisitReversePostOrder is used instead of VisitInsertionOrder,
-    // as the latter might visit dead blocks removed by the dominator
-    // computation.
-    VisitReversePostOrder();
-  }
+  // Check the whole graph. The pass_change parameter indicates whether changes
+  // may have occurred during the just executed pass. The default value is
+  // conservatively "true" (something may have changed). The last_size parameter
+  // and return value pass along the observed graph sizes.
+  size_t Run(bool pass_change = true, size_t last_size = 0);
 
   void VisitBasicBlock(HBasicBlock* block) OVERRIDE;