OmniSciDB  6686921089
 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 *module, llvm::IRBuilder<> &builder)
 
llvm::Function * anonymous_namespace{JoinLoopTest.cpp}::create_loop_test_function (llvm::LLVMContext &context, llvm::Module *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 > &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 190 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.

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

+ 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 }