[llvm-commits] [llvm] r138037 - /llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.cpp
Kalle Raiskila
kalle.raiskila at nokia.com
Fri Aug 19 03:50:24 PDT 2011
Author: kraiskil
Date: Fri Aug 19 05:50:24 2011
New Revision: 138037
URL: http://llvm.org/viewvc/llvm-project?rev=138037&view=rev
Log:
Have SPU backend use the external TCE scheduler, if the library is loaded as a
module.
Patch by Pekka Jääskeläinen.
Modified:
llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.cpp
Modified: llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.cpp?rev=138037&r1=138036&r2=138037&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.cpp Fri Aug 19 05:50:24 2011
@@ -17,6 +17,7 @@
#include "llvm/CodeGen/RegAllocRegistry.h"
#include "llvm/CodeGen/SchedulerRegistry.h"
#include "llvm/Target/TargetRegistry.h"
+#include "llvm/Support/DynamicLibrary.h"
using namespace llvm;
@@ -59,6 +60,16 @@
bool SPUTargetMachine::
addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel)
{
+
+ // load the TCE instruction scheduler, if available via
+ // loaded plugins
+ typedef llvm::FunctionPass* (*BuilderFunc)(const char*);
+ BuilderFunc schedulerCreator =
+ (BuilderFunc)llvm::sys::DynamicLibrary::SearchForAddressOfSymbol(
+ "createTCESchedulerPass");
+ if (schedulerCreator != NULL)
+ PM.add(schedulerCreator("cellspu"));
+
//align instructions with nops/lnops for dual issue
PM.add(createSPUNopFillerPass(*this));
return true;
More information about the llvm-commits
mailing list