-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CodeGen][MachineScheduler][NFC]Update some comments of scheduler #74705
[CodeGen][MachineScheduler][NFC]Update some comments of scheduler #74705
Conversation
The member functions of ScheduleDAGMI are called back from PostMachineScheduler::runOnMachineFunction, instead of MachineScheduler::runOnMachineFunction.
/// enterRegion - Called back from MachineScheduler::runOnMachineFunction after | ||
/// crossing a scheduling boundary. [begin, end) includes all instructions in | ||
/// the region, including the boundary itself and single-instruction regions | ||
/// enterRegion - Called back from PostMachineScheduler::runOnMachineFunction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this true? I think both PostMachineScheduler
and MachineScheduler
call this.
Should it be MachineSchedulerBase::scheduleRegions
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MachineScheduler::runOnMachineFunction
andPostMachineScheduler::runOnMachineFunction
all call theMachineSchedulerBase::scheduleRegions
.- Then
MachineSchedulerBase::scheduleRegions
call theScheduler.enterRegion
andScheduler.schedule
. - The
Scheduler
inMachineSchedulerBase::scheduleRegions
is fromMachineScheduler::runOnMachineFunction
orPostMachineScheduler::runOnMachineFunction.
- When
Scheduler
is from theMachineScheduler::runOnMachineFunction
, it is return from theMachineScheduler::createMachineScheduler()
, which get a newScheduleDAGMILive
pointer from thePassConfig->createMachineScheduler(this)
orcreateGenericSchedLive
. Then theScheduler
isScheduleDAGMILive
, theScheduler.enterRegion
isScheduleDAGMILive.enterRegion
. So, we can say theScheduleDAGMILive::enterRegion
is called back fromMachineScheduler::runOnMachineFunction
. TheScheduleDAGMILive::schedule
is same as theScheduleDAGMILive::enterRegion
. - When
Scheduler
is from thePostMachineScheduler::runOnMachineFunction
, it is return from thePostMachineScheduler::createPostMachineScheduler()
, which get a newScheduleDAGMI
pointer from thePassConfig->createPostMachineScheduler(this)
orcreateGenericSchedPostRA
. Then theScheduler
isScheduleDAGMI
, theScheduler.enterRegion
isScheduleDAGMI.enterRegion
. So, we can say theScheduleDAGMI::enterRegion
is called back fromPostMachineScheduler::runOnMachineFunction
.TheScheduleDAGMI::schedule
is same as theScheduleDAGMI::enterRegion
. - I changed the two comments from
MachineScheduler::runOnMachineFunction
toPostMachineScheduler::runOnMachineFunction
is according the "5".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The convention for new code is "Don’t duplicate function or class name at the beginning of the comment." https://llvm.org/docs/CodingStandards.html#commenting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The convention for new code is "Don’t duplicate function or class name at the beginning of the comment." https://llvm.org/docs/CodingStandards.html#commenting
I think this is a fix for existed comments. :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The convention for new code is "Don’t duplicate function or class name at the beginning of the comment." https://llvm.org/docs/CodingStandards.html#commenting
This pr just fixs three existed comments.
There are many comments in the two files need to update, if follow the "Don’t duplicate function or class name at the beginning of the comment." Maybe need a new pr to update them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for the detailed explanation!
The member functions of ScheduleDAGMI are called back from PostMachineScheduler::runOnMachineFunction, instead of MachineScheduler::runOnMachineFunction.