From ba887517160ab2b5a70e01723ee649db1554775b Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Mon, 22 Oct 2007 08:46:28 -0400 Subject: Align the load/stores. Reduce the amount of debugging output. --- src/mesa/pipe/llvm/llvmtgsi.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'src/mesa/pipe/llvm/llvmtgsi.cpp') diff --git a/src/mesa/pipe/llvm/llvmtgsi.cpp b/src/mesa/pipe/llvm/llvmtgsi.cpp index 56b488fb1a..00f8b86efc 100644 --- a/src/mesa/pipe/llvm/llvmtgsi.cpp +++ b/src/mesa/pipe/llvm/llvmtgsi.cpp @@ -31,12 +31,17 @@ #include #include #include + +#include #include + using namespace llvm; #include "llvm_base_shader.cpp" +static int GLOBAL_ID = 0; + static inline void addPass(PassManager &PM, Pass *P) { // Add the pass to the pass manager... PM.add(P); @@ -168,8 +173,8 @@ translate_instruction(llvm::Module *module, inputs[i] = val; } - if (inputs[0]) - instr->printVector(inputs[0]); + /*if (inputs[0]) + instr->printVector(inputs[0]);*/ llvm::Value *out = 0; printf("Opcode is %d\n", inst->Instruction.Opcode); switch (inst->Instruction.Opcode) { @@ -523,7 +528,6 @@ translate_instruction(llvm::Module *module, printf("translate instr END\n"); } - static llvm::Module * tgsi_to_llvm(struct ga_llvm_prog *prog, const struct tgsi_token *tokens) { @@ -533,7 +537,11 @@ tgsi_to_llvm(struct ga_llvm_prog *prog, const struct tgsi_token *tokens) struct tgsi_full_declaration fd; Function* shader = mod->getFunction("execute_shader"); - shader->setName("execute_shader_2"); + std::ostringstream stream; + stream << "execute_shader"; + stream << prog->id; + std::string func_name = stream.str(); + shader->setName(func_name.c_str()); Function::arg_iterator args = shader->arg_begin(); Value *ptr_OUT = args++; @@ -593,8 +601,10 @@ struct ga_llvm_prog * ga_llvm_from_tgsi(struct pipe_context *pipe, const struct tgsi_token *tokens) { std::cout << "Creating llvm from: " <id = GLOBAL_ID; fprintf(stderr, "----- TGSI Start ---- \n"); tgsi_dump(tokens, 0); fprintf(stderr, "----- TGSI End ---- \n"); @@ -618,9 +628,7 @@ ga_llvm_from_tgsi(struct pipe_context *pipe, const struct tgsi_token *tokens) ga_llvm->module = mod; Function *func = mod->getFunction("run_vertex_shader"); - std::cout << "run_vertex_shader = "<function = ee->getPointerToFunctionOrStub(func); - std::cout << " -- FUNC is " <function<(prog->function); runner(inputs, dests, consts, num_vertices, num_inputs, num_attribs, prog->num_consts); - std::cout << "---- END LLVM Execution "<