[llvm] r311162 - [ARM] Add PostRAScheduler option
Sam Parker via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 18 07:27:51 PDT 2017
Author: sam_parker
Date: Fri Aug 18 07:27:51 2017
New Revision: 311162
URL: http://llvm.org/viewvc/llvm-project?rev=311162&view=rev
Log:
[ARM] Add PostRAScheduler option
This patch adds the option to allow also using the PostRA 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.
Differential Revision: https://reviews.llvm.org/D36866
Modified:
llvm/trunk/lib/Target/ARM/ARM.td
llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp
llvm/trunk/lib/Target/ARM/ARMSubtarget.h
Modified: llvm/trunk/lib/Target/ARM/ARM.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARM.td?rev=311162&r1=311161&r2=311162&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARM.td (original)
+++ llvm/trunk/lib/Target/ARM/ARM.td Fri Aug 18 07:27:51 2017
@@ -323,6 +323,9 @@ def FeatureNoNegativeImmediates
def FeatureUseMISched: SubtargetFeature<"use-misched", "UseMISched", "true",
"Use the MachineScheduler">;
+def FeaturePostRAScheduler : SubtargetFeature<"use-postra-scheduler",
+ "UsePostRAScheduler", "true", "Schedule again after register allocation">;
+
//===----------------------------------------------------------------------===//
// ARM architecture class
//
@@ -869,7 +872,8 @@ def : ProcessorModel<"cortex-r8", Cort
def : ProcessorModel<"cortex-m3", CortexM3Model, [ARMv7m,
ProcM3,
- FeatureHasNoBranchPredictor]>;
+ FeatureHasNoBranchPredictor,
+ FeaturePostRAScheduler]>;
def : ProcessorModel<"sc300", CortexM3Model, [ARMv7m,
ProcM3,
@@ -879,11 +883,13 @@ def : ProcessorModel<"cortex-m4", Cortex
FeatureVFP4,
FeatureVFPOnlySP,
FeatureD16,
- FeatureHasNoBranchPredictor]>;
+ FeatureHasNoBranchPredictor,
+ FeaturePostRAScheduler]>;
def : ProcNoItin<"cortex-m7", [ARMv7em,
FeatureFPARMv8,
- FeatureD16]>;
+ FeatureD16,
+ FeaturePostRAScheduler]>;
def : ProcNoItin<"cortex-m23", [ARMv8mBaseline,
FeatureNoMovt]>;
@@ -893,7 +899,8 @@ def : ProcessorModel<"cortex-m33", Corte
FeatureFPARMv8,
FeatureD16,
FeatureVFPOnlySP,
- FeatureHasNoBranchPredictor]>;
+ FeatureHasNoBranchPredictor,
+ FeaturePostRAScheduler]>;
def : ProcNoItin<"cortex-a32", [ARMv8a,
FeatureHWDivThumb,
Modified: llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp?rev=311162&r1=311161&r2=311162&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp Fri Aug 18 07:27:51 2017
@@ -357,6 +357,10 @@ bool ARMSubtarget::enableMachineSchedule
// This overrides the PostRAScheduler bit in the SchedModel for any CPU.
bool ARMSubtarget::enablePostRAScheduler() const {
+ if (usePostRAScheduler())
+ return true;
+ if (SchedModel.PostRAScheduler)
+ return true;
// No need for PostRA scheduling on subtargets where we use the
// MachineScheduler.
if (useMachineScheduler())
Modified: llvm/trunk/lib/Target/ARM/ARMSubtarget.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMSubtarget.h?rev=311162&r1=311161&r2=311162&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMSubtarget.h (original)
+++ llvm/trunk/lib/Target/ARM/ARMSubtarget.h Fri Aug 18 07:27:51 2017
@@ -191,6 +191,10 @@ protected:
/// UseMISched - True if MachineScheduler should be used for this subtarget.
bool UseMISched = false;
+ /// UsePostRAScheduler - True if scheduling should happen again after
+ /// register allocation.
+ bool UsePostRAScheduler = false;
+
/// HasThumb2 - True if Thumb2 instructions are supported.
bool HasThumb2 = false;
@@ -660,6 +664,7 @@ public:
bool isRWPI() const;
bool useMachineScheduler() const { return UseMISched; }
+ bool usePostRAScheduler() const { return UsePostRAScheduler; }
bool useSoftFloat() const { return UseSoftFloat; }
bool isThumb() const { return InThumbMode; }
bool isThumb1Only() const { return InThumbMode && !HasThumb2; }
More information about the llvm-commits
mailing list