summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/PostRASchedulerList.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-02-10 23:29:38 +0000
committerDan Gohman <gohman@apple.com>2009-02-10 23:29:38 +0000
commitb3dbb21df192bda7d03d944c8cf85727f6dca6ac (patch)
tree2771e46f380d7ade7dfd2708490f1a8661e7b13d /llvm/lib/CodeGen/PostRASchedulerList.cpp
parentb95434356c498d0b2ce2ac43e255392cdb88f0de (diff)
downloadbcm5719-llvm-b3dbb21df192bda7d03d944c8cf85727f6dca6ac.tar.gz
bcm5719-llvm-b3dbb21df192bda7d03d944c8cf85727f6dca6ac.zip
Consider any instruction that modifies the stack pointer to be
a scheduling region boundary. This isn't necessary for correctness; it helps with compile time, as it avoids the need for data- and anti-dependencies from all spills and reloads on the stack-pointer modification. llvm-svn: 64255
Diffstat (limited to 'llvm/lib/CodeGen/PostRASchedulerList.cpp')
-rw-r--r--llvm/lib/CodeGen/PostRASchedulerList.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/PostRASchedulerList.cpp b/llvm/lib/CodeGen/PostRASchedulerList.cpp
index 617b4ac1ec2..fd7135f3627 100644
--- a/llvm/lib/CodeGen/PostRASchedulerList.cpp
+++ b/llvm/lib/CodeGen/PostRASchedulerList.cpp
@@ -28,6 +28,7 @@
#include "llvm/CodeGen/MachineLoopInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/ScheduleHazardRecognizer.h"
+#include "llvm/Target/TargetLowering.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetRegisterInfo.h"
@@ -221,6 +222,15 @@ static bool isSchedulingBoundary(const MachineInstr *MI,
if (MI->getDesc().isTerminator() || MI->isLabel())
return true;
+ // Don't attempt to schedule around any instruction that modifies
+ // a stack-oriented pointer, as it's unlikely to be profitable. This
+ // saves compile time, because it doesn't require every single
+ // stack slot reference to depend on the instruction that does the
+ // modification.
+ const TargetLowering &TLI = *MF.getTarget().getTargetLowering();
+ if (MI->modifiesRegister(TLI.getStackPointerRegisterToSaveRestore()))
+ return true;
+
return false;
}
OpenPOWER on IntegriCloud