This is an archive of the discontinued LLVM Phabricator instance.

[llvm-mca] Update the comments for the mca:::Stage class. NFC.
AbandonedPublic

Authored by mattd on Aug 14 2018, 4:25 PM.

Details

Reviewers
andreadb
Summary
  • Updated to reflect the recent changes to the mca::Status return value for Stage::execute.
  • Updated to be clearer (e.g., use the word 'processing' in place of 'execute' where it makes sense).

Diff Detail

Event Timeline

mattd created this revision.Aug 14 2018, 4:25 PM

Hi Matt,

Thanks for this patch. See my comments below.

Thanks
-Andrea

tools/llvm-mca/Stage.h
33

here "primary action" is repeated in the same sentence.

75

s/the clock cycle/this cycle

93–94

This is what I find particularly difficult to read. Maybe you should explain this part a bit better.
Basically, 'execute' is _only_ called on instructions that have been added to the pipeline in the current cycle.

Also (surprisingly) method 'execute' is called on every stage of the pipeline. We shouldn't be calling it if we know that a new instruction hasn't been moved to the next stage during this cycle. At the moment, it is called on every stage of the pipeline regardless of whether the new instruction has successfully transitioned to the next stage.
I find this design a bit awkward and hard to follow. We should revisit this design soon as this doesn't feel right.

"Stop" means:

  • this stage cannot process any more instructions during this cycle.

There may be several reasons why a Stage returns "Stop". The most common case is: "this stage has run out of resources, so it cannot accept new instructions during this cycle".

Add an example:

(example: there is a limit to how many instructions can be dispatched to the schedulers every cycle. Basically, the dispatch throughput cannot be infinite, and there is a constraint on the maximum size of a dispatch group. At some point, the DispatchStage has to "stop").

"Continue" means: this stage has still resources to "execute" instruction during this same cycle. Unfortunately, it doesn't say if the instruction was successfully processed! So, this may be a bit misleading. Also, it doesn't say if the instruction is allowed to transition to the next stage. If we don't change this design, then we should early-exit from the loop (it makes no sense to call execute(IR) on a next stage, if IR is still stuck on a previous stage!).

mattd abandoned this revision.Aug 29 2018, 7:50 AM

Abandoning this change, it is outdated.