From 53c2963b84f7a8538d2a2c67e3fbb8a22f644c57 Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Wed, 13 Feb 2008 00:36:31 -0500 Subject: fix fetching input elements and generate a ret on end --- src/mesa/pipe/llvm/instructionssoa.cpp | 2 ++ src/mesa/pipe/llvm/instructionssoa.h | 4 ++++ src/mesa/pipe/llvm/storagesoa.cpp | 3 --- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mesa/pipe/llvm/instructionssoa.cpp b/src/mesa/pipe/llvm/instructionssoa.cpp index 9ac4d8fbc7..0e501ab08d 100644 --- a/src/mesa/pipe/llvm/instructionssoa.cpp +++ b/src/mesa/pipe/llvm/instructionssoa.cpp @@ -2,6 +2,7 @@ InstructionsSoa::InstructionsSoa(llvm::Module *mod, llvm::Function *func, llvm::BasicBlock *block, StorageSoa *storage) + : m_builder(block) { } @@ -23,4 +24,5 @@ std::vector InstructionsSoa::mul(const std::vector i void InstructionsSoa::end() { + m_builder.CreateRetVoid(); } diff --git a/src/mesa/pipe/llvm/instructionssoa.h b/src/mesa/pipe/llvm/instructionssoa.h index 0b6b41cf05..233d363b90 100644 --- a/src/mesa/pipe/llvm/instructionssoa.h +++ b/src/mesa/pipe/llvm/instructionssoa.h @@ -28,6 +28,8 @@ #ifndef INSTRUCTIONSSOA_H #define INSTRUCTIONSSOA_H +#include + #include namespace llvm { @@ -49,6 +51,8 @@ public: std::vector mul(const std::vector in1, const std::vector in2); void end(); +private: + llvm::LLVMFoldingBuilder m_builder; }; diff --git a/src/mesa/pipe/llvm/storagesoa.cpp b/src/mesa/pipe/llvm/storagesoa.cpp index 8f82989cc5..786511204a 100644 --- a/src/mesa/pipe/llvm/storagesoa.cpp +++ b/src/mesa/pipe/llvm/storagesoa.cpp @@ -150,10 +150,7 @@ llvm::Value * StorageSoa::elementPointer(llvm::Value *ptr, int index, { std::vector indices; indices.push_back(constantInt(index)); - indices.push_back(constantInt(0));//first element in the struct indices.push_back(constantInt(channel)); - indices.push_back(constantInt(0));//f channel - indices.push_back(constantInt(0));//first ptr in the f channel GetElementPtrInst *getElem = new GetElementPtrInst(ptr, indices.begin(), -- cgit v1.2.3