This is an archive of the discontinued LLVM Phabricator instance.

[loop unroll] Fix `branch-weights` for unrolled loop.
ClosedPublic

Authored by mtrofin on Feb 13 2023, 1:43 PM.

Details

Summary

The branch weights of the unrolled loop need to be reduced by the
unroll factor.

Diff Detail

Event Timeline

mtrofin created this revision.Feb 13 2023, 1:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 13 2023, 1:43 PM
mtrofin requested review of this revision.Feb 13 2023, 1:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 13 2023, 1:43 PM
hoy accepted this revision.Feb 13 2023, 5:07 PM
hoy added a subscriber: hoy.

LGTM, thanks for fixing it.

This revision is now accepted and ready to land.Feb 13 2023, 5:07 PM

It's a bit surprising that issues like this went unnoticed for so long... Thanks for the fix.

nikic added a subscriber: nikic.Feb 14 2023, 3:46 AM
nikic added inline comments.
llvm/lib/Transforms/Utils/LoopUnroll.cpp
315

nit: Unnecessary llvm:: prefix.

It's a bit surprising that issues like this went unnoticed for so long... Thanks for the fix.

I think the problem is that we don't have an end to end integration test for profile propagation through the compiler.

mtrofin marked an inline comment as done.Feb 14 2023, 11:59 AM
This revision was landed with ongoing or failed builds.Feb 14 2023, 12:01 PM
This revision was automatically updated to reflect the committed changes.