This is an archive of the discontinued LLVM Phabricator instance.

Fix PR 23525 - Separate header mass propagation in irregular loops.
ClosedPublic

Authored by dnovillo on Jun 9 2015, 3:06 PM.

Details

Summary

When propagating mass through irregular loops, the mass flowing through
each loop header may not be equal. This was causing wrong frequencies
to be computed for irregular loop headers.

Fixed by keeping track of masses flowing through each of the headers in
an irregular loop. To do this, we now keep track of per-header backedge
weights. After the loop mass is distributed through the loop, the
backedge weights are used to re-distribute the loop mass to the loop
headers.

Since each backedge will have a mass proportional to the different
branch weights, the loop headers will end up with a more approximate
weight distribution (as opposed to the current distribution that assumes
that every loop header is the same).

Diff Detail

Repository
rL LLVM

Event Timeline

dnovillo updated this revision to Diff 27407.Jun 9 2015, 3:06 PM
dnovillo retitled this revision from to Fix PR 23525 - Separate header mass propagation in irregular loops..
dnovillo updated this object.
dnovillo edited the test plan for this revision. (Show Details)
dnovillo added a reviewer: dexonsmith.
dnovillo added a subscriber: Unknown Object (MLST).
davidxl added inline comments.
include/llvm/Analysis/BlockFrequencyInfoImpl.h
1057 ↗(On Diff #27407)

Should this be done iteratively? The mass propagation before this call is based on wrong initial masses for loop headers.

This revision was automatically updated to reflect the committed changes.