There is no reason why stages should be visited in reverse order.
This patch allows the definition of stages that push instructions forward from
their cycleEnd() routine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357074
91177308-0d34-0410-b5e6-
96231b3b80d8
Err = FirstStage.execute(IR);
// Update stages in preparation for a new cycle.
- for (auto I = Stages.rbegin(), E = Stages.rend(); I != E && !Err; ++I) {
- const std::unique_ptr<Stage> &S = *I;
- Err = S->cycleEnd();
+ for (const std::unique_ptr<Stage> &S : Stages) {
+ if (Err = S->cycleEnd())
+ break;
}
return Err;