HomePhabricator

[MachinePipeliner] Fix risky iterator usage R++, --R

Authored by jsji on Jun 25 2019, 2:50 PM.

Description

[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

Details

Committed
jsjiJun 25 2019, 2:50 PM
Differential Revision
D63536: [MachinePipeliner] Fix risky iterator usage R++, --R
Parents
rGc32d307a49f5: android: enable double-word CAS on x64
Branches
Unknown
Tags
Unknown