summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/llvm/instructions.cpp
diff options
context:
space:
mode:
authorZack Rusin <zack@tungstengraphics.com>2007-10-29 11:42:22 -0400
committerZack Rusin <zack@tungstengraphics.com>2007-10-30 05:15:05 -0400
commitfd908ce234d1f553b59d65afb7e4243ffee24018 (patch)
treefcddc5e5d93a2c45d90d4bb31172e1a302d1aa94 /src/mesa/pipe/llvm/instructions.cpp
parentb0f3b5910ebd0737600ab7b1fdc135d74f2617f4 (diff)
Change the way we handle temporaries in LLVM translation.
TGSI uses TEMP, among others, as a way of passing arguments from one function to another. Instead of trying to figure out which temp's a function needs and trying to dynamically adjust its signature just pass the whole array of temporaries to them.
Diffstat (limited to 'src/mesa/pipe/llvm/instructions.cpp')
-rw-r--r--src/mesa/pipe/llvm/instructions.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mesa/pipe/llvm/instructions.cpp b/src/mesa/pipe/llvm/instructions.cpp
index b0aa0cc746..2eac0edbc4 100644
--- a/src/mesa/pipe/llvm/instructions.cpp
+++ b/src/mesa/pipe/llvm/instructions.cpp
@@ -1098,12 +1098,13 @@ void Instructions::end()
}
void Instructions::cal(int label, llvm::Value *out, llvm::Value *in,
- llvm::Value *cst)
+ llvm::Value *cst, llvm::Value *temp)
{
std::vector<Value*> params;
params.push_back(out);
params.push_back(in);
params.push_back(cst);
+ params.push_back(temp);
llvm::Function *func = findFunction(label);
new CallInst(func, params.begin(), params.end(), std::string(), m_block);
@@ -1116,6 +1117,7 @@ llvm::Function * Instructions::declareFunc(int label)
args.push_back(vecPtr);
args.push_back(vecPtr);
args.push_back(vecPtr);
+ args.push_back(vecPtr);
ParamAttrsList *params = 0;
FunctionType *funcType = FunctionType::get(
/*Result=*/Type::VoidTy,
@@ -1142,7 +1144,9 @@ void Instructions::bgnSub(unsigned label, Storage *storage)
ptr_IN->setName("IN");
Value *ptr_CONST = args++;
ptr_CONST->setName("CONST");
- storage->pushArguments(ptr_OUT, ptr_IN, ptr_CONST);
+ Value *ptr_TEMP = args++;
+ ptr_TEMP->setName("TEMP");
+ storage->pushArguments(ptr_OUT, ptr_IN, ptr_CONST, ptr_TEMP);
llvm::BasicBlock *entry = new BasicBlock("entry", func, 0);