[llvm-commits] [llvm] r64255 - /llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp
Dan Gohman
gohman at apple.com
Tue Feb 10 15:29:38 PST 2009
Author: djg
Date: Tue Feb 10 17:29:38 2009
New Revision: 64255
URL: http://llvm.org/viewvc/llvm-project?rev=64255&view=rev
Log:
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.
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=64255&r1=64254&r2=64255&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp (original)
+++ llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp Tue Feb 10 17:29:38 2009
@@ -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 @@
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;
}
More information about the llvm-commits
mailing list