OmniSciDB
a5dc49c757
|
#include "QueryEngine/Execute.h"
#include <llvm/Analysis/ScopedNoAliasAA.h>
#include <llvm/Analysis/TypeBasedAliasAnalysis.h>
#include <llvm/Bitcode/BitcodeReader.h>
#include <llvm/Bitcode/BitcodeWriter.h>
#include <llvm/ExecutionEngine/MCJIT.h>
#include <llvm/IR/Attributes.h>
#include <llvm/IR/GlobalValue.h>
#include <llvm/IR/InstIterator.h>
#include <llvm/IR/IntrinsicInst.h>
#include <llvm/IR/Intrinsics.h>
#include <llvm/IR/LegacyPassManager.h>
#include <llvm/IR/Verifier.h>
#include <llvm/IRReader/IRReader.h>
#include <llvm/Support/TargetRegistry.h>
#include <llvm/Support/Casting.h>
#include <llvm/Support/FileSystem.h>
#include <llvm/Support/FormattedStream.h>
#include <llvm/Support/MemoryBuffer.h>
#include <llvm/Support/SourceMgr.h>
#include <llvm/Support/TargetSelect.h>
#include <llvm/Support/raw_os_ostream.h>
#include <llvm/Support/raw_ostream.h>
#include <llvm/Transforms/IPO.h>
#include <llvm/Transforms/IPO/AlwaysInliner.h>
#include <llvm/Transforms/IPO/InferFunctionAttrs.h>
#include <llvm/Transforms/IPO/PassManagerBuilder.h>
#include <llvm/Transforms/InstCombine/InstCombine.h>
#include <llvm/Transforms/Instrumentation.h>
#include <llvm/Transforms/Scalar.h>
#include <llvm/Transforms/Scalar/GVN.h>
#include <llvm/Transforms/Scalar/InstSimplifyPass.h>
#include <llvm/Transforms/Utils.h>
#include <llvm/Transforms/Utils/BasicBlockUtils.h>
#include <llvm/Transforms/Utils/Cloning.h>
#include "CudaMgr/CudaMgr.h"
#include "QueryEngine/CodeGenerator.h"
#include "QueryEngine/CodegenHelper.h"
#include "QueryEngine/ExtensionFunctionsWhitelist.h"
#include "QueryEngine/GpuSharedMemoryUtils.h"
#include "QueryEngine/LLVMFunctionAttributesUtil.h"
#include "QueryEngine/Optimization/AnnotateInternalFunctionsPass.h"
#include "QueryEngine/OutputBufferInitialization.h"
#include "QueryEngine/QueryEngine.h"
#include "QueryEngine/QueryTemplateGenerator.h"
#include "QueryEngine/UsedColumnsVisitor.h"
#include "Shared/InlineNullValues.h"
#include "Shared/MathUtils.h"
#include "StreamingTopN.h"
Go to the source code of this file.
Classes | |
class | anonymous_namespace{NativeCodegen.cpp}::CaseExprDetector |
Namespaces | |
anonymous_namespace{NativeCodegen.cpp} | |
Macros | |
#define | SHOW_DEFINED(MODULE) |
#define | SHOW_FUNCTIONS(MODULE) |
Functions | |
void | anonymous_namespace{NativeCodegen.cpp}::throw_parseIR_error (const llvm::SMDiagnostic &parse_error, std::string src="", const bool is_gpu=false) |
template<typename T = void> | |
void | anonymous_namespace{NativeCodegen.cpp}::show_defined (llvm::Module &llvm_module) |
template<typename T = void> | |
void | anonymous_namespace{NativeCodegen.cpp}::show_defined (llvm::Module *llvm_module) |
template<typename T = void> | |
void | anonymous_namespace{NativeCodegen.cpp}::show_defined (std::unique_ptr< llvm::Module > &llvm_module) |
template<typename T = void> | |
void | anonymous_namespace{NativeCodegen.cpp}::scan_function_calls (llvm::Function &F, std::unordered_set< std::string > &defined, std::unordered_set< std::string > &undefined, const std::unordered_set< std::string > &ignored) |
template<typename T = void> | |
void | anonymous_namespace{NativeCodegen.cpp}::scan_function_calls (llvm::Module &llvm_module, std::unordered_set< std::string > &defined, std::unordered_set< std::string > &undefined, const std::unordered_set< std::string > &ignored) |
template<typename T = void> | |
std::tuple< std::unordered_set < std::string > , std::unordered_set < std::string > > | anonymous_namespace{NativeCodegen.cpp}::scan_function_calls (llvm::Module &llvm_module, const std::unordered_set< std::string > &ignored={}) |
void | anonymous_namespace{NativeCodegen.cpp}::eliminate_dead_self_recursive_funcs (llvm::Module &M, const std::unordered_set< llvm::Function * > &live_funcs) |
void | anonymous_namespace{NativeCodegen.cpp}::optimize_ir (llvm::Function *query_func, llvm::Module *llvm_module, llvm::legacy::PassManager &pass_manager, const std::unordered_set< llvm::Function * > &live_funcs, const bool is_gpu_smem_used, const CompilationOptions &co) |
void | verify_function_ir (const llvm::Function *func) |
std::string | anonymous_namespace{NativeCodegen.cpp}::assemblyForCPU (ExecutionEngineWrapper &execution_engine, llvm::Module *llvm_module) |
ExecutionEngineWrapper | anonymous_namespace{NativeCodegen.cpp}::create_execution_engine (llvm::Module *llvm_module, llvm::EngineBuilder &eb, const CompilationOptions &co) |
std::string | anonymous_namespace{NativeCodegen.cpp}::cpp_to_llvm_name (const std::string &s) |
std::string | anonymous_namespace{NativeCodegen.cpp}::gen_array_any_all_sigs () |
std::string | anonymous_namespace{NativeCodegen.cpp}::gen_translate_null_key_sigs () |
llvm::StringRef | get_gpu_target_triple_string () |
llvm::StringRef | get_gpu_data_layout () |
std::map< std::string, std::string > | get_device_parameters (bool cpu_only) |
std::unique_ptr< llvm::Module > | read_llvm_module_from_bc_file (const std::string &bc_filename, llvm::LLVMContext &context) |
std::unique_ptr< llvm::Module > | read_llvm_module_from_ir_file (const std::string &udf_ir_filename, llvm::LLVMContext &ctx, bool is_gpu=false) |
std::unique_ptr< llvm::Module > | read_llvm_module_from_ir_string (const std::string &udf_ir_string, llvm::LLVMContext &ctx, bool is_gpu=false) |
void | anonymous_namespace{NativeCodegen.cpp}::bind_pos_placeholders (const std::string &pos_fn_name, const bool use_resume_param, llvm::Function *query_func, llvm::Module *llvm_module) |
void | anonymous_namespace{NativeCodegen.cpp}::set_row_func_argnames (llvm::Function *row_func, const size_t in_col_count, const size_t agg_col_count, const bool hoist_literals) |
llvm::Function * | anonymous_namespace{NativeCodegen.cpp}::create_row_function (const size_t in_col_count, const size_t agg_col_count, const bool hoist_literals, llvm::Module *llvm_module, llvm::LLVMContext &context) |
void | anonymous_namespace{NativeCodegen.cpp}::bind_query (llvm::Function *query_func, const std::string &query_fname, llvm::Function *multifrag_query_func, llvm::Module *llvm_module) |
std::vector< std::string > | anonymous_namespace{NativeCodegen.cpp}::get_agg_fnames (const std::vector< Analyzer::Expr * > &target_exprs, const bool is_group_by) |
template<typename InstType > | |
llvm::Value * | anonymous_namespace{NativeCodegen.cpp}::find_variable_in_basic_block (llvm::Function *func, std::string bb_name, std::string variable_name) |
size_t | anonymous_namespace{NativeCodegen.cpp}::get_shared_memory_size (const bool shared_mem_used, const QueryMemoryDescriptor *query_mem_desc_ptr) |
bool | anonymous_namespace{NativeCodegen.cpp}::has_count_expr (RelAlgExecutionUnit const &ra_exe_unit) |
bool | anonymous_namespace{NativeCodegen.cpp}::has_case_expr_within_groupby_expr (RelAlgExecutionUnit const &ra_exe_unit) |
bool | anonymous_namespace{NativeCodegen.cpp}::is_gpu_shared_mem_supported (const QueryMemoryDescriptor *query_mem_desc_ptr, const RelAlgExecutionUnit &ra_exe_unit, const CudaMgr_Namespace::CudaMgr *cuda_mgr, const ExecutorDeviceType device_type, const unsigned cuda_blocksize, const unsigned num_blocks_per_mp) |
std::string | anonymous_namespace{NativeCodegen.cpp}::serialize_llvm_metadata_footnotes (llvm::Function *query_func, CgenState *cgen_state) |
std::vector< llvm::Value * > | generate_column_heads_load (const int num_columns, llvm::Value *byte_stream_arg, llvm::IRBuilder<> &ir_builder, llvm::LLVMContext &ctx) |
Variables | |
float | g_fraction_code_cache_to_evict = 0.2 |
const std::string | anonymous_namespace{NativeCodegen.cpp}::cuda_rt_decls |
constexpr std::array < std::string_view, 18 > | TARGET_RUNTIME_FUNCTIONS_FOR_MODULE_CLONING |
#define SHOW_DEFINED | ( | MODULE | ) |
Definition at line 143 of file NativeCodegen.cpp.
#define SHOW_FUNCTIONS | ( | MODULE | ) |
Definition at line 149 of file NativeCodegen.cpp.
std::vector<llvm::Value*> generate_column_heads_load | ( | const int | num_columns, |
llvm::Value * | byte_stream_arg, | ||
llvm::IRBuilder<> & | ir_builder, | ||
llvm::LLVMContext & | ctx | ||
) |
Loads individual columns from a single, packed pointers buffer (the byte stream arg)
Definition at line 3453 of file NativeCodegen.cpp.
Referenced by TableFunctionCompilationContext::generateEntryPoint().
std::map<std::string, std::string> get_device_parameters | ( | bool | cpu_only | ) |
Definition at line 970 of file NativeCodegen.cpp.
llvm::StringRef get_gpu_data_layout | ( | ) |
Definition at line 962 of file NativeCodegen.cpp.
llvm::StringRef get_gpu_target_triple_string | ( | ) |
Definition at line 958 of file NativeCodegen.cpp.
References DEBUG_TIMER.
std::unique_ptr<llvm::Module> read_llvm_module_from_bc_file | ( | const std::string & | bc_filename, |
llvm::LLVMContext & | context | ||
) |
Definition at line 1583 of file NativeCodegen.cpp.
Referenced by Executor::update_extension_modules().
std::unique_ptr<llvm::Module> read_llvm_module_from_ir_file | ( | const std::string & | udf_ir_filename, |
llvm::LLVMContext & | ctx, | ||
bool | is_gpu = false |
||
) |
Definition at line 1598 of file NativeCodegen.cpp.
Referenced by Executor::update_extension_modules().
std::unique_ptr<llvm::Module> read_llvm_module_from_ir_string | ( | const std::string & | udf_ir_string, |
llvm::LLVMContext & | ctx, | ||
bool | is_gpu = false |
||
) |
Definition at line 1623 of file NativeCodegen.cpp.
Referenced by Executor::update_extension_modules().
void verify_function_ir | ( | const llvm::Function * | func | ) |
Definition at line 388 of file NativeCodegen.cpp.
References logger::FATAL, and LOG.
Referenced by GpuSharedMemCodeBuilder::codegen(), spatial_type::Transform::codegen(), anonymous_namespace{JoinLoopTest.cpp}::create_loop_test_function(), TableFunctionCompilationContext::generateEntryPoint(), StubGenerator::generateStub(), and translate_function().
float g_fraction_code_cache_to_evict = 0.2 |
Definition at line 83 of file NativeCodegen.cpp.
Referenced by CommandLineOptions::fillDeveloperOptions().
constexpr std::array<std::string_view, 18> TARGET_RUNTIME_FUNCTIONS_FOR_MODULE_CLONING |
Definition at line 1556 of file NativeCodegen.cpp.