[PATCH] D52932: [MCSched] Bind PFM Counters to the CPUs instead of the SchedModel.
Simon Pilgrim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 22 07:36:39 PDT 2018
RKSimon added reviewers: atrick, ab.
RKSimon added a comment.
> I don't think an `MCExtraProcessorInfo` should store information for several CPUs, because `MCExtraProcessorInfo` is in `MCSchedModel`, which is selected by CPU, so that would be weird.
You say that but we have multiple, very different, CPUs referencing the same model - Knights Landing uses the Haswell Model, the PileDriver model is likely to be used for the entire Bulldozer range, Sandy Bridge model is used as the default cpu - if you run llvm-exegesis in any of these cases apart for the 'main' cpu case it will just crash.
> Before this change, we were putting the `MCPfmCountersInfo` inside `MCSchedModel`, which implicitly meant that there was a 1:1 mapping between them. This change decouples `MCPfmCountersInfo` from `MCSchedModel`.
> A CPU chooses its SchedModel and PfmCounters independently.
>
> Now the decision we have to make now is whether in TD files (see point (2) in my comment above):
>
> - (A) the CPU should declare its PfmCounters (this is the approach I'm taking here). Because that's very similar to what is done for `MCSchedModel`s, I'm doing the same for PfmCounters, i.e. putting the table of Cpu->PfmCounter inside `TargetSubtargetInfo`, but that is actually independent from (see point (1) in my response to Andrea's comment above)
> - (B) the mapping of CPU->PfmCounter is kept separately (in `X86PfmCounters.td`).
(C) As the PFMs are only used by llvm-exegesis (and are likely to only every be) the PFM mappings should be moved entirely into llvm-exegesis code.
>> One of the aims for PR39165 was to make it possible for llvm-exegesis to be run on CPUs with declared PFMs but without a model - allowing a report on raw resource usage for an instruction and to help create the model from scratch. @courbet @gchatelet do you think this would still be useful?
>> Is it still an aim of llvm-exegesis to create models from scratch or just report on existing models?
>
> @lebedev.ri used llvm-exegesis to produce the bdverX model. At that point there was no SchedModel, so it still seems desirable to do this.
IIRC @lebedev.ri had to create a copy of the btver2 model and then slowly iterate on it until it matched the bdver arch.
Repository:
rL LLVM
https://reviews.llvm.org/D52932
More information about the llvm-commits
mailing list