[MachinePipeliner] Fix risky iterator usage R++, --R
When we calculate MII, we use two loops, one with iterator R++ to
check whether we can reserve the resource, then --R to move back
the iterator to do reservation.
This is risky, as R++, --R may not point to the same element at all.
The can cause wrong MII.
Differential Revision: https://reviews.llvm.org/D63536
llvm-svn: 364353
diff --git a/llvm/test/CodeGen/PowerPC/sms-iterator.ll b/llvm/test/CodeGen/PowerPC/sms-iterator.ll
index ec80679..1210ed9 100644
--- a/llvm/test/CodeGen/PowerPC/sms-iterator.ll
+++ b/llvm/test/CodeGen/PowerPC/sms-iterator.ll
@@ -5,7 +5,7 @@
%0 = type { i32, [16 x double] }
-; CHECK: MII = 7 MAX_II = 17
+; CHECK: MII = 8 MAX_II = 18
define dso_local fastcc void @_ZN3povL9polysolveEiPdS0_() unnamed_addr #0 {
br label %1