!466 MOT fixes and code cleanup

Merge pull request !466 from Vinoth Veeraraghavan/master
This commit is contained in:
opengauss-bot
2020-12-11 15:14:35 +08:00
committed by Gitee
75 changed files with 1880 additions and 1931 deletions

View File

@ -53,7 +53,7 @@
#include "access/redo_statistic_msg.h"
#include "portability/instr_time.h"
#include "replication/rto_statistic.h"
#include "storage/mot/jit_def.h"
const int NUM_PERCENTILE_COUNT = 2;
const int INIT_NUMA_ALLOC_COUNT = 32;
@ -544,6 +544,10 @@ typedef struct knl_g_bgworker_context {
volatile bool have_crashed_worker;
} knl_g_bgworker_context;
typedef struct knl_g_mot_context {
JitExec::JitExecMode jitExecMode;
} knl_g_mot_context;
typedef struct knl_instance_context {
knl_virtual_role role;
volatile int status;
@ -616,6 +620,7 @@ typedef struct knl_instance_context {
knl_g_rto_context rto_cxt;
knl_g_xlog_context xlog_cxt;
knl_g_numa_context numa_cxt;
knl_g_mot_context mot_cxt;
knl_g_bgworker_context bgworker_cxt;
} knl_instance_context;

View File

@ -2731,7 +2731,6 @@ typedef struct knl_t_mot_context {
// misc
uint8_t log_level;
bool init_codegen_once;
uint16_t currentThreadId;
int currentNumaNodeId;

View File

@ -159,6 +159,8 @@ public:
bool m_isCompleted;
long m_position;
private:
static FusionType GetMotFusionType(PlannedStmt* plannedStmt);
};
class SelectFusion : public OpFusion {

View File

@ -48,6 +48,18 @@ namespace JitExec {
// To use advanced WHERE clause operators, #define MOT_JIT_ADVANCED_WHERE_OP
// To enable features required for JIT testing, #define MOT_JIT_TEST
/** @enum JIT execution mode constants. */
enum JitExecMode : uint32_t {
/** @var Invalid execution mode. */
JIT_EXEC_MODE_INVALID,
/** @var LLVM execution mode. */
JIT_EXEC_MODE_LLVM,
/** @var TVM execution mode. */
JIT_EXEC_MODE_TVM
};
/** @enum JitCommandType Command types supported by jitted queries. */
enum JitCommandType : uint8_t {
/** @var Invalid command type. */

View File

@ -57,9 +57,6 @@ extern bool IsMotCodegenPrintEnabled();
/** @brief Queries for the per-session limit of JIT queries. */
extern uint32_t GetMotCodegenLimit();
/** @brief Turn off MOT JIT compilation and execution. */
extern void DisableMotCodegen();
/**
* @brief Queries whether a SQL query to be executed by MM Engine is jittable.
* @param query The parsed SQL query to examine.