Index: lib/Target/ARM/ARM.td =================================================================== --- lib/Target/ARM/ARM.td +++ lib/Target/ARM/ARM.td @@ -323,8 +323,9 @@ def FeatureUseMISched: SubtargetFeature<"use-misched", "UseMISched", "true", "Use the MachineScheduler">; -def FeaturePostRAScheduler : SubtargetFeature<"use-postra-scheduler", - "UsePostRAScheduler", "true", "Schedule again after register allocation">; +def FeatureNoPostRASched : SubtargetFeature<"disable-postra-scheduler", + "DisablePostRAScheduler", "true", + "Don't schedule again after register allocation">; //===----------------------------------------------------------------------===// // ARM architecture class @@ -829,7 +830,8 @@ FeatureSlowLoadDSubreg, FeatureSlowVGETLNi32, FeatureSlowVDUP32, - FeatureUseMISched]>; + FeatureUseMISched, + FeatureNoPostRASched]>; def : ProcessorModel<"cortex-r4", CortexA8Model, [ARMv7r, ProcR4, FeatureHasRetAddrStack, @@ -874,37 +876,33 @@ FeatureHasSlowFPVMLx, FeatureAvoidPartialCPSR]>; -def : ProcessorModel<"cortex-m3", CortexM3Model, [ARMv7m, - ProcM3, - FeatureHasNoBranchPredictor, - FeaturePostRAScheduler]>; +def : ProcessorModel<"cortex-m3", CortexM3Model, [ARMv7m, + ProcM3, + FeatureHasNoBranchPredictor]>; def : ProcessorModel<"sc300", CortexM3Model, [ARMv7m, ProcM3, FeatureHasNoBranchPredictor]>; -def : ProcessorModel<"cortex-m4", CortexM3Model, [ARMv7em, - FeatureVFP4, - FeatureVFPOnlySP, - FeatureD16, - FeatureHasNoBranchPredictor, - FeaturePostRAScheduler]>; +def : ProcessorModel<"cortex-m4", CortexM3Model, [ARMv7em, + FeatureVFP4, + FeatureVFPOnlySP, + FeatureD16, + FeatureHasNoBranchPredictor]>; -def : ProcNoItin<"cortex-m7", [ARMv7em, - FeatureFPARMv8, - FeatureD16, - FeaturePostRAScheduler]>; +def : ProcNoItin<"cortex-m7", [ARMv7em, + FeatureFPARMv8, + FeatureD16]>; def : ProcNoItin<"cortex-m23", [ARMv8mBaseline, FeatureNoMovt]>; -def : ProcessorModel<"cortex-m33", CortexM3Model, [ARMv8mMainline, - FeatureDSP, - FeatureFPARMv8, - FeatureD16, - FeatureVFPOnlySP, - FeatureHasNoBranchPredictor, - FeaturePostRAScheduler]>; +def : ProcessorModel<"cortex-m33", CortexM3Model, [ARMv8mMainline, + FeatureDSP, + FeatureFPARMv8, + FeatureD16, + FeatureVFPOnlySP, + FeatureHasNoBranchPredictor]>; def : ProcNoItin<"cortex-a32", [ARMv8a, FeatureHWDivThumb, @@ -968,7 +966,8 @@ FeatureHasSlowFPVMLx, FeatureCrypto, FeatureUseMISched, - FeatureZCZeroing]>; + FeatureZCZeroing, + FeatureNoPostRASched]>; def : ProcNoItin<"exynos-m1", [ARMv8a, ProcExynosM1, FeatureHWDivThumb, Index: lib/Target/ARM/ARMSubtarget.h =================================================================== --- lib/Target/ARM/ARMSubtarget.h +++ lib/Target/ARM/ARMSubtarget.h @@ -193,9 +193,9 @@ /// UseMISched - True if MachineScheduler should be used for this subtarget. bool UseMISched = false; - /// UsePostRAScheduler - True if scheduling should happen again after + /// DisablePostRAScheduler - False if scheduling should happen again after /// register allocation. - bool UsePostRAScheduler = false; + bool DisablePostRAScheduler = false; /// HasThumb2 - True if Thumb2 instructions are supported. bool HasThumb2 = false; @@ -666,7 +666,6 @@ 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; } Index: lib/Target/ARM/ARMSubtarget.cpp =================================================================== --- lib/Target/ARM/ARMSubtarget.cpp +++ lib/Target/ARM/ARMSubtarget.cpp @@ -359,15 +359,9 @@ // 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()) + if (DisablePostRAScheduler) return false; - return (!isThumb() || hasThumb2()); + return !isThumb1Only(); } bool ARMSubtarget::enableAtomicExpand() const { return hasAnyDataBarrier(); }