InstructionsSoa::InstructionsSoa(llvm::Module *mod, llvm::Function *func,
llvm::BasicBlock *block, StorageSoa *storage)
+ : m_builder(block)
{
}
void InstructionsSoa::end()
{
+ m_builder.CreateRetVoid();
}
#ifndef INSTRUCTIONSSOA_H
#define INSTRUCTIONSSOA_H
+#include <llvm/Support/LLVMBuilder.h>
+
#include <vector>
namespace llvm {
std::vector<llvm::Value*> mul(const std::vector<llvm::Value*> in1,
const std::vector<llvm::Value*> in2);
void end();
+private:
+ llvm::LLVMFoldingBuilder m_builder;
};
{
std::vector<Value*> 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(),