[llvm-branch-commits] [llvm-branch] r83130 - in /llvm/branches/Apple/Leela: include/llvm/Target/TargetSubtarget.h lib/CodeGen/LLVMTargetMachine.cpp lib/CodeGen/PostRASchedulerList.cpp lib/Target/ARM/ARM.td lib/Target/ARM/ARMSubtarget.cpp lib/Target/ARM/ARMSubtarget.h test/CodeGen/ARM/2009-08-21-PostRAKill.ll test/CodeGen/ARM/2009-08-21-PostRAKill2.ll test/CodeGen/ARM/2009-08-21-PostRAKill3.ll test/CodeGen/ARM/2009-08-21-PostRAKill4.ll test/CodeGen/ARM/2009-09-01-PostRAProlog.ll
Bob Wilson
bob.wilson at apple.com
Tue Sep 29 17:29:38 PDT 2009
Author: bwilson
Date: Tue Sep 29 19:29:38 2009
New Revision: 83130
URL: http://llvm.org/viewvc/llvm-project?rev=83130&view=rev
Log:
$ svn merge -c 83122 https://bwilson@llvm.org/svn/llvm-project/llvm/trunk
--- Merging r83122 into '.':
U test/CodeGen/ARM/2009-08-21-PostRAKill3.ll
U test/CodeGen/ARM/2009-08-21-PostRAKill4.ll
U test/CodeGen/ARM/2009-08-21-PostRAKill.ll
U test/CodeGen/ARM/2009-09-01-PostRAProlog.ll
U test/CodeGen/ARM/2009-08-21-PostRAKill2.ll
U include/llvm/Target/TargetSubtarget.h
U lib/Target/ARM/ARMSubtarget.cpp
U lib/Target/ARM/ARM.td
U lib/Target/ARM/ARMSubtarget.h
U lib/CodeGen/LLVMTargetMachine.cpp
U lib/CodeGen/PostRASchedulerList.cpp
Modified:
llvm/branches/Apple/Leela/include/llvm/Target/TargetSubtarget.h
llvm/branches/Apple/Leela/lib/CodeGen/LLVMTargetMachine.cpp
llvm/branches/Apple/Leela/lib/CodeGen/PostRASchedulerList.cpp
llvm/branches/Apple/Leela/lib/Target/ARM/ARM.td
llvm/branches/Apple/Leela/lib/Target/ARM/ARMSubtarget.cpp
llvm/branches/Apple/Leela/lib/Target/ARM/ARMSubtarget.h
llvm/branches/Apple/Leela/test/CodeGen/ARM/2009-08-21-PostRAKill.ll
llvm/branches/Apple/Leela/test/CodeGen/ARM/2009-08-21-PostRAKill2.ll
llvm/branches/Apple/Leela/test/CodeGen/ARM/2009-08-21-PostRAKill3.ll
llvm/branches/Apple/Leela/test/CodeGen/ARM/2009-08-21-PostRAKill4.ll
llvm/branches/Apple/Leela/test/CodeGen/ARM/2009-09-01-PostRAProlog.ll
Modified: llvm/branches/Apple/Leela/include/llvm/Target/TargetSubtarget.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Leela/include/llvm/Target/TargetSubtarget.h?rev=83130&r1=83129&r2=83130&view=diff
==============================================================================
--- llvm/branches/Apple/Leela/include/llvm/Target/TargetSubtarget.h (original)
+++ llvm/branches/Apple/Leela/include/llvm/Target/TargetSubtarget.h Tue Sep 29 19:29:38 2009
@@ -39,10 +39,14 @@
/// should be attempted.
virtual unsigned getSpecialAddressLatency() const { return 0; }
+ // enablePostRAScheduler - Return true to enable
+ // post-register-allocation scheduling.
+ virtual bool enablePostRAScheduler() const { return false; }
+
// adjustSchedDependency - Perform target specific adjustments to
// the latency of a schedule dependency.
virtual void adjustSchedDependency(SUnit *def, SUnit *use,
- SDep& dep) const { };
+ SDep& dep) const { }
};
} // End llvm namespace
Modified: llvm/branches/Apple/Leela/lib/CodeGen/LLVMTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Leela/lib/CodeGen/LLVMTargetMachine.cpp?rev=83130&r1=83129&r2=83130&view=diff
==============================================================================
--- llvm/branches/Apple/Leela/lib/CodeGen/LLVMTargetMachine.cpp (original)
+++ llvm/branches/Apple/Leela/lib/CodeGen/LLVMTargetMachine.cpp Tue Sep 29 19:29:38 2009
@@ -43,14 +43,6 @@
cl::desc("Verify generated machine code"),
cl::init(getenv("LLVM_VERIFY_MACHINEINSTRS")!=NULL));
-// This is not enabled by default due to 1) high compile time cost, 2) it's not
-// beneficial to all targets. The plan is to let targets decide whether this
-// is enabled.
-static cl::opt<bool>
-EnablePostRAScheduler("post-RA-scheduler",
- cl::desc("Enable scheduling after register allocation"),
- cl::init(false));
-
// Enable or disable FastISel. Both options are needed, because
// FastISel is enabled by default with -fast, and we wish to be
// able to enable or disable fast-isel independently from -O0.
@@ -321,7 +313,7 @@
printAndVerify(PM);
// Second pass scheduler.
- if (OptLevel != CodeGenOpt::None && EnablePostRAScheduler) {
+ if (OptLevel != CodeGenOpt::None) {
PM.add(createPostRAScheduler());
printAndVerify(PM);
}
Modified: llvm/branches/Apple/Leela/lib/CodeGen/PostRASchedulerList.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Leela/lib/CodeGen/PostRASchedulerList.cpp?rev=83130&r1=83129&r2=83130&view=diff
==============================================================================
--- llvm/branches/Apple/Leela/lib/CodeGen/PostRASchedulerList.cpp (original)
+++ llvm/branches/Apple/Leela/lib/CodeGen/PostRASchedulerList.cpp Tue Sep 29 19:29:38 2009
@@ -34,6 +34,7 @@
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetRegisterInfo.h"
+#include "llvm/Target/TargetSubtarget.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
@@ -209,6 +210,11 @@
}
bool PostRAScheduler::runOnMachineFunction(MachineFunction &Fn) {
+ // Check that post-RA scheduling is enabled for this function
+ const TargetSubtarget &ST = Fn.getTarget().getSubtarget<TargetSubtarget>();
+ if (!ST.enablePostRAScheduler())
+ return true;
+
DEBUG(errs() << "PostRAScheduler\n");
const MachineLoopInfo &MLI = getAnalysis<MachineLoopInfo>();
Modified: llvm/branches/Apple/Leela/lib/Target/ARM/ARM.td
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Leela/lib/Target/ARM/ARM.td?rev=83130&r1=83129&r2=83130&view=diff
==============================================================================
--- llvm/branches/Apple/Leela/lib/Target/ARM/ARM.td (original)
+++ llvm/branches/Apple/Leela/lib/Target/ARM/ARM.td Tue Sep 29 19:29:38 2009
@@ -43,6 +43,9 @@
def FeatureNEONFP : SubtargetFeature<"neonfp", "UseNEONForSinglePrecisionFP",
"true",
"Use NEON for single-precision FP">;
+def FeaturePostRASched : SubtargetFeature<"postrasched", "PostRAScheduler",
+ "true",
+ "Use Post-Register-Allocation Scheduler">;
//===----------------------------------------------------------------------===//
// ARM Processors supported.
@@ -105,7 +108,8 @@
// V7 Processors.
def : Processor<"cortex-a8", CortexA8Itineraries,
- [ArchV7A, FeatureThumb2, FeatureNEON, FeatureNEONFP]>;
+ [ArchV7A, FeatureThumb2, FeatureNEON, FeatureNEONFP,
+ FeaturePostRASched]>;
def : ProcNoItin<"cortex-a9", [ArchV7A, FeatureThumb2, FeatureNEON]>;
//===----------------------------------------------------------------------===//
Modified: llvm/branches/Apple/Leela/lib/Target/ARM/ARMSubtarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Leela/lib/Target/ARM/ARMSubtarget.cpp?rev=83130&r1=83129&r2=83130&view=diff
==============================================================================
--- llvm/branches/Apple/Leela/lib/Target/ARM/ARMSubtarget.cpp (original)
+++ llvm/branches/Apple/Leela/lib/Target/ARM/ARMSubtarget.cpp Tue Sep 29 19:29:38 2009
@@ -29,6 +29,7 @@
, UseNEONForSinglePrecisionFP(false)
, IsThumb(isThumb)
, ThumbMode(Thumb1)
+ , PostRAScheduler(false)
, IsR9Reserved(ReserveR9)
, stackAlignment(4)
, CPUString("generic")
Modified: llvm/branches/Apple/Leela/lib/Target/ARM/ARMSubtarget.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Leela/lib/Target/ARM/ARMSubtarget.h?rev=83130&r1=83129&r2=83130&view=diff
==============================================================================
--- llvm/branches/Apple/Leela/lib/Target/ARM/ARMSubtarget.h (original)
+++ llvm/branches/Apple/Leela/lib/Target/ARM/ARMSubtarget.h Tue Sep 29 19:29:38 2009
@@ -55,6 +55,9 @@
/// ThumbMode - Indicates supported Thumb version.
ThumbTypeEnum ThumbMode;
+ /// PostRAScheduler - True if using post-register-allocation scheduler.
+ bool PostRAScheduler;
+
/// IsR9Reserved - True if R9 is a not available as general purpose register.
bool IsR9Reserved;
@@ -122,6 +125,10 @@
bool isR9Reserved() const { return IsR9Reserved; }
const std::string & getCPUString() const { return CPUString; }
+
+ /// enablePostRAScheduler - From TargetSubtarget, return true to
+ /// enable post-RA scheduler.
+ bool enablePostRAScheduler() const { return PostRAScheduler; }
/// getInstrItins - Return the instruction itineraies based on subtarget
/// selection.
Modified: llvm/branches/Apple/Leela/test/CodeGen/ARM/2009-08-21-PostRAKill.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Leela/test/CodeGen/ARM/2009-08-21-PostRAKill.ll?rev=83130&r1=83129&r2=83130&view=diff
==============================================================================
--- llvm/branches/Apple/Leela/test/CodeGen/ARM/2009-08-21-PostRAKill.ll (original)
+++ llvm/branches/Apple/Leela/test/CodeGen/ARM/2009-08-21-PostRAKill.ll Tue Sep 29 19:29:38 2009
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=arm -mattr=+vfp2 -mcpu=cortex-a8 -post-RA-scheduler
+; RUN: llc < %s -march=arm -mattr=+vfp2,+postrasched -mcpu=cortex-a8
; ModuleID = '<stdin>'
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:64"
Modified: llvm/branches/Apple/Leela/test/CodeGen/ARM/2009-08-21-PostRAKill2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Leela/test/CodeGen/ARM/2009-08-21-PostRAKill2.ll?rev=83130&r1=83129&r2=83130&view=diff
==============================================================================
--- llvm/branches/Apple/Leela/test/CodeGen/ARM/2009-08-21-PostRAKill2.ll (original)
+++ llvm/branches/Apple/Leela/test/CodeGen/ARM/2009-08-21-PostRAKill2.ll Tue Sep 29 19:29:38 2009
@@ -1,4 +1,4 @@
-; RUN: llc < %s -asm-verbose=false -O3 -relocation-model=pic -disable-fp-elim -mtriple=thumbv7-apple-darwin -mcpu=cortex-a8 -post-RA-scheduler
+; RUN: llc < %s -asm-verbose=false -O3 -relocation-model=pic -disable-fp-elim -mtriple=thumbv7-apple-darwin -mcpu=cortex-a8 -mattr=+postrasched
; ModuleID = '<stdin>'
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:64"
Modified: llvm/branches/Apple/Leela/test/CodeGen/ARM/2009-08-21-PostRAKill3.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Leela/test/CodeGen/ARM/2009-08-21-PostRAKill3.ll?rev=83130&r1=83129&r2=83130&view=diff
==============================================================================
--- llvm/branches/Apple/Leela/test/CodeGen/ARM/2009-08-21-PostRAKill3.ll (original)
+++ llvm/branches/Apple/Leela/test/CodeGen/ARM/2009-08-21-PostRAKill3.ll Tue Sep 29 19:29:38 2009
@@ -1,4 +1,4 @@
-; RUN: llc < %s -asm-verbose=false -O3 -relocation-model=pic -disable-fp-elim -mtriple=thumbv7-apple-darwin -mcpu=cortex-a8 -post-RA-scheduler
+; RUN: llc < %s -asm-verbose=false -O3 -relocation-model=pic -disable-fp-elim -mtriple=thumbv7-apple-darwin -mcpu=cortex-a8 -mattr=+postrasched
; ModuleID = '<stdin>'
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:64"
Modified: llvm/branches/Apple/Leela/test/CodeGen/ARM/2009-08-21-PostRAKill4.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Leela/test/CodeGen/ARM/2009-08-21-PostRAKill4.ll?rev=83130&r1=83129&r2=83130&view=diff
==============================================================================
--- llvm/branches/Apple/Leela/test/CodeGen/ARM/2009-08-21-PostRAKill4.ll (original)
+++ llvm/branches/Apple/Leela/test/CodeGen/ARM/2009-08-21-PostRAKill4.ll Tue Sep 29 19:29:38 2009
@@ -1,4 +1,4 @@
-; RUN: llc < %s -asm-verbose=false -O3 -relocation-model=pic -disable-fp-elim -mtriple=thumbv7-apple-darwin -mcpu=cortex-a8 -post-RA-scheduler
+; RUN: llc < %s -asm-verbose=false -O3 -relocation-model=pic -disable-fp-elim -mtriple=thumbv7-apple-darwin -mcpu=cortex-a8 -mattr=+postrasched
; ModuleID = '<stdin>'
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:64"
Modified: llvm/branches/Apple/Leela/test/CodeGen/ARM/2009-09-01-PostRAProlog.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Leela/test/CodeGen/ARM/2009-09-01-PostRAProlog.ll?rev=83130&r1=83129&r2=83130&view=diff
==============================================================================
--- llvm/branches/Apple/Leela/test/CodeGen/ARM/2009-09-01-PostRAProlog.ll (original)
+++ llvm/branches/Apple/Leela/test/CodeGen/ARM/2009-09-01-PostRAProlog.ll Tue Sep 29 19:29:38 2009
@@ -1,5 +1,5 @@
; XFAIL: *
-; RUN: llvm-as < %s | llc -asm-verbose=false -O3 -relocation-model=pic -disable-fp-elim -mtriple=thumbv7-apple-darwin -mcpu=cortex-a8 -post-RA-scheduler | FileCheck %s
+; RUN: llvm-as < %s | llc -asm-verbose=false -O3 -relocation-model=pic -disable-fp-elim -mtriple=thumbv7-apple-darwin -mcpu=cortex-a8 -mattr=+postrasched | FileCheck %s
; ModuleID = '<stdin>'
More information about the llvm-branch-commits
mailing list