[llvm] r270077 - CodeGen: Move check of EnablePostRAScheduler to avoid disabling antidependency breaker
Mitch Bodart via llvm-commits
llvm-commits at lists.llvm.org
Thu May 19 09:40:51 PDT 2016
Author: mbodart
Date: Thu May 19 11:40:49 2016
New Revision: 270077
URL: http://llvm.org/viewvc/llvm-project?rev=270077&view=rev
Log:
CodeGen: Move check of EnablePostRAScheduler to avoid disabling antidependency breaker
Previously, specifying -post-RA-scheduler=true had the side effect of
disabling the antidependency breaker, yielding different behavior than
if the post-RA-scheduler was enabled via the scheduling model.
Differential Revision: http://reviews.llvm.org/D20186
Modified:
llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp
Modified: llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp?rev=270077&r1=270076&r2=270077&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp (original)
+++ llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp Thu May 19 11:40:49 2016
@@ -103,6 +103,7 @@ namespace {
bool runOnMachineFunction(MachineFunction &Fn) override;
+ private:
bool enablePostRAScheduler(
const TargetSubtargetInfo &ST, CodeGenOpt::Level OptLevel,
TargetSubtargetInfo::AntiDepBreakMode &Mode,
@@ -269,6 +270,11 @@ bool PostRAScheduler::enablePostRASchedu
TargetSubtargetInfo::RegClassVector &CriticalPathRCs) const {
Mode = ST.getAntiDepBreakMode();
ST.getCriticalPathRCs(CriticalPathRCs);
+
+ // Check for explicit enable/disable of post-ra scheduling.
+ if (EnablePostRAScheduler.getPosition() > 0)
+ return EnablePostRAScheduler;
+
return ST.enablePostRAScheduler() &&
OptLevel >= ST.getOptLevelToEnablePostRAScheduler();
}
@@ -284,20 +290,15 @@ bool PostRAScheduler::runOnMachineFuncti
RegClassInfo.runOnMachineFunction(Fn);
- // Check for explicit enable/disable of post-ra scheduling.
TargetSubtargetInfo::AntiDepBreakMode AntiDepMode =
TargetSubtargetInfo::ANTIDEP_NONE;
SmallVector<const TargetRegisterClass*, 4> CriticalPathRCs;
- if (EnablePostRAScheduler.getPosition() > 0) {
- if (!EnablePostRAScheduler)
- return false;
- } else {
- // Check that post-RA scheduling is enabled for this target.
- // This may upgrade the AntiDepMode.
- if (!enablePostRAScheduler(Fn.getSubtarget(), PassConfig->getOptLevel(),
- AntiDepMode, CriticalPathRCs))
- return false;
- }
+
+ // Check that post-RA scheduling is enabled for this target.
+ // This may upgrade the AntiDepMode.
+ if (!enablePostRAScheduler(Fn.getSubtarget(), PassConfig->getOptLevel(),
+ AntiDepMode, CriticalPathRCs))
+ return false;
// Check for antidep breaking override...
if (EnableAntiDepBreaking.getPosition() > 0) {
More information about the llvm-commits
mailing list