This is an archive of the discontinued LLVM Phabricator instance.

[LoopUnroll] Simplify optimization remarks
ClosedPublic

Authored by nikic on Jun 17 2021, 12:28 PM.

Details

Summary

This reduces the optimization remarks for unrolling to only include the unroll count, and whether it is a complete unroll, partial unroll or runtime unroll. The information about ULO.TripMultiple and BreakoutTrip is removed, as it is not compatible with multiple exits. The alternative would be to instead add information about all exits to the optimization remarks, but this doesn't seem particularly useful to me.

Diff Detail

Event Timeline

nikic created this revision.Jun 17 2021, 12:28 PM
nikic requested review of this revision.Jun 17 2021, 12:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 17 2021, 12:28 PM
reames requested changes to this revision.Jun 18 2021, 9:48 AM

I think I would prefer to see the information for each exit as opposed to removing it entirely. When understanding why unrolling happened in a particular way, having the detailed information is often very helpful. Not a strong preference, I'm willing to LGTM this if you really object.

This revision now requires changes to proceed.Jun 18 2021, 9:48 AM

I think I would prefer to see the information for each exit as opposed to removing it entirely. When understanding why unrolling happened in a particular way, having the detailed information is often very helpful. Not a strong preference, I'm willing to LGTM this if you really object.

I'm not particularly familiar with how optimization remarks work -- if we wanted to go the other way around, we need to be able to identify specific exits in some way. For debug output, we can just print the block label, but I assume that wouldn't be suitable for optimization remarks, as the block label wouldn't really be meaningful in that context, it's an IR detail. Do you know how one would go about that?

I think I would prefer to see the information for each exit as opposed to removing it entirely. When understanding why unrolling happened in a particular way, having the detailed information is often very helpful. Not a strong preference, I'm willing to LGTM this if you really object.

I'm not particularly familiar with how optimization remarks work -- if we wanted to go the other way around, we need to be able to identify specific exits in some way. For debug output, we can just print the block label, but I assume that wouldn't be suitable for optimization remarks, as the block label wouldn't really be meaningful in that context, it's an IR detail. Do you know how one would go about that?

Hm, good point I was thinking in terms of debug output, and hadn't recognized the ORE complication.

Let's give it a day or so for someone more ORE familiar to chime in. If no one responds, you can consider this an LGTM of the current patch.

nikic updated this revision to Diff 353067.Jun 18 2021, 11:45 AM

What do you think about this variant? It prints information for all exits as debug output, but keeps optimization remarks basic.

reames accepted this revision.Jun 18 2021, 1:28 PM

LGTM

This revision is now accepted and ready to land.Jun 18 2021, 1:28 PM
This revision was landed with ongoing or failed builds.Jun 18 2021, 2:49 PM
This revision was automatically updated to reflect the committed changes.