This is an archive of the discontinued LLVM Phabricator instance.

[Pipeliner] Fixed optimization remarks and debug dumps Initiation Interval value
ClosedPublic

Authored by mamai on Jan 29 2021, 11:45 AM.

Details

Summary

The II value is incremented before exiting the loop, and therefor when used in the optimization remarks and debug dumps it did not reflect the initiation interval actually used in Schedule.

Diff Detail

Event Timeline

mamai created this revision.Jan 29 2021, 11:45 AM
mamai requested review of this revision.Jan 29 2021, 11:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 29 2021, 11:45 AM

Hi Marianne,

Thanks for the patch. Sorry that it took a while to get to this. I just have a couple of questions.

Thanks,
Brendon

llvm/lib/CodeGen/MachinePipeliner.cpp
2125

Does this need to be decremented only if scheduledFound is true?

Another possibility is to use Schedule.getInitiationInterval() instead of II in the subsequent debug and remark messages.

mamai added inline comments.Feb 10 2021, 6:44 AM
llvm/lib/CodeGen/MachinePipeliner.cpp
2125

In fact, I am not sure what is the point to print the II when the schedule is not found. But, I think it is valid to decrement all the time, since the ++ is done right before exiting the loop, no matter if the schedule is found or not. It will represent the last II that was actually tried.

I thought of using a getInitiationInterval() function, but it doesn't exist. It was more simple to decrement the counter than to create a new getter function.

bcahoon accepted this revision.Feb 14 2021, 6:44 PM
bcahoon added inline comments.
llvm/lib/CodeGen/MachinePipeliner.cpp
2125

You're correct - it is valid to always decrement. I still think it better to add and use a getInitiationInterval() function, and then change the scope of II so that it is limited to the loop. But, it's more important that the correct valid is printed, so either approach is an improvment.

This revision is now accepted and ready to land.Feb 14 2021, 6:44 PM
mamai updated this revision to Diff 324069.Feb 16 2021, 11:46 AM

Updated patch with the cleaner approach of creating a getInitiationInterval() function.

mamai requested review of this revision.Feb 16 2021, 12:05 PM
bcahoon accepted this revision.Feb 16 2021, 12:15 PM

Thanks for fixing this!

This revision is now accepted and ready to land.Feb 16 2021, 12:15 PM