This is an archive of the discontinued LLVM Phabricator instance.

[BPI] Push exit block rather than exiting ones in getSccExitBlocks
ClosedPublic

Authored by bin.cheng on Nov 6 2021, 5:05 AM.

Details

Summary

Hi,
See comment before BranchProbabilityInfo::SccInfo::getSccExitBlocks:
" /// Fills in \p Exits vector with all such blocks that don't belong to

/// SCC with \p SccNum ID but there is an edge from a block belonging to the
/// SCC."

Also see the comment/implementation of related function BranchProbabilityInfo::getLoopExitBlocks,
I believe the current implement has typo pushing copies of exiting block into result vector. This simple
patch fixes the typo by pushing exit blocks.

I spot this when going through the code, unfortunately I didn't come up with any test for this.
I tried to instrument the function if it's triggered, though the function is only called in one
function from spec2k17int, it's not really triggered because push_back operation is never executed.

Any comments?

Thanks,
bin

Diff Detail

Event Timeline

bin.cheng created this revision.Nov 6 2021, 5:05 AM
bin.cheng requested review of this revision.Nov 6 2021, 5:05 AM
ebrevnov accepted this revision.Nov 7 2021, 11:10 PM

LGTM.
PS: I think it should be possible to create targeted test case by hands though.

This revision is now accepted and ready to land.Nov 7 2021, 11:10 PM
This revision was landed with ongoing or failed builds.Nov 10 2021, 10:22 PM
This revision was automatically updated to reflect the committed changes.