D35935 added an option for selecting the machine scheduler for ARM. This patch adds the option to allow also using the post ra scheduler, which brings the ARM backend inline with AArch64 targets. The SchedModel can also set 'PostRAScheduler', as the R52 does, so also query this property in the overridden function.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
I think this change makes sense and will be convenient when we move ARM codegen to the MachineScheduler. I just have a quick question about adding FeaturePostRAScheduler to some processors.
lib/Target/ARM/ARM.td | ||
---|---|---|
876 ↗ | (On Diff #111642) | What's the reason for adding FeaturePostRAScheduler to some processors but not others? It seems to be a nonfunctional change, because all changed processors seem to have FeatureThumb2, so enablePostRAScheduler would return true anyways. |
Please clarify the question about adding FeaturePostRAScheduler to some processors and maybe hold off a bit with committing, in case @t.p.northover has any comments
lib/Target/ARM/ARM.td | ||
---|---|---|
876 ↗ | (On Diff #111642) | I've added them to the processors that my team is currently tracking the performance of. If we want to develop some downstream schedulers and use the machine scheduler, it easily allows us to use post RA as well. Even though this can be defined in the SchedModel, I wanted to keep some consistency with your previous patch and the approach of AArch64. |
llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp | ||
---|---|---|
360–368 | We now have 3 different ways in which the PostRA scheduler could be enabled on ARM:
I think just one of those options (preferably the first) would be enough. |
Hi Matthias,
I agree that this would be nice, so I've had a play around it seems non-trivial to get a default configuration without breaking some tests. It is simple enough to predicate the PostRA scheduler on the availability of Thumb2 but this causes breakages for Swift. Do you know why we don't want to enable PostRA for MIScheduled arm cores? PostRA is used on almost all of the AArch64 cores along with the MIScheduler, so I'm wondering why the two approaches are different.
Thanks,
sam
- I would skip the check of the SchedModel; you should be able to set the subtarget feature on all CPUs using such a schedmodel instead.
- Similarily I thought it should be possible to check each CPU whether it uses the machine scheduler today or matches (!Thumb || Thumb2) and then add/remove the PostRA subtarget feature accordingly.
- AFAIK we disabled the post ra scheduler on Swift/Cyclone because the out of order execution hides instruction latencies in nearly all cases so spending time on the post-ra scheduler didn't seem like a good use of compiletime.
We now have 3 different ways in which the PostRA scheduler could be enabled on ARM:
I think just one of those options (preferably the first) would be enough.