Commit 8ab91126 authored by guruhegde's avatar guruhegde

Make batched version fn have suffix "_batch"

Add test files
parent 5e51668b
......@@ -79,7 +79,7 @@ void BatchMaker::createBatchedFormFn() {
// Create Function prototype
FunctionType *BatchFuncType = FunctionType::get(RetType, NewParams, false);
NewFunc = Function::Create(BatchFuncType, GlobalValue::ExternalLinkage,
"batch_fn", OldFunc->getParent());
OldFunc->getName() + "_batch", OldFunc->getParent());
// Set argument names.
SmallVector<Value *, 4> BatchedArgs;
......
......@@ -3,7 +3,7 @@ add_library(TASPass SHARED BatchProcess.cpp
BatchMaker.cpp
BatchMakerPass.cpp)
add_library(TASUtil SHARED ForLoop.cpp Util.cpp)
add_library(TASUtil STATIC ForLoop.cpp Util.cpp)
target_link_libraries(TASPass TASUtil)
......
......@@ -19,8 +19,10 @@ int singlularFn(int c, int * a BATCH_ARG, int *b BATCH_ARG) TAS_MAKE_BATCH {
x = *a + 50;
unlock:
x = x + 10;
return 0;
slowpath:
x = x + 30;
return -1;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#!/usr/bin/env bash
set -eu
cur_dir=`pwd`
cd ../../../build
make
cd $cur_dir
# Run using debug build
LLVM_PATH=/home/gp/llvm_projects/llvm/install/bin
${LLVM_PATH}/opt -S -mem2reg < fast_flows.ll > fast_flows_mem2reg.ll
${LLVM_PATH}/opt -S -load ../../../build/lib/libTASPass.so <fast_flows.ll > fast_flows_tas.ll -mem2reg -indvars -loop-simplify -lcssa -tas-batch-maker
${LLVM_PATH}/llc -filetype=obj fast_flows_tas.ll -o fast_flows.o
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment