Page MenuHomePhabricator

[NFC][PowerPC] Add the feature control for PreRA and PostRA scheduler
AbandonedPublic

Authored by steven.zhang on Jul 4 2019, 2:20 AM.

Details

Summary

We may need to disable the Pre-RA or Post-RA scheduler. Add the feature control for it.

Diff Detail

Event Timeline

steven.zhang created this revision.Jul 4 2019, 2:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 4 2019, 2:20 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
hfinkel accepted this revision.Jul 4 2019, 8:24 AM

We may need to disable the Pre-RA or Post-RA scheduler. Add the feature control for it.

Why? If this is just for debugging, then my thought is: We do have cl::opts that control this, and if we want this on a per-function basis, then this is not a ppc-specific problem and should introduce some target-independent attribute.

This revision is now accepted and ready to land.Jul 4 2019, 8:24 AM
hfinkel requested changes to this revision.Jul 4 2019, 8:27 AM

We may need to disable the Pre-RA or Post-RA scheduler. Add the feature control for it.

Why? If this is just for debugging, then my thought is: We do have cl::opts that control this, and if we want this on a per-function basis, then this is not a ppc-specific problem and should introduce some target-independent attribute.

(oops, I didn't really mean to mark this as accepted)

This revision now requires changes to proceed.Jul 4 2019, 8:27 AM
steven.zhang added a comment.EditedJul 4 2019, 7:09 PM

I am sorry that, I didn't put enough background for this change. The idea is not for per-function basis. We have the pre-ra scheduler and post-ra scheduler you know, and they should be able to be configured for different CPU processor. (Some cpu might need the post-ra scheduler, and some didn't, though we enable it for all cpus on PowerPC now) This is done by adding features and included by different cpu. And it also gives us the ability to turn on/off the specific scheduler.

jsji added a comment.Jul 4 2019, 7:41 PM

As Hal mentioned, enable-misched and enable-post-misched should be able to turn on/off the pre-ra/post-ra scheduler.
Regarding to different subtarget (cpu), why we need to turn on/off with feature at runtime? Shouldn't that be configured in code?

yeah, per function control might be more useful here.

As Hal mentioned, enable-misched and enable-post-misched should be able to turn on/off the pre-ra/post-ra scheduler.
Regarding to different subtarget (cpu), why we need to turn on/off with feature at runtime? Shouldn't that be configured in code?

yeah, per function control might be more useful here.

Ah, I didn't realize the option you mentioned, and yes, they can turn on/off the scheduler target independent for all cpu.
But if we want to turn on/off the scheduler for specific cpu, we have to add the feature for it. And the feature supports to be configured at runtime.

I am ok to abandon this patch as I have got the options to turn on/off the scheduler for PowerPC. However, I didn't see the harm to add this feature for PowerPC, as, it is the right way if we want to custom the scheduler for different cpu model. Any thoughts ?

As Hal mentioned, enable-misched and enable-post-misched should be able to turn on/off the pre-ra/post-ra scheduler.
Regarding to different subtarget (cpu), why we need to turn on/off with feature at runtime? Shouldn't that be configured in code?

yeah, per function control might be more useful here.

Ah, I didn't realize the option you mentioned, and yes, they can turn on/off the scheduler target independent for all cpu.
But if we want to turn on/off the scheduler for specific cpu, we have to add the feature for it. And the feature supports to be configured at runtime.

I am ok to abandon this patch as I have got the options to turn on/off the scheduler for PowerPC. However, I didn't see the harm to add this feature for PowerPC, as, it is the right way if we want to custom the scheduler for different cpu model. Any thoughts ?

I understand conventional wisdom is that post-RA scheduling is mostly useful for simpler cores, but at least as of the pwr8, it provided a noticeable performance enhancement even for the server-class cores as well. As a result, it seemed to benefit all PowerPC cores we had tested, and so we just had it on for nearly everything. Have you come across cores for which we want it off?

steven.zhang abandoned this revision.EditedJul 7 2019, 7:21 PM

No. I didn't have the requirement to custom cpu for the scheduler yet. I will abandon this patch and we can add the feature if we indeed find some cases that need it.