OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
JoinLoopTest.cpp File Reference
#include "JoinLoop.h"
#include "Logger/Logger.h"
#include <llvm/ExecutionEngine/MCJIT.h>
#include <llvm/IR/BasicBlock.h>
#include <llvm/IR/Function.h>
#include <llvm/IR/IRBuilder.h>
#include <llvm/IR/Module.h>
#include <llvm/IR/Type.h>
#include <llvm/IR/Verifier.h>
#include <llvm/Support/TargetSelect.h>
#include <llvm/Support/raw_os_ostream.h>
#include <memory>
#include <vector>
+ Include dependency graph for JoinLoopTest.cpp:

Go to the source code of this file.

Namespaces

 anonymous_namespace{JoinLoopTest.cpp}
 

Functions

RUNTIME_EXPORT void print_iterators (const int64_t i, const int64_t j, const int64_t k)
 
void anonymous_namespace{JoinLoopTest.cpp}::verify_function_ir (const llvm::Function *func)
 
llvm::Value * anonymous_namespace{JoinLoopTest.cpp}::emit_external_call (const std::string &fname, llvm::Type *ret_type, const std::vector< llvm::Value * > args, llvm::Module *llvm_module, llvm::IRBuilder<> &builder)
 
llvm::Function * anonymous_namespace{JoinLoopTest.cpp}::create_loop_test_function (llvm::LLVMContext &context, llvm::Module *llvm_module, const std::vector< JoinLoop > &join_loops)
 
std::unique_ptr< llvm::Module > anonymous_namespace{JoinLoopTest.cpp}::create_loop_test_module ()
 
std::pair< void
*, std::unique_ptr
< llvm::ExecutionEngine > > 
anonymous_namespace{JoinLoopTest.cpp}::native_codegen (std::unique_ptr< llvm::Module > &llvm_module, llvm::Function *func)
 
std::vector< JoinLoopanonymous_namespace{JoinLoopTest.cpp}::generate_descriptors (const unsigned mask, const unsigned cond_mask, const std::vector< int64_t > &upper_bounds)
 
int main ()
 

Variables

llvm::LLVMContext anonymous_namespace{JoinLoopTest.cpp}::g_global_context
 

Function Documentation

int main ( )

Definition at line 192 of file JoinLoopTest.cpp.

References anonymous_namespace{JoinLoopTest.cpp}::create_loop_test_function(), anonymous_namespace{JoinLoopTest.cpp}::create_loop_test_module(), anonymous_namespace{JoinLoopTest.cpp}::generate_descriptors(), generate_loop_ref::mask_bitcount, anonymous_namespace{JoinLoopTest.cpp}::native_codegen(), and generate_loop_ref::upper_bounds.

192  {
193  std::vector<int64_t> upper_bounds{5, 3, 9};
194  for (unsigned mask = 0; mask < static_cast<unsigned>(1 << upper_bounds.size());
195  ++mask) {
196  const unsigned mask_bitcount = __builtin_popcount(mask);
197  for (unsigned cond_mask = 0; cond_mask < static_cast<unsigned>(1 << mask_bitcount);
198  ++cond_mask) {
199  auto llvm_module = create_loop_test_module();
200  const auto join_loops = generate_descriptors(mask, cond_mask, upper_bounds);
201  const auto function =
202  create_loop_test_function(g_global_context, llvm_module.get(), join_loops);
203  const auto& func_and_ee = native_codegen(llvm_module, function);
204  reinterpret_cast<int64_t (*)()>(func_and_ee.first)();
205  }
206  }
207  return 0;
208 }
std::pair< void *, std::unique_ptr< llvm::ExecutionEngine > > native_codegen(std::unique_ptr< llvm::Module > &llvm_module, llvm::Function *func)
llvm::ManagedStatic< llvm::LLVMContext > g_global_context
std::unique_ptr< llvm::Module > create_loop_test_module()
std::vector< JoinLoop > generate_descriptors(const unsigned mask, const unsigned cond_mask, const std::vector< int64_t > &upper_bounds)
llvm::Function * create_loop_test_function(llvm::LLVMContext &context, llvm::Module *llvm_module, const std::vector< JoinLoop > &join_loops)

+ Here is the call graph for this function:

RUNTIME_EXPORT void print_iterators ( const int64_t  i,
const int64_t  j,
const int64_t  k 
)

Definition at line 36 of file JoinLoopTest.cpp.

38  {
39  printf("%ld, %ld, %ld\n", i, j, k);
40 }