[llvm-commits] [poolalloc] r103518 - in /poolalloc/trunk: ./ include/poolalloc/ lib/AssistDS/ lib/DSA/ lib/Macroscopic/ lib/PoolAllocate/ lib/rDSA/ runtime/FL2Allocator/ runtime/FreeListAllocator/ runtime/HeapFrag/ runtime/PoolAllocator/ runtime/PreRT/ test/
John Criswell
criswell at uiuc.edu
Tue May 11 14:50:08 PDT 2010
Author: criswell
Date: Tue May 11 16:50:07 2010
New Revision: 103518
URL: http://llvm.org/viewvc/llvm-project?rev=103518&view=rev
Log:
Merged in the release_26 branch. This brings in fixes that I've made in the
LLVM 2.6 version as well as enhancements made by Patrick.
Added:
poolalloc/trunk/lib/rDSA/
- copied from r103512, poolalloc/branches/release_26/lib/rDSA/
poolalloc/trunk/lib/rDSA/BottomUpClosure.cpp
- copied unchanged from r103512, poolalloc/branches/release_26/lib/rDSA/BottomUpClosure.cpp
poolalloc/trunk/lib/rDSA/CMakeLists.txt
- copied unchanged from r103512, poolalloc/branches/release_26/lib/rDSA/CMakeLists.txt
poolalloc/trunk/lib/rDSA/CompleteBottomUp.cpp
- copied unchanged from r103512, poolalloc/branches/release_26/lib/rDSA/CompleteBottomUp.cpp
poolalloc/trunk/lib/rDSA/DataStructure.cpp
- copied unchanged from r103512, poolalloc/branches/release_26/lib/rDSA/DataStructure.cpp
poolalloc/trunk/lib/rDSA/DataStructureAA.cpp
- copied unchanged from r103512, poolalloc/branches/release_26/lib/rDSA/DataStructureAA.cpp
poolalloc/trunk/lib/rDSA/DataStructureOpt.cpp
- copied unchanged from r103512, poolalloc/branches/release_26/lib/rDSA/DataStructureOpt.cpp
poolalloc/trunk/lib/rDSA/DataStructureStats.cpp
- copied unchanged from r103512, poolalloc/branches/release_26/lib/rDSA/DataStructureStats.cpp
poolalloc/trunk/lib/rDSA/EquivClassGraphs.cpp
- copied unchanged from r103512, poolalloc/branches/release_26/lib/rDSA/EquivClassGraphs.cpp
poolalloc/trunk/lib/rDSA/GraphChecker.cpp
- copied unchanged from r103512, poolalloc/branches/release_26/lib/rDSA/GraphChecker.cpp
poolalloc/trunk/lib/rDSA/Local.cpp
- copied unchanged from r103512, poolalloc/branches/release_26/lib/rDSA/Local.cpp
poolalloc/trunk/lib/rDSA/Makefile
- copied unchanged from r103512, poolalloc/branches/release_26/lib/rDSA/Makefile
poolalloc/trunk/lib/rDSA/Printer.cpp
- copied unchanged from r103512, poolalloc/branches/release_26/lib/rDSA/Printer.cpp
poolalloc/trunk/lib/rDSA/StdLibPass.cpp
- copied unchanged from r103512, poolalloc/branches/release_26/lib/rDSA/StdLibPass.cpp
poolalloc/trunk/lib/rDSA/Steensgaard.cpp
- copied unchanged from r103512, poolalloc/branches/release_26/lib/rDSA/Steensgaard.cpp
poolalloc/trunk/lib/rDSA/SteensgaardAA.cpp
- copied unchanged from r103512, poolalloc/branches/release_26/lib/rDSA/SteensgaardAA.cpp
poolalloc/trunk/lib/rDSA/TopDownClosure.cpp
- copied unchanged from r103512, poolalloc/branches/release_26/lib/rDSA/TopDownClosure.cpp
Modified:
poolalloc/trunk/ (props changed)
poolalloc/trunk/include/poolalloc/PoolAllocate.h
poolalloc/trunk/lib/AssistDS/Makefile
poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp
poolalloc/trunk/lib/DSA/Makefile
poolalloc/trunk/lib/Macroscopic/Makefile
poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp
poolalloc/trunk/lib/PoolAllocate/Makefile
poolalloc/trunk/lib/PoolAllocate/PASimple.cpp
poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp
poolalloc/trunk/lib/PoolAllocate/PoolOptimize.cpp
poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp
poolalloc/trunk/runtime/FL2Allocator/CMakeLists.txt
poolalloc/trunk/runtime/FL2Allocator/Makefile
poolalloc/trunk/runtime/FL2Allocator/PoolAllocator.cpp
poolalloc/trunk/runtime/FL2Allocator/PoolAllocator.h
poolalloc/trunk/runtime/FreeListAllocator/Makefile
poolalloc/trunk/runtime/HeapFrag/Makefile
poolalloc/trunk/runtime/PoolAllocator/Makefile
poolalloc/trunk/runtime/PreRT/Makefile
poolalloc/trunk/test/Makefile
poolalloc/trunk/test/TEST.poolalloc.Makefile
Propchange: poolalloc/trunk/
------------------------------------------------------------------------------
svn:mergeinfo = /poolalloc/branches/release_26:97820-103512
Modified: poolalloc/trunk/include/poolalloc/PoolAllocate.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/poolalloc/PoolAllocate.h?rev=103518&r1=103517&r2=103518&view=diff
==============================================================================
--- poolalloc/trunk/include/poolalloc/PoolAllocate.h (original)
+++ poolalloc/trunk/include/poolalloc/PoolAllocate.h Tue May 11 16:50:07 2010
@@ -54,7 +54,7 @@
/// maps to the original function...
///
struct FuncInfo {
- FuncInfo(Function &f) : F(f), Clone(0) {}
+ FuncInfo(Function &f) : F(f), Clone(0), rev_pool_desc_map_computed(false) {}
/// MarkedNodes - The set of nodes which are not locally pool allocatable in
/// the current function.
@@ -83,6 +83,23 @@
/// function.
std::map<const DSNode*, Value*> PoolDescriptors;
+ //Reverse mapping for PoolDescriptors, needed by TPPA
+ std::map<Value*, const DSNode*> ReversePoolDescriptors;
+
+ //This is a hack -- a function should be added which maintains these in parallel
+ //and all of PoolAlloc and SafeCode should be updated to use it instead of adding
+ //to either map directly.
+ bool rev_pool_desc_map_computed;
+ void calculate_reverse_pool_descriptors()
+ {
+ if(rev_pool_desc_map_computed)
+ return;
+ rev_pool_desc_map_computed = true;
+
+ for(std::map<const DSNode*, Value*>::iterator i = PoolDescriptors.begin(); i!=PoolDescriptors.end(); i++)
+ ReversePoolDescriptors[i->second] = i->first;
+ }
+
/// This is a map from Old to New Values (the reverse of NewToOldValueMap).
/// SAFECode uses this for check insertion.
std::map<const Value*, Value*> ValueMap;
@@ -147,6 +164,7 @@
return Graphs->getGlobalsGraph ();
}
+ /* Return value is of type PoolDescPtrTy */
virtual Value * getPool (const DSNode * N, Function & F) {return 0;}
virtual Value * getGlobalPool (const DSNode * Node) {return 0;}
@@ -168,7 +186,7 @@
std::map<const Function*, Function*> CloneToOrigMap;
public:
- Constant *PoolInit, *PoolDestroy, *PoolAlloc, *PoolRealloc, *PoolMemAlign;
+ Constant *PoolInit, *PoolDestroy, *PoolAlloc, *PoolRealloc, *PoolMemAlign, *PoolThreadWrapper;
Constant *PoolFree;
Constant *PoolCalloc;
Constant *PoolStrdup;
@@ -354,10 +372,10 @@
}
//
- // We either do not have a pool, or the pool is not accessible from the
- // specified function. Return NULL.
+ // Perhaps this is a global pool. If it isn't, then return a NULL
+ // pointer.
//
- return 0;
+ return getGlobalPool (N);
}
virtual Value * getGlobalPool (const DSNode * Node) {
Modified: poolalloc/trunk/lib/AssistDS/Makefile
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/Makefile?rev=103518&r1=103517&r2=103518&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/Makefile (original)
+++ poolalloc/trunk/lib/AssistDS/Makefile Tue May 11 16:50:07 2010
@@ -8,7 +8,11 @@
##===----------------------------------------------------------------------===##
LEVEL = ../..
+ifneq ($(OS),Cygwin)
+ifneq ($(OS),MingW)
SHARED_LIBRARY=1
+endif
+endif
LIBRARYNAME = AssistDS
include $(LEVEL)/Makefile.common
Modified: poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp?rev=103518&r1=103517&r2=103518&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp (original)
+++ poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp Tue May 11 16:50:07 2010
@@ -64,6 +64,8 @@
for (EquivalenceClasses<const GlobalValue*>::member_iterator MI = GlobalECs.member_begin(EQSI);
MI != GlobalECs.member_end(); ++MI) {
if (const Function* F = dyn_cast<Function>(*MI)) {
+ if(F->isDeclaration()) //ignore functions with no body
+ continue;
if (!BaseGraph) {
BaseGraph = getOrCreateGraph(F);
BaseGraph->getFunctionArgumentsForCall(F, Args);
Modified: poolalloc/trunk/lib/DSA/Makefile
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Makefile?rev=103518&r1=103517&r2=103518&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/Makefile (original)
+++ poolalloc/trunk/lib/DSA/Makefile Tue May 11 16:50:07 2010
@@ -10,8 +10,12 @@
LEVEL = ../..
LIBRARYNAME = LLVMDataStructure
BUILD_ARCHIVE := 1
+ifneq ($(OS),Cygwin)
+ifneq ($(OS),MingW)
SHARED_LIBRARY := 1
#LOADABLE_MODULE := 1
+endif
+endif
include $(LEVEL)/Makefile.common
Modified: poolalloc/trunk/lib/Macroscopic/Makefile
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/Macroscopic/Makefile?rev=103518&r1=103517&r2=103518&view=diff
==============================================================================
--- poolalloc/trunk/lib/Macroscopic/Makefile (original)
+++ poolalloc/trunk/lib/Macroscopic/Makefile Tue May 11 16:50:07 2010
@@ -2,8 +2,12 @@
LEVEL=../..
# Give the name of a library. This will build a dynamic version.
+ifneq ($(OS),Cygwin)
+ifneq ($(OS),MingW)
SHARED_LIBRARY=1
LOADABLE_MODULE = 1
+endif
+endif
DONT_BUILD_RELINKED=1
LIBRARYNAME=macroscopic
Modified: poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp?rev=103518&r1=103517&r2=103518&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp Tue May 11 16:50:07 2010
@@ -122,15 +122,31 @@
/// DSNode.
///
unsigned Heuristic::getRecommendedAlignment(const DSNode *N) {
- //FIXME: Type
- //if (!N->getType() || N->getType()->isVoidTy()) // Is this void or collapsed?
- return 0; // No known alignment, let runtime decide.
+#if 0
+ const Type * VoidType = Type::getVoidTy(getGlobalContext());
+
+ //
+ // If this node has a void type (which can be signified by getType()
+ // returning NULL) or the node is collapsed, then there is no known
+ // alignment. We will return 0 to let the runtime decide.
+ //
+ if ((!(N->getType())) || (N->getType() == VoidType))
+ return 0;
- //const TargetData &TD = N->getParentGraph()->getTargetData();
+ const TargetData &TD = N->getParentGraph()->getTargetData();
// If there are no doubles on an 8-byte boundary in this structure, there is
// no reason to 8-byte align objects in the pool.
- //return Wants8ByteAlignment(N->getType(), 0, TD) ? 8 : 4;
+ return Wants8ByteAlignment(N->getType(), 0, TD) ? 8 : 4;
+#else
+ //
+ // I believe there was a FIXME in the previous version of this code, but it
+ // was too vague for me to understand what, exactly, needed to be fixed.
+ //
+ // In any event, it seems that this code should be deactivated for now.
+ //
+ return 0;
+#endif
}
@@ -455,7 +471,7 @@
if (!NullGlobal) {
Module *M = I->getParent()->getParent()->getParent();
const Type * PoolTy = PoolAllocate::PoolDescPtrTy;
- Constant * Init = ConstantAggregateZero::get(PoolTy);
+ Constant * Init = ConstantPointerNull::get(cast<PointerType>(PoolTy));
NullGlobal = new GlobalVariable(*M,
PoolAllocate::PoolDescPtrTy, false,
GlobalValue::ExternalLinkage,
Modified: poolalloc/trunk/lib/PoolAllocate/Makefile
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/Makefile?rev=103518&r1=103517&r2=103518&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/Makefile (original)
+++ poolalloc/trunk/lib/PoolAllocate/Makefile Tue May 11 16:50:07 2010
@@ -8,8 +8,12 @@
#
LIBRARYNAME=poolalloc
BUILD_ARCHIVE := 1
+ifneq ($(OS),Cygwin)
+ifneq ($(OS),MingW)
SHARED_LIBRARY := 1
#LOADABLE_MODULE := 1
+endif
+endif
#
# Include Makefile.common so we know what to do.
Modified: poolalloc/trunk/lib/PoolAllocate/PASimple.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PASimple.cpp?rev=103518&r1=103517&r2=103518&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/PASimple.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/PASimple.cpp Tue May 11 16:50:07 2010
@@ -142,11 +142,20 @@
TheGlobalPool = CreateGlobalPool(32, 1, M);
//
- // Now that all call targets are available, rewrite the function bodies of the
- // clones.
+ // Now that all call targets are available, rewrite the function bodies of
+ // the clones.
+ //
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) {
+ //
+ // Skip functions that this pass added.
+ //
std::string name = I->getName();
if (name == "__poolalloc_init") continue;
+ if (name == PoolInit->getNameStr()) continue;
+
+ //
+ // Skip declarations.
+ //
if (!(I->isDeclaration()))
ProcessFunctionBodySimple(*I, TD);
}
@@ -226,6 +235,11 @@
Name,
InsertPt);
+ //
+ // Update the DSGraph.
+ //
+ CombinedDSGraph->getScalarMap().replaceScalar (CI, V);
+
Instruction *Casted = V;
if (V->getType() != CI->getType())
Casted = CastInst::CreatePointerCast (V, CI->getType(), V->getName(), InsertPt);
@@ -267,6 +281,11 @@
Opts + 3,
Name,
InsertPt);
+ //
+ // Update the DSGraph.
+ //
+ CombinedDSGraph->getScalarMap().replaceScalar (CI, V);
+
Instruction *Casted = V;
if (V->getType() != CI->getType())
Casted = CastInst::CreatePointerCast (V, CI->getType(), V->getName(), InsertPt);
@@ -309,6 +328,11 @@
Name,
InsertPt);
+ //
+ // Update the DSGraph.
+ //
+ CombinedDSGraph->getScalarMap().replaceScalar (CI, V);
+
Instruction *Casted = V;
if (V->getType() != CI->getType())
Casted = CastInst::CreatePointerCast (V, CI->getType(), V->getName(), InsertPt);
@@ -342,6 +366,12 @@
Opts + 2,
Name,
InsertPt);
+
+ //
+ // Update the DSGraph.
+ //
+ CombinedDSGraph->getScalarMap().replaceScalar (CI, V);
+
Instruction *Casted = V;
if (V->getType() != CI->getType())
Casted = CastInst::CreatePointerCast (V, CI->getType(), V->getName(), InsertPt);
@@ -373,6 +403,17 @@
PoolAllocateSimple::CreateGlobalPool (unsigned RecSize,
unsigned Align,
Module& M) {
+ //
+ // Give poolinit() a dummy body. A later transform will remove the dummy
+ // body.
+ //
+ if (SAFECodeEnabled) {
+ LLVMContext & Context = M.getContext();
+ Function * PoolInitFunc = dyn_cast<Function>(PoolInit);
+ BasicBlock * entryBB = BasicBlock::Create (Context, "entry", PoolInitFunc);
+ ReturnInst::Create (Context, entryBB);
+ }
+
GlobalVariable *GV =
new GlobalVariable(M,
getPoolType(&M.getContext()), false, GlobalValue::ExternalLinkage,
Modified: poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp?rev=103518&r1=103517&r2=103518&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Tue May 11 16:50:07 2010
@@ -268,6 +268,18 @@
//Get the poolregister function
PoolRegister = M->getOrInsertFunction("poolregister", VoidType,
PoolDescPtrTy, VoidPtrTy, Int32Type, NULL);
+
+ Function* pthread_create_func = M->getFunction("pthread_create");
+ if(pthread_create_func)
+ {
+ Function::arg_iterator i = pthread_create_func->arg_begin();
+ std::vector<const Type*> non_vararg_params;
+ non_vararg_params.push_back(i++->getType());
+ non_vararg_params.push_back(i++->getType());
+ non_vararg_params.push_back(i++->getType());
+ non_vararg_params.push_back(Int32Type);
+ PoolThreadWrapper = M->getOrInsertFunction("poolalloc_pthread_create",FunctionType::get(Int32Type,non_vararg_params,true));
+ }
}
static void getCallsOf(Constant *C, std::vector<CallInst*> &Calls) {
@@ -733,7 +745,8 @@
for (DSGraph::node_iterator I = G->node_begin(), E = G->node_end(); I != E;++I){
// We only need to make a pool if there is a heap object in it...
DSNode *N = I;
- if ((N->isHeapNode()) || (BoundsChecksEnabled && (N->isArrayNode()))) {
+ if ((N->isHeapNode()) || (BoundsChecksEnabled && (N->isArrayNode())) ||
+ GlobalsGraphNodeMapping.count(N) && GlobalsGraphNodeMapping[N].getNode()->isHeapNode()) {
if (GlobalsGraphNodeMapping.count(N)) {
// If it is a global pool, set up the pool descriptor appropriately.
DSNode *GGN = GlobalsGraphNodeMapping[N].getNode();
Modified: poolalloc/trunk/lib/PoolAllocate/PoolOptimize.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PoolOptimize.cpp?rev=103518&r1=103517&r2=103518&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/PoolOptimize.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/PoolOptimize.cpp Tue May 11 16:50:07 2010
@@ -32,7 +32,7 @@
static char ID;
bool SAFECodeEnabled;
- PoolOptimize(bool SAFECode = false) : ModulePass((intptr_t)&ID) {
+ PoolOptimize(bool SAFECode = true) : ModulePass((intptr_t)&ID) {
SAFECodeEnabled = SAFECode;
}
bool runOnModule(Module &M);
@@ -72,7 +72,7 @@
const Type *VoidPtrTy = PointerType::getUnqual(Int8Type);
const Type *PoolDescPtrTy;
if (SAFECodeEnabled)
- PoolDescPtrTy = PointerType::getUnqual(ArrayType::get(VoidPtrTy, 50));
+ PoolDescPtrTy = PointerType::getUnqual(ArrayType::get(VoidPtrTy, 92));
else
PoolDescPtrTy = PointerType::getUnqual(ArrayType::get(VoidPtrTy, 16));
Modified: poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp?rev=103518&r1=103517&r2=103518&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Tue May 11 16:50:07 2010
@@ -266,34 +266,15 @@
#endif
void FuncTransform::visitAllocaInst(AllocaInst &MI) {
- // Don't do anything if bounds checking will not be done by SAFECode later.
- if (!(PAInfo.BoundsChecksEnabled)) return;
-
- // Get the pool handle for the node that this contributes to...
- DSNode *Node = getDSNodeHFor(&MI).getNode();
- if (Node->isArrayNode()) {
- Value *PH = getPoolHandle(&MI);
- if (PH == 0 || isa<ConstantPointerNull>(PH)) return;
- TargetData &TD = PAInfo.getAnalysis<TargetData>();
- Value *AllocSize = ConstantInt::get(Type::getInt32Ty(MI.getContext()), TD.getTypeAllocSize(MI.getAllocatedType()));
-
- if (MI.isArrayAllocation())
- AllocSize = BinaryOperator::Create(Instruction::Mul, AllocSize,
- MI.getOperand(0), "sizetmp", &MI);
-
- // TransformAllocationInstr(&MI, AllocSize);
- BasicBlock::iterator InsertPt(MI);
- ++InsertPt;
- Instruction *Casted = CastInst::CreatePointerCast(&MI, PointerType::getUnqual(Type::getInt8Ty(MI.getContext())),
- MI.getName()+".casted", InsertPt);
- std::vector<Value *> args;
- args.push_back (PH);
- args.push_back (Casted);
- args.push_back (AllocSize);
- Instruction *V = CallInst::Create(PAInfo.PoolRegister,
- args.begin(), args.end(), "", InsertPt);
- AddPoolUse(*V, PH, PoolUses);
- }
+ //
+ // SAFECode will register alloca instructions with the run-time, so do not
+ // do that here.
+ //
+ // FIXME:
+ // There is a chance that we may need to update PoolUses to make sure that
+ // the pool handle is available in this function.
+ //
+ return;
}
@@ -563,6 +544,7 @@
void FuncTransform::visitCallSite(CallSite& CS) {
const Function *CF = CS.getCalledFunction();
Instruction *TheCall = CS.getInstruction();
+ bool thread_creation_point = false;
const Type* Int32Type = Type::getInt32Ty(CS.getInstruction()->getContext());
@@ -604,6 +586,21 @@
} else if (CF->getName() == "valloc") {
errs() << "VALLOC USED BUT NOT HANDLED!\n";
abort();
+ } else if (CF->getName() == "pthread_create") {
+ thread_creation_point = true;
+ //Get DSNode representing the void* passed to the callee
+ DSNodeHandle passed_dsnode_handle = G->getNodeForValue(CS.getArgument(3));
+
+ //Get DSNode representing the DSNode of the function pointer Value of the pthread_create call
+ DSNode* thread_callee_node = G->getNodeForValue(CS.getArgument(2)).getNode();
+ if(!thread_callee_node)
+ {
+ FuncInfo *CFI = PAInfo.getFuncInfo(*CF);
+ thread_callee_node = G->getNodeForValue(CFI->MapValueToOriginal(CS.getArgument(2))).getNode();
+ }
+
+ //Fill in CF with the name of one of the functions in thread_callee_node
+ CF = const_cast<Function*>(dyn_cast<Function>(*thread_callee_node->globals_begin()));
}
}
@@ -775,8 +772,9 @@
Args.push_back(ArgVal);
}
- // Add the rest of the arguments...
- Args.insert(Args.end(), CS.arg_begin(), CS.arg_end());
+ // Add the rest of the arguments unless we're a thread creation point, in which case we only need the pools
+ if(!thread_creation_point)
+ Args.insert(Args.end(), CS.arg_begin(), CS.arg_end());
//
// There are circumstances where a function is casted to another type and
@@ -797,7 +795,27 @@
std::string Name = TheCall->getName(); TheCall->setName("");
- if (InvokeInst *II = dyn_cast<InvokeInst>(TheCall)) {
+ if(thread_creation_point) {
+ Module *M = CS.getInstruction()->getParent()->getParent()->getParent();
+ Value* pthread_replacement = M->getFunction("poolalloc_pthread_create");
+ std::vector<Value*> thread_args;
+
+ //Push back original thread arguments through the callee
+ thread_args.push_back(CS.getArgument(0));
+ thread_args.push_back(CS.getArgument(1));
+ thread_args.push_back(CS.getArgument(2));
+
+ //Push back the integer argument saying how many uses there are
+ thread_args.push_back(Constant::getIntegerValue(llvm::Type::getInt32Ty(M->getContext()),APInt(32,Args.size())));
+ thread_args.insert(thread_args.end(),Args.begin(),Args.end());
+ thread_args.push_back(CS.getArgument(3));
+
+ //Make the thread creation call
+ NewCall = CallInst::Create(pthread_replacement,
+ thread_args.begin(),thread_args.end(),
+ Name,TheCall);
+ }
+ else if (InvokeInst *II = dyn_cast<InvokeInst>(TheCall)) {
NewCall = InvokeInst::Create (NewCallee, II->getNormalDest(),
II->getUnwindDest(),
Args.begin(), Args.end(), Name, TheCall);
Modified: poolalloc/trunk/runtime/FL2Allocator/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/runtime/FL2Allocator/CMakeLists.txt?rev=103518&r1=103517&r2=103518&view=diff
==============================================================================
--- poolalloc/trunk/runtime/FL2Allocator/CMakeLists.txt (original)
+++ poolalloc/trunk/runtime/FL2Allocator/CMakeLists.txt Tue May 11 16:50:07 2010
@@ -1,2 +1,9 @@
+include_directories(/localhome/simmon12/progs/dyncall-0.5/dyncall)
+link_directories(/localhome/simmon12/progs/dyncall-0.5/dyncall/build_out/linux_x86_gcc_release)
file(GLOB sources *.cpp)
-add_llvm_library( poolalloc_rt ${sources} )
\ No newline at end of file
+add_llvm_library( poolalloc_rt ${sources} )
+set_property(
+ TARGET poolalloc_rt
+ PROPERTY COMPILE_DEFINITIONS USE_DYNCALL
+ )
+target_link_libraries( poolalloc_rt dyncall_s )
Modified: poolalloc/trunk/runtime/FL2Allocator/Makefile
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/runtime/FL2Allocator/Makefile?rev=103518&r1=103517&r2=103518&view=diff
==============================================================================
--- poolalloc/trunk/runtime/FL2Allocator/Makefile (original)
+++ poolalloc/trunk/runtime/FL2Allocator/Makefile Tue May 11 16:50:07 2010
@@ -1,7 +1,16 @@
LEVEL = ../..
-SHARED_LIBRARY=1
LIBRARYNAME=poolalloc_rt
+#
+# Build shared libraries on all platforms except Cygwin and MingW (which do
+# not support them).
+#
+ifneq ($(OS),Cygwin)
+ifneq ($(OS),MingW)
+SHARED_LIBRARY=1
+endif
+endif
+
ifdef ENABLE_OPTIMIZED
CXXFLAGS += -DNDEBUG=1
endif
Modified: poolalloc/trunk/runtime/FL2Allocator/PoolAllocator.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/runtime/FL2Allocator/PoolAllocator.cpp?rev=103518&r1=103517&r2=103518&view=diff
==============================================================================
--- poolalloc/trunk/runtime/FL2Allocator/PoolAllocator.cpp (original)
+++ poolalloc/trunk/runtime/FL2Allocator/PoolAllocator.cpp Tue May 11 16:50:07 2010
@@ -366,6 +366,7 @@
void poolinit_bp(PoolTy<NormalPoolTraits> *Pool, unsigned ObjAlignment) {
DO_IF_PNP(memset(Pool, 0, sizeof(PoolTy<NormalPoolTraits>)));
+ pthread_mutex_init(&Pool->pool_lock,NULL);
Pool->Slabs = 0;
if (ObjAlignment < 4) ObjAlignment = __alignof(double);
Pool->AllocSize = INITIAL_SLAB_SIZE;
@@ -392,6 +393,8 @@
getPoolNumber(Pool), NumBytes));
DO_IF_PNP(if (Pool->NumObjects == 0) ++PoolCounter); // Track # pools.
+ pthread_mutex_lock(&Pool->pool_lock);
+
if (NumBytes >= LARGE_SLAB_SIZE)
goto LargeObject;
@@ -415,6 +418,7 @@
// Update bump ptr.
Pool->ObjFreeList = (FreedNodeHeader<NormalPoolTraits>*)(BumpPtr+NumBytes);
DO_IF_TRACE(fprintf(stderr, "%p\n", Result));
+ pthread_mutex_unlock(&Pool->pool_lock);
return Result;
}
@@ -431,6 +435,7 @@
LAH->Marker = ~0U;
LAH->LinkIntoList(&Pool->LargeArrays);
DO_IF_TRACE(fprintf(stderr, "%p [large]\n", LAH+1));
+ pthread_mutex_unlock(&Pool->pool_lock);
return LAH+1;
}
@@ -444,6 +449,8 @@
#endif
DO_IF_POOLDESTROY_STATS(PrintPoolStats(Pool));
+ pthread_mutex_destroy(&Pool->pool_lock);
+
// Free all allocated slabs.
PoolSlab<NormalPoolTraits> *PS = Pool->Slabs;
while (PS) {
@@ -476,6 +483,7 @@
unsigned DeclaredSize, unsigned ObjAlignment) {
assert(Pool && "Null pool pointer passed into poolinit!\n");
memset(Pool, 0, sizeof(PoolTy<PoolTraits>));
+ pthread_mutex_init(&Pool->pool_lock,NULL);
Pool->AllocSize = INITIAL_SLAB_SIZE;
if (ObjAlignment < 4) ObjAlignment = __alignof(double);
@@ -516,6 +524,7 @@
//
void pooldestroy(PoolTy<NormalPoolTraits> *Pool) {
assert(Pool && "Null pool pointer passed in to pooldestroy!\n");
+ pthread_mutex_destroy(&Pool->pool_lock);
#ifdef ENABLE_POOL_IDS
unsigned PID;
@@ -858,29 +867,74 @@
void *poolalloc(PoolTy<NormalPoolTraits> *Pool, unsigned NumBytes) {
DO_IF_FORCE_MALLOCFREE(return malloc(NumBytes));
- return poolalloc_internal(Pool, NumBytes);
+ pthread_mutex_lock(&Pool->pool_lock);
+ void* to_return = poolalloc_internal(Pool, NumBytes);
+ pthread_mutex_unlock(&Pool->pool_lock);
+ return to_return;
}
void *poolmemalign(PoolTy<NormalPoolTraits> *Pool,
unsigned Alignment, unsigned NumBytes) {
//punt and use pool alloc.
//I don't know if this is safe or breaks any assumptions in the runtime
+ pthread_mutex_lock(&Pool->pool_lock);
intptr_t base = (intptr_t)poolalloc_internal(Pool, NumBytes + Alignment - 1);
+ pthread_mutex_unlock(&Pool->pool_lock);
return (void*)((base + (Alignment - 1)) & ~((intptr_t)Alignment -1));
}
void poolfree(PoolTy<NormalPoolTraits> *Pool, void *Node) {
DO_IF_FORCE_MALLOCFREE(free(Node); return);
+ pthread_mutex_lock(&Pool->pool_lock);
poolfree_internal(Pool, Node);
+ pthread_mutex_unlock(&Pool->pool_lock);
}
void *poolrealloc(PoolTy<NormalPoolTraits> *Pool, void *Node,
unsigned NumBytes) {
DO_IF_FORCE_MALLOCFREE(return realloc(Node, NumBytes));
- return poolrealloc_internal(Pool, Node, NumBytes);
+ pthread_mutex_lock(&Pool->pool_lock);
+ void* to_return = poolrealloc_internal(Pool, Node, NumBytes);
+ pthread_mutex_unlock(&Pool->pool_lock);
+ return to_return;
}
+#ifdef USE_DYNCALL
+#include <dyncall.h>
+#include <pthread.h>
+#include <stdarg.h>
+
+void* poolalloc_thread_start(void* arg_)
+{
+ void** arg = (void**)arg_;
+ DCCallVM* callVM = dcNewCallVM((size_t)arg[1]*sizeof(size_t)+108);
+ int i;
+ for(i=0; i<(size_t)arg[1]; i++)
+ dcArgPointer(callVM,arg[2+i]);
+ dcArgPointer(callVM,arg[2+i]);
+ void* to_return = dcCallPointer(callVM,arg[0]);
+ dcFree(callVM);
+ return to_return;
+}
+int poolalloc_pthread_create(pthread_t* thread,
+ const pthread_attr_t* attr,
+ void *(*start_routine)(void*), int num_pools, ...)
+{
+ void** arg_array = (void**)malloc(sizeof(void*)*(2+num_pools));
+ arg_array[0] = (void*)start_routine;
+ arg_array[1] = (void*)num_pools;
+ va_list argpools;
+ va_start(argpools,num_pools);
+ int i;
+ for(i=0; i<num_pools; i++)
+ arg_array[2+i]=va_arg(argpools,void*);
+ arg_array[2+i]=va_arg(argpools,void*);
+ va_end(argpools);
+ return pthread_create(thread,attr,poolalloc_thread_start,arg_array);
+}
+
+#endif
//===----------------------------------------------------------------------===//
// Pointer Compression runtime library. Most of these are just wrappers
@@ -945,6 +999,7 @@
void pooldestroy_pc(PoolTy<CompressedPoolTraits> *Pool) {
assert(Pool && "Null pool pointer passed in to pooldestroy!\n");
+ pthread_mutex_destroy(&Pool->pool_lock);
if (Pool->Slabs == 0)
return; // no memory allocated from this pool.
@@ -970,17 +1025,23 @@
unsigned long long poolalloc_pc(PoolTy<CompressedPoolTraits> *Pool,
unsigned NumBytes) {
+ pthread_mutex_lock(&Pool->pool_lock);
void *Result = poolalloc_internal(Pool, NumBytes);
+ pthread_mutex_unlock(&Pool->pool_lock);
return (char*)Result-(char*)Pool->Slabs;
}
void poolfree_pc(PoolTy<CompressedPoolTraits> *Pool, unsigned long long Node) {
+ pthread_mutex_lock(&Pool->pool_lock);
poolfree_internal(Pool, (char*)Pool->Slabs+Node);
+ pthread_mutex_unlock(&Pool->pool_lock);
}
unsigned long long poolrealloc_pc(PoolTy<CompressedPoolTraits> *Pool,
unsigned long long Node, unsigned NumBytes) {
+ pthread_mutex_lock(&Pool->pool_lock);
void *Result = poolrealloc_internal(Pool, (char*)Pool->Slabs+Node, NumBytes);
+ pthread_mutex_unlock(&Pool->pool_lock);
return (char*)Result-(char*)Pool->Slabs;
}
@@ -998,18 +1059,26 @@
void* poolalloc_pca(PoolTy<CompressedPoolTraits> *Pool, unsigned NumBytes)
{
- return poolalloc_internal(Pool, NumBytes);
+ pthread_mutex_lock(&Pool->pool_lock);
+ void* to_return = poolalloc_internal(Pool, NumBytes);
+ pthread_mutex_unlock(&Pool->pool_lock);
+ return to_return;
}
void poolfree_pca(PoolTy<CompressedPoolTraits> *Pool, void* Node)
{
+ pthread_mutex_lock(&Pool->pool_lock);
poolfree_internal(Pool, Node);
+ pthread_mutex_unlock(&Pool->pool_lock);
}
void* poolrealloc_pca(PoolTy<CompressedPoolTraits> *Pool, void* Node,
unsigned NumBytes)
{
- return poolrealloc_internal(Pool, Node, NumBytes);
+ pthread_mutex_lock(&Pool->pool_lock);
+ void* to_return = poolrealloc_internal(Pool, Node, NumBytes);
+ pthread_mutex_unlock(&Pool->pool_lock);
+ return to_return;
}
//===----------------------------------------------------------------------===//
Modified: poolalloc/trunk/runtime/FL2Allocator/PoolAllocator.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/runtime/FL2Allocator/PoolAllocator.h?rev=103518&r1=103517&r2=103518&view=diff
==============================================================================
--- poolalloc/trunk/runtime/FL2Allocator/PoolAllocator.h (original)
+++ poolalloc/trunk/runtime/FL2Allocator/PoolAllocator.h Tue May 11 16:50:07 2010
@@ -23,6 +23,7 @@
#define POOLALLOCATOR_RUNTIME_H
#include <assert.h>
+#include <pthread.h>
template<typename PoolTraits>
struct PoolSlab;
@@ -174,6 +175,9 @@
// BytesAllocated - The total number of bytes ever allocated from this pool.
// Together with NumObjects, allows us to calculate average object size.
unsigned BytesAllocated;
+
+ // Lock for the pool
+ pthread_mutex_t pool_lock;
};
extern "C" {
@@ -229,6 +233,13 @@
// Access tracing runtime library support.
void poolaccesstraceinit(void);
void poolaccesstrace(void *Ptr, void *PD);
+
+ // Auxiliary functions for thread support
+#ifdef USE_DYNCALL
+ int poolalloc_pthread_create(pthread_t* thread,
+ const pthread_attr_t* attr,
+ void *(*start_routine)(void*), int num_pools, ...);
+#endif
}
#endif
Modified: poolalloc/trunk/runtime/FreeListAllocator/Makefile
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/runtime/FreeListAllocator/Makefile?rev=103518&r1=103517&r2=103518&view=diff
==============================================================================
--- poolalloc/trunk/runtime/FreeListAllocator/Makefile (original)
+++ poolalloc/trunk/runtime/FreeListAllocator/Makefile Tue May 11 16:50:07 2010
@@ -1,5 +1,14 @@
LEVEL = ../..
-SHARED_LIBRARY=1
LIBRARYNAME=poolalloc_fl_rt
+#
+# Build shared libraries on all platforms except Cygwin and MingW (which do
+# not support them).
+#
+ifneq ($(OS),Cygwin)
+ifneq ($(OS),MingW)
+SHARED_LIBRARY=1
+endif
+endif
+
include $(LEVEL)/Makefile.common
Modified: poolalloc/trunk/runtime/HeapFrag/Makefile
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/runtime/HeapFrag/Makefile?rev=103518&r1=103517&r2=103518&view=diff
==============================================================================
--- poolalloc/trunk/runtime/HeapFrag/Makefile (original)
+++ poolalloc/trunk/runtime/HeapFrag/Makefile Tue May 11 16:50:07 2010
@@ -1,7 +1,17 @@
LEVEL = ../..
+LIBRARYNAME=heapfrag
+
#BYTECODE_LIBRARY=1
+
+#
+# Build shared libraries on all platforms except Cygwin and MingW (which do
+# not support them).
+#
+ifneq ($(OS),Cygwin)
+ifneq ($(OS),MingW)
#SHARED_LIBRARY=1
-LIBRARYNAME=heapfrag
+endif
+endif
include $(LEVEL)/Makefile.common
Modified: poolalloc/trunk/runtime/PoolAllocator/Makefile
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/runtime/PoolAllocator/Makefile?rev=103518&r1=103517&r2=103518&view=diff
==============================================================================
--- poolalloc/trunk/runtime/PoolAllocator/Makefile (original)
+++ poolalloc/trunk/runtime/PoolAllocator/Makefile Tue May 11 16:50:07 2010
@@ -1,7 +1,16 @@
LEVEL = ../..
-SHARED_LIBRARY=1
LIBRARYNAME=poolalloc_rt_old
+#
+# Build shared libraries on all platforms except Cygwin and MingW (which do
+# not support them).
+#
+ifneq ($(OS),Cygwin)
+ifneq ($(OS),MingW)
+SHARED_LIBRARY=1
+endif
+endif
+
include $(LEVEL)/Makefile.common
# Always build optimized and debug versions
Modified: poolalloc/trunk/runtime/PreRT/Makefile
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/runtime/PreRT/Makefile?rev=103518&r1=103517&r2=103518&view=diff
==============================================================================
--- poolalloc/trunk/runtime/PreRT/Makefile (original)
+++ poolalloc/trunk/runtime/PreRT/Makefile Tue May 11 16:50:07 2010
@@ -1,6 +1,6 @@
LEVEL = ../..
-BYTECODE_LIBRARY=1
LIBRARYNAME=pa_pre_rt
+BYTECODE_LIBRARY=1
include $(LEVEL)/Makefile.common
Modified: poolalloc/trunk/test/Makefile
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/Makefile?rev=103518&r1=103517&r2=103518&view=diff
==============================================================================
--- poolalloc/trunk/test/Makefile (original)
+++ poolalloc/trunk/test/Makefile Tue May 11 16:50:07 2010
@@ -25,30 +25,35 @@
LARGE_PROBLEM_SIZE_DIRS := \
- MultiSource/Benchmarks/llubenchmark \
- MultiSource/Benchmarks/FreeBench \
- MultiSource/Benchmarks/Ptrdist \
- MultiSource/Benchmarks/MallocBench/cfrac \
- SingleSource/Benchmarks/McGill
+ #MultiSource/Benchmarks/llubenchmark \
+ #MultiSource/Benchmarks/FreeBench \
+ #MultiSource/Benchmarks/Ptrdist \
+ #MultiSource/Benchmarks/MallocBench/cfrac \
+ #SingleSource/Benchmarks/McGill
+
LARGE_PROBLEM_SIZE_DIRS := \
- $(addprefix $(LLVM_OBJ_ROOT)/projects/llvm-test/,$(LARGE_PROBLEM_SIZE_DIRS))
+ $(addprefix $(LLVM_OBJ_ROOT)/projects/test-suite/,$(LARGE_PROBLEM_SIZE_DIRS))
+
NORMAL_PROBLEM_SIZE_DIRS := \
- MultiSource/Benchmarks/SciMark2-C/scimark2 \
- External/Povray \
- External/FPGrowth \
- External/Namd \
- External/SPEC/CINT2000/164.gzip \
- External/SPEC/CINT2000/175.vpr \
- External/SPEC/CINT2000/176.gcc \
- External/SPEC/CINT2000/252.eon \
- External/SPEC/CINT2000/253.perlbmk \
- External/SPEC/CINT2000/254.gap \
- External/SPEC/CINT2000/300.twolf
+ MultiSource/Benchmarks/Olden/bh \
+ #MultiSource/Benchmarks/Olden \
+ #MultiSource/Benchmarks/SciMark2-C/scimark2 \
+ #External/Povray \
+ #External/FPGrowth \
+ #External/Namd \
+ #External/SPEC/CINT2000/164.gzip \
+ #External/SPEC/CINT2000/175.vpr \
+ #External/SPEC/CINT2000/176.gcc \
+ #External/SPEC/CINT2000/252.eon \
+ #External/SPEC/CINT2000/253.perlbmk \
+ #External/SPEC/CINT2000/254.gap \
+ #External/SPEC/CINT2000/300.twolf
+
NORMAL_PROBLEM_SIZE_DIRS := \
- $(addprefix $(LLVM_OBJ_ROOT)/projects/llvm-test/,$(NORMAL_PROBLEM_SIZE_DIRS))
+ $(addprefix $(LLVM_OBJ_ROOT)/projects/test-suite/,$(NORMAL_PROBLEM_SIZE_DIRS))
#
# Problems for Pointer Compression
@@ -63,7 +68,7 @@
MultiSource/Benchmarks/MallocBench/cfrac
PCLARGE_PROBLEM_SIZE_DIRS := \
- $(addprefix $(LLVM_OBJ_ROOT)/projects/llvm-test/,$(PCLARGE_PROBLEM_SIZE_DIRS))
+ $(addprefix $(LLVM_OBJ_ROOT)/projects/test-suite/,$(PCLARGE_PROBLEM_SIZE_DIRS))
PCNORMAL_PROBLEM_SIZE_DIRS := \
MultiSource/Benchmarks/Olden/perimeter \
@@ -72,7 +77,7 @@
MultiSource/Benchmarks/Olden/voronoi
PCNORMAL_PROBLEM_SIZE_DIRS := \
- $(addprefix $(LLVM_OBJ_ROOT)/projects/llvm-test/,$(PCNORMAL_PROBLEM_SIZE_DIRS))
+ $(addprefix $(LLVM_OBJ_ROOT)/projects/test-suite/,$(PCNORMAL_PROBLEM_SIZE_DIRS))
##############################################################################
# Targets for gathering statistics for programs for papers
@@ -200,64 +205,64 @@
# Targets for running tests and gathering statistics for arbitrary tests
##############################################################################
-# test target - Descend into projects/llvm-test and run the TEST.poolalloc.Makefile
+# test target - Descend into projects/test-suite and run the TEST.poolalloc.Makefile
# tests...
test::
- (cd $(LLVM_OBJ_ROOT)/projects/llvm-test/$(SUBDIR); \
+ (cd $(LLVM_OBJ_ROOT)/projects/test-suite/$(SUBDIR); \
PROJECT_DIR=$(PROJ_OBJ_ROOT) $(MAKE) -j1 TEST=poolalloc \
$(LARGESIZE) $(STABLERUN) report report.html)
@printf "\a"; sleep 1; printf "\a"; sleep 1; printf "\a"
pacompiletime::
- (cd $(LLVM_OBJ_ROOT)/projects/llvm-test/$(SUBDIR); \
+ (cd $(LLVM_OBJ_ROOT)/projects/test-suite/$(SUBDIR); \
PROJECT_DIR=$(PROJ_OBJ_ROOT) $(MAKE) -j1 TEST=pacompiletime \
report report.html)
@printf "\a"; sleep 1; printf "\a"; sleep 1; printf "\a"
ptrcomp::
- (cd $(LLVM_OBJ_ROOT)/projects/llvm-test/$(SUBDIR); \
+ (cd $(LLVM_OBJ_ROOT)/projects/test-suite/$(SUBDIR); \
PROJECT_DIR=$(PROJ_OBJ_ROOT) $(MAKE) -j1 TEST=ptrcomp \
$(LARGESIZE) $(STABLERUN) report report.html)
@printf "\a"; sleep 1; printf "\a"; sleep 1; printf "\a"
ptrcomptest::
- (cd $(LLVM_OBJ_ROOT)/projects/llvm-test/$(SUBDIR); \
+ (cd $(LLVM_OBJ_ROOT)/projects/test-suite/$(SUBDIR); \
PROJECT_DIR=$(PROJ_OBJ_ROOT) $(MAKE) -j1 TEST=ptrcomp \
$(LARGESIZE) report)
@printf "\a"; sleep 1; printf "\a"; sleep 1; printf "\a"
vtl::
- (cd $(LLVM_OBJ_ROOT)/projects/llvm-test/$(SUBDIR); \
+ (cd $(LLVM_OBJ_ROOT)/projects/test-suite/$(SUBDIR); \
PROJECT_DIR=$(PROJ_OBJ_ROOT) $(MAKE) -j1 TEST=pavtl \
test report report.csv)
@printf "\a"; sleep 1; printf "\a"; sleep 1; printf "\a"
perf::
- (cd $(LLVM_OBJ_ROOT)/projects/llvm-test/$(SUBDIR); \
+ (cd $(LLVM_OBJ_ROOT)/projects/test-suite/$(SUBDIR); \
PROJECT_DIR=$(PROJ_OBJ_ROOT) $(MAKE) -j1 TEST=perf \
test report report.csv)
@printf "\a"; sleep 1; printf "\a"; sleep 1; printf "\a"
optzn::
- (cd $(LLVM_OBJ_ROOT)/projects/llvm-test/$(SUBDIR); \
+ (cd $(LLVM_OBJ_ROOT)/projects/test-suite/$(SUBDIR); \
PROJECT_DIR=$(PROJ_OBJ_ROOT) $(MAKE) -j1 TEST=optzn \
$(LARGESIZE) $(STABLERUN) test report report.csv)
@printf "\a"; sleep 1; printf "\a"; sleep 1; printf "\a"
p4perf::
- (cd $(LLVM_OBJ_ROOT)/projects/llvm-test/$(SUBDIR); \
+ (cd $(LLVM_OBJ_ROOT)/projects/test-suite/$(SUBDIR); \
PROJECT_DIR=$(PROJ_OBJ_ROOT) $(MAKE) -j1 TEST=p4perf \
test report report.csv)
@printf "\a"; sleep 1; printf "\a"; sleep 1; printf "\a"
strace::
- (cd $(LLVM_OBJ_ROOT)/projects/llvm-test/$(SUBDIR); \
+ (cd $(LLVM_OBJ_ROOT)/projects/test-suite/$(SUBDIR); \
PROJECT_DIR=$(PROJ_OBJ_ROOT) $(MAKE) -j1 TEST=strace \
test)
@printf "\a"; sleep 1; printf "\a"; sleep 1; printf "\a"
cputrack::
- (cd $(LLVM_OBJ_ROOT)/projects/llvm-test/$(SUBDIR); \
+ (cd $(LLVM_OBJ_ROOT)/projects/test-suite/$(SUBDIR); \
PROJECT_DIR=$(PROJ_OBJ_ROOT) $(MAKE) -j1 TEST=cputrack \
report report.csv)
@printf "\a"; sleep 1; printf "\a"; sleep 1; printf "\a"
Modified: poolalloc/trunk/test/TEST.poolalloc.Makefile
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/TEST.poolalloc.Makefile?rev=103518&r1=103517&r2=103518&view=diff
==============================================================================
--- poolalloc/trunk/test/TEST.poolalloc.Makefile (original)
+++ poolalloc/trunk/test/TEST.poolalloc.Makefile Tue May 11 16:50:07 2010
@@ -19,21 +19,22 @@
CURDIR := $(shell cd .; pwd)
PROGDIR := $(shell cd $(LLVM_SRC_ROOT)/projects/test-suite; pwd)/
RELDIR := $(subst $(PROGDIR),,$(CURDIR))
-PADIR := /home/andrewl/Research/llvm/projects/poolalloc
+#PADIR := /home/andrewl/Research/llvm/projects/poolalloc
+PADIR := $(LLVM_OBJ_ROOT)/projects/poolalloc
# Bits of runtime to improve analysis
-PA_PRE_RT := $(PADIR)/Release/lib/libpa_pre_rt.bca
+PA_PRE_RT := $(PADIR)/$(CONFIGURATION)/lib/libpa_pre_rt.bca
# Pool allocator pass shared object
-PA_SO := $(PADIR)/Debug/lib/libpoolalloc$(SHLIBEXT)
-DSA_SO := $(PADIR)/Debug/lib/libLLVMDataStructure$(SHLIBEXT)
-ASSIST_SO := $(PADIR)/Debug/lib/libAssistDS$(SHLIBEXT)
+PA_SO := $(PADIR)/$(CONFIGURATION)/lib/libpoolalloc$(SHLIBEXT)
+DSA_SO := $(PADIR)/$(CONFIGURATION)/lib/libLLVMDataStructure$(SHLIBEXT)
+ASSIST_SO := $(PADIR)/$(CONFIGURATION)/lib/libAssistDS$(SHLIBEXT)
# Pool allocator runtime library
-#PA_RT := $(PADIR)/Debug/lib/libpoolalloc_fl_rt.bc
+#PA_RT := $(PADIR)/$(CONFIGURATION)/lib/libpoolalloc_fl_rt.bc
#PA_RT_O := $(PROJECT_DIR)/lib/$(CONFIGURATION)/poolalloc_rt.o
-PA_RT_O := $(PADIR)/Debug/lib/poolalloc_rt.o
-#PA_RT_O := $(PROJECT_DIR)/lib/Release/poolalloc_fl_rt.o
+PA_RT_O := $(PADIR)/$(CONFIGURATION)/lib/libpoolalloc_rt.a
+#PA_RT_O := $(PROJECT_DIR)/lib/$(CONFIGURATION)/poolalloc_fl_rt.o
# Command to run opt with the pool allocator pass loaded
OPT_PA := $(LOPT) -load $(DSA_SO) -load $(PA_SO)
More information about the llvm-commits
mailing list