OmniSciDB  ba1bac9284
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ReductionInterpreterImpl Class Reference

Public Member Functions

 ReductionInterpreterImpl (const std::vector< ReductionInterpreter::EvalValue > &vars)
 
std::optional
< ReductionInterpreter::EvalValue
ret () const
 

Static Public Member Functions

static void runGetElementPtr (const Instruction *instruction, ReductionInterpreterImpl *interpreter)
 
static void runLoad (const Instruction *instruction, ReductionInterpreterImpl *interpreter)
 
static void runICmp (const Instruction *instruction, ReductionInterpreterImpl *interpreter)
 
static void runBinaryOperator (const Instruction *instruction, ReductionInterpreterImpl *interpreter)
 
static void runCast (const Instruction *instruction, ReductionInterpreterImpl *interpreter)
 
static void runRet (const Instruction *instruction, ReductionInterpreterImpl *interpreter)
 
static void runCall (const Instruction *instruction, ReductionInterpreterImpl *interpreter)
 
static void runExternalCall (const Instruction *instruction, ReductionInterpreterImpl *interpreter)
 
static void runAlloca (const Instruction *instruction, ReductionInterpreterImpl *interpreter)
 
static void runMemCpy (const Instruction *instruction, ReductionInterpreterImpl *interpreter)
 
static void runReturnEarly (const Instruction *instruction, ReductionInterpreterImpl *interpreter)
 
static void runFor (const Instruction *instruction, ReductionInterpreterImpl *interpreter)
 

Private Member Functions

void setVar (const Value *var, ReductionInterpreter::EvalValue value)
 

Static Private Member Functions

template<class Call >
static std::vector
< ReductionInterpreter::EvalValue
getCallInputs (const Call *call, const ReductionInterpreterImpl *interpreter)
 
template<class Call >
static StubGenerator::Stub bindStub (const Call *call)
 

Private Attributes

std::vector
< ReductionInterpreter::EvalValue
vars_
 
std::vector< std::vector
< int8_t > > 
alloca_buffers_
 
std::optional
< ReductionInterpreter::EvalValue
ret_ = std::nullopt
 

Detailed Description

Definition at line 56 of file ResultSetReductionInterpreter.cpp.

Constructor & Destructor Documentation

ReductionInterpreterImpl::ReductionInterpreterImpl ( const std::vector< ReductionInterpreter::EvalValue > &  vars)
inline

Definition at line 58 of file ResultSetReductionInterpreter.cpp.

59  : vars_(vars) {}
std::vector< ReductionInterpreter::EvalValue > vars_

Member Function Documentation

template<class Call >
static StubGenerator::Stub ReductionInterpreterImpl::bindStub ( const Call call)
inlinestaticprivate

Definition at line 333 of file ResultSetReductionInterpreter.cpp.

References Call::arguments(), Call::cached_callee(), Call::callee_name(), CHECK, Call::external(), StubGenerator::generateStub(), anonymous_namespace{ResultSetReductionInterpreter.cpp}::get_value_types(), Call::set_cached_callee(), and Value::type().

Referenced by runCall(), and runExternalCall().

333  {
334  const auto func_ptr =
335  call->cached_callee()
336  ? reinterpret_cast<StubGenerator::Stub>(call->cached_callee())
338  get_value_types(call->arguments()),
339  call->type(),
340  call->external());
341  CHECK(func_ptr);
342  call->set_cached_callee(reinterpret_cast<void*>(func_ptr));
343  return func_ptr;
344  }
bool external() const
Type type() const
static Stub generateStub(const std::string &name, const std::vector< Type > &arg_types, const Type ret_type, const bool is_external)
const std::string & callee_name() const
std::vector< Type > get_value_types(const std::vector< const Value * > &values)
void * cached_callee() const
ReductionInterpreter::EvalValue(*)(void *output_handle, const void *inputs_handle) Stub
#define CHECK(condition)
Definition: Logger.h:206
void set_cached_callee(void *cached_callee) const
const std::vector< const Value * > & arguments() const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class Call >
static std::vector<ReductionInterpreter::EvalValue> ReductionInterpreterImpl::getCallInputs ( const Call call,
const ReductionInterpreterImpl interpreter 
)
inlinestaticprivate

Definition at line 320 of file ResultSetReductionInterpreter.cpp.

References Call::arguments(), and vars_.

Referenced by runCall(), and runExternalCall().

322  {
323  std::vector<ReductionInterpreter::EvalValue> inputs;
324  inputs.reserve(interpreter->vars_.size());
325  for (const auto argument : call->arguments()) {
326  inputs.push_back(interpreter->vars_[argument->id()]);
327  }
328  return inputs;
329  }
std::vector< ReductionInterpreter::EvalValue > vars_
const std::vector< const Value * > & arguments() const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::optional<ReductionInterpreter::EvalValue> ReductionInterpreterImpl::ret ( ) const
inline

Definition at line 61 of file ResultSetReductionInterpreter.cpp.

References ret_.

Referenced by runCall(), runFor(), and runRet().

61 { return ret_; }
std::optional< ReductionInterpreter::EvalValue > ret_

+ Here is the caller graph for this function:

static void ReductionInterpreterImpl::runAlloca ( const Instruction instruction,
ReductionInterpreterImpl interpreter 
)
inlinestatic

Definition at line 248 of file ResultSetReductionInterpreter.cpp.

References alloca_buffers_, CHECK, anonymous_namespace{ResultSetReductionInterpreter.cpp}::get_element_size(), is_integer_type(), ReductionInterpreter::EvalValue::mutable_ptr, ret_, setVar(), and vars_.

Referenced by Alloca::run().

249  {
250  CHECK(!interpreter->ret_) << "Function has already returned";
251  const auto alloca = static_cast<const Alloca*>(instruction);
252  const auto element_size = get_element_size(alloca->type());
253  CHECK(is_integer_type(alloca->array_size()->type()));
254  const auto array_size = interpreter->vars_[alloca->array_size()->id()];
255  interpreter->alloca_buffers_.emplace_back(element_size * array_size.int_val);
257  eval_value.mutable_ptr = interpreter->alloca_buffers_.back().data();
258  interpreter->setVar(alloca, eval_value);
259  }
void setVar(const Value *var, ReductionInterpreter::EvalValue value)
std::vector< ReductionInterpreter::EvalValue > vars_
std::optional< ReductionInterpreter::EvalValue > ret_
#define CHECK(condition)
Definition: Logger.h:206
std::vector< std::vector< int8_t > > alloca_buffers_
bool is_integer_type(const Type type)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ReductionInterpreterImpl::runBinaryOperator ( const Instruction instruction,
ReductionInterpreterImpl interpreter 
)
inlinestatic

Definition at line 146 of file ResultSetReductionInterpreter.cpp.

References BinaryOperator::Add, CHECK, logger::FATAL, is_integer_type(), LOG, ReductionInterpreter::MakeEvalValue(), BinaryOperator::Mul, run_benchmark_import::result, ret_, setVar(), and vars_.

Referenced by BinaryOperator::run().

147  {
148  CHECK(!interpreter->ret_) << "Function has already returned";
149  const auto binary_operator = static_cast<const BinaryOperator*>(instruction);
150  CHECK(is_integer_type(binary_operator->type()));
151  const auto lhs = interpreter->vars_[binary_operator->lhs()->id()];
152  const auto rhs = interpreter->vars_[binary_operator->rhs()->id()];
153  int64_t result = 0;
154  switch (binary_operator->op()) {
156  result = lhs.int_val + rhs.int_val;
157  break;
158  }
160  result = lhs.int_val * rhs.int_val;
161  break;
162  }
163  default: {
164  LOG(FATAL) << "Binary operator not supported: "
165  << static_cast<int>(binary_operator->op());
166  }
167  }
168  interpreter->setVar(binary_operator, ReductionInterpreter::MakeEvalValue(result));
169  }
void setVar(const Value *var, ReductionInterpreter::EvalValue value)
#define LOG(tag)
Definition: Logger.h:200
std::vector< ReductionInterpreter::EvalValue > vars_
static EvalValue MakeEvalValue(const T &val)
std::optional< ReductionInterpreter::EvalValue > ret_
#define CHECK(condition)
Definition: Logger.h:206
bool is_integer_type(const Type type)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ReductionInterpreterImpl::runCall ( const Instruction instruction,
ReductionInterpreterImpl interpreter 
)
inlinestatic

Definition at line 209 of file ResultSetReductionInterpreter.cpp.

References bindStub(), CHECK, getCallInputs(), ret(), ret_, ReductionInterpreter::run(), setVar(), and Void.

Referenced by Call::run().

210  {
211  CHECK(!interpreter->ret_) << "Function has already returned";
212  const auto call = static_cast<const Call*>(instruction);
213  if (call->callee()) {
214  // Call one of the functions generated to implement reduction.
215  const auto inputs = getCallInputs(call, interpreter);
216  auto ret = ReductionInterpreter::run(call->callee(), inputs);
217  if (call->type() != Type::Void) {
218  // Assign the returned value.
219  interpreter->setVar(call, ret);
220  }
221  } else {
222  // Call an internal runtime function.
223  const auto func_ptr = bindStub(call);
224  const auto inputs = getCallInputs(call, interpreter);
226  func_ptr(&ret, &inputs);
227  if (call->type() != Type::Void) {
228  // Assign the returned value.
229  interpreter->setVar(call, ret);
230  }
231  }
232  return;
233  }
void setVar(const Value *var, ReductionInterpreter::EvalValue value)
static std::vector< ReductionInterpreter::EvalValue > getCallInputs(const Call *call, const ReductionInterpreterImpl *interpreter)
static EvalValue run(const Function *function, const std::vector< EvalValue > &inputs)
std::optional< ReductionInterpreter::EvalValue > ret() const
std::optional< ReductionInterpreter::EvalValue > ret_
#define CHECK(condition)
Definition: Logger.h:206
static StubGenerator::Stub bindStub(const Call *call)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ReductionInterpreterImpl::runCast ( const Instruction instruction,
ReductionInterpreterImpl interpreter 
)
inlinestatic

Definition at line 171 of file ResultSetReductionInterpreter.cpp.

References Cast::BitCast, CHECK, logger::FATAL, is_integer_type(), is_pointer_type(), LOG, ReductionInterpreter::MakeEvalValue(), ret_, setVar(), Cast::SExt, Cast::Trunc, and vars_.

Referenced by Cast::run().

172  {
173  CHECK(!interpreter->ret_) << "Function has already returned";
174  const auto cast = static_cast<const Cast*>(instruction);
175  const auto source = interpreter->vars_[cast->source()->id()];
176  // Given that evaluated values store all values as int64_t or void*, Trunc and SExt
177  // are no-op. The information about the type is already part of the destination.
178  switch (cast->op()) {
179  case Cast::CastOp::Trunc:
180  case Cast::CastOp::SExt: {
181  CHECK(is_integer_type(cast->source()->type()));
182  interpreter->setVar(cast, ReductionInterpreter::MakeEvalValue(source.int_val));
183  break;
184  }
185  case Cast::CastOp::BitCast: {
186  CHECK(is_pointer_type(cast->source()->type()));
187  interpreter->setVar(cast, ReductionInterpreter::MakeEvalValue(source.ptr));
188  break;
189  }
190  default: {
191  LOG(FATAL) << "Cast operator not supported: " << static_cast<int>(cast->op());
192  }
193  }
194  }
void setVar(const Value *var, ReductionInterpreter::EvalValue value)
#define LOG(tag)
Definition: Logger.h:200
std::vector< ReductionInterpreter::EvalValue > vars_
static EvalValue MakeEvalValue(const T &val)
std::optional< ReductionInterpreter::EvalValue > ret_
#define CHECK(condition)
Definition: Logger.h:206
bool is_pointer_type(const Type type)
bool is_integer_type(const Type type)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ReductionInterpreterImpl::runExternalCall ( const Instruction instruction,
ReductionInterpreterImpl interpreter 
)
inlinestatic

Definition at line 235 of file ResultSetReductionInterpreter.cpp.

References ExternalCall::arguments(), bindStub(), CHECK, anonymous_namespace{ResultSetReductionInterpreter.cpp}::get_value_types(), getCallInputs(), ret_, and setVar().

Referenced by ExternalCall::run().

236  {
237  CHECK(!interpreter->ret_) << "Function has already returned";
238  const auto external_call = static_cast<const ExternalCall*>(instruction);
239  const auto& arguments = external_call->arguments();
240  const auto argument_types = get_value_types(arguments);
241  const auto func_ptr = bindStub(external_call);
242  const auto inputs = getCallInputs(external_call, interpreter);
244  func_ptr(&output, &inputs);
245  interpreter->setVar(external_call, output);
246  }
void setVar(const Value *var, ReductionInterpreter::EvalValue value)
static std::vector< ReductionInterpreter::EvalValue > getCallInputs(const Call *call, const ReductionInterpreterImpl *interpreter)
const std::vector< const Value * > & arguments() const
std::vector< Type > get_value_types(const std::vector< const Value * > &values)
std::optional< ReductionInterpreter::EvalValue > ret_
#define CHECK(condition)
Definition: Logger.h:206
static StubGenerator::Stub bindStub(const Call *call)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ReductionInterpreterImpl::runFor ( const Instruction instruction,
ReductionInterpreterImpl interpreter 
)
inlinestatic

Definition at line 289 of file ResultSetReductionInterpreter.cpp.

References alloca_buffers_, CHECK, i, is_integer_type(), ret(), ret_, ReductionInterpreter::run(), and vars_.

Referenced by For::run().

290  {
291  CHECK(!interpreter->ret_) << "Function has already returned";
292  const size_t saved_alloca_count = interpreter->alloca_buffers_.size();
293  const auto for_loop = static_cast<const For*>(instruction);
294  CHECK(is_integer_type(for_loop->start()->type()));
295  CHECK(is_integer_type(for_loop->end()->type()));
296  const auto start = interpreter->vars_[for_loop->start()->id()];
297  const auto end = interpreter->vars_[for_loop->end()->id()];
298  for (int64_t i = start.int_val; i < end.int_val; ++i) {
299  // The start and end indices are absolute, but the iteration happens from 0.
300  // Subtract the start index before setting the iterator.
301  interpreter->vars_[for_loop->iter()->id()].int_val = i - start.int_val;
302  auto ret = ReductionInterpreter::run(for_loop->body(), interpreter->vars_);
303  if (ret) {
304  interpreter->ret_ = *ret;
305  break;
306  }
307  }
308  // Pop all the alloca buffers allocated by the code in the loop.
309  interpreter->alloca_buffers_.resize(saved_alloca_count);
310  }
std::vector< ReductionInterpreter::EvalValue > vars_
static EvalValue run(const Function *function, const std::vector< EvalValue > &inputs)
std::optional< ReductionInterpreter::EvalValue > ret() const
std::optional< ReductionInterpreter::EvalValue > ret_
#define CHECK(condition)
Definition: Logger.h:206
std::vector< std::vector< int8_t > > alloca_buffers_
bool is_integer_type(const Type type)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ReductionInterpreterImpl::runGetElementPtr ( const Instruction instruction,
ReductionInterpreterImpl interpreter 
)
inlinestatic

Definition at line 64 of file ResultSetReductionInterpreter.cpp.

References CHECK, anonymous_namespace{ResultSetReductionInterpreter.cpp}::get_element_size(), ReductionInterpreter::MakeEvalValue(), ret_, setVar(), and vars_.

Referenced by GetElementPtr::run().

65  {
66  CHECK(!interpreter->ret_) << "Function has already returned";
67  const auto gep = static_cast<const GetElementPtr*>(instruction);
68  const auto element_size = get_element_size(gep->base()->type());
69  const auto base = interpreter->vars_[gep->base()->id()];
70  const auto index = interpreter->vars_[gep->index()->id()];
71  auto result_ptr =
72  reinterpret_cast<const int8_t*>(base.ptr) + index.int_val * element_size;
73  interpreter->setVar(gep, ReductionInterpreter::MakeEvalValue(result_ptr));
74  }
void setVar(const Value *var, ReductionInterpreter::EvalValue value)
std::vector< ReductionInterpreter::EvalValue > vars_
static EvalValue MakeEvalValue(const T &val)
std::optional< ReductionInterpreter::EvalValue > ret_
#define CHECK(condition)
Definition: Logger.h:206

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ReductionInterpreterImpl::runICmp ( const Instruction instruction,
ReductionInterpreterImpl interpreter 
)
inlinestatic

Definition at line 121 of file ResultSetReductionInterpreter.cpp.

References CHECK, ICmp::EQ, logger::FATAL, is_integer_type(), LOG, ReductionInterpreter::MakeEvalValue(), ICmp::NE, run_benchmark_import::result, ret_, setVar(), and vars_.

Referenced by ICmp::run().

122  {
123  CHECK(!interpreter->ret_) << "Function has already returned";
124  const auto icmp = static_cast<const ICmp*>(instruction);
125  CHECK(is_integer_type(icmp->lhs()->type()));
126  CHECK(is_integer_type(icmp->rhs()->type()));
127  const auto lhs = interpreter->vars_[icmp->lhs()->id()];
128  const auto rhs = interpreter->vars_[icmp->rhs()->id()];
129  bool result = false;
130  switch (icmp->predicate()) {
131  case ICmp::Predicate::EQ: {
132  result = lhs.int_val == rhs.int_val;
133  break;
134  }
135  case ICmp::Predicate::NE: {
136  result = lhs.int_val != rhs.int_val;
137  break;
138  }
139  default: {
140  LOG(FATAL) << "Predicate not supported: " << static_cast<int>(icmp->predicate());
141  }
142  }
143  interpreter->setVar(icmp, ReductionInterpreter::MakeEvalValue(result));
144  }
void setVar(const Value *var, ReductionInterpreter::EvalValue value)
#define LOG(tag)
Definition: Logger.h:200
std::vector< ReductionInterpreter::EvalValue > vars_
static EvalValue MakeEvalValue(const T &val)
std::optional< ReductionInterpreter::EvalValue > ret_
#define CHECK(condition)
Definition: Logger.h:206
bool is_integer_type(const Type type)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ReductionInterpreterImpl::runLoad ( const Instruction instruction,
ReductionInterpreterImpl interpreter 
)
inlinestatic

Definition at line 76 of file ResultSetReductionInterpreter.cpp.

References CHECK, const, DoublePtr, logger::FATAL, FloatPtr, Int32Ptr, Int64Ptr, Int64PtrPtr, Int8Ptr, is_pointer_type(), LOG, ReductionInterpreter::MakeEvalValue(), ret_, setVar(), Load::source(), Value::type(), and vars_.

Referenced by Load::run().

77  {
78  CHECK(!interpreter->ret_) << "Function has already returned";
79  const auto load = static_cast<const Load*>(instruction);
80  const auto source_type = load->source()->type();
81  CHECK(is_pointer_type(source_type));
82  const auto source = interpreter->vars_[load->source()->id()];
83  switch (source_type) {
84  case Type::Int8Ptr: {
85  const auto int_val = *reinterpret_cast<const int8_t*>(source.ptr);
86  interpreter->setVar(load, ReductionInterpreter::MakeEvalValue(int_val));
87  break;
88  }
89  case Type::Int32Ptr: {
90  const auto int_val = *reinterpret_cast<const int32_t*>(source.ptr);
91  interpreter->setVar(load, ReductionInterpreter::MakeEvalValue(int_val));
92  break;
93  }
94  case Type::Int64Ptr: {
95  const auto int_val = *reinterpret_cast<const int64_t*>(source.ptr);
96  interpreter->setVar(load, ReductionInterpreter::MakeEvalValue(int_val));
97  break;
98  }
99  case Type::FloatPtr: {
100  const auto float_val = *reinterpret_cast<const float*>(source.ptr);
101  interpreter->setVar(load, ReductionInterpreter::MakeEvalValue(float_val));
102  break;
103  }
104  case Type::DoublePtr: {
105  const auto double_val = *reinterpret_cast<const double*>(source.ptr);
106  interpreter->setVar(load, ReductionInterpreter::MakeEvalValue(double_val));
107  break;
108  }
109  case Type::Int64PtrPtr: {
110  const auto int_ptr_val = *reinterpret_cast<const int64_t* const*>(source.ptr);
111  interpreter->setVar(load, ReductionInterpreter::MakeEvalValue(int_ptr_val));
112  break;
113  }
114  default: {
115  LOG(FATAL) << "Source pointer type not supported: "
116  << static_cast<int>(source_type);
117  }
118  }
119  }
void setVar(const Value *var, ReductionInterpreter::EvalValue value)
#define const
#define LOG(tag)
Definition: Logger.h:200
std::vector< ReductionInterpreter::EvalValue > vars_
Type type() const
const Value * source() const
static EvalValue MakeEvalValue(const T &val)
std::optional< ReductionInterpreter::EvalValue > ret_
#define CHECK(condition)
Definition: Logger.h:206
bool is_pointer_type(const Type type)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ReductionInterpreterImpl::runMemCpy ( const Instruction instruction,
ReductionInterpreterImpl interpreter 
)
inlinestatic

Definition at line 261 of file ResultSetReductionInterpreter.cpp.

References CHECK, run_benchmark_import::dest, is_integer_type(), is_pointer_type(), ret_, and vars_.

Referenced by MemCpy::run().

262  {
263  CHECK(!interpreter->ret_) << "Function has already returned";
264  const auto memcpy = static_cast<const MemCpy*>(instruction);
265  CHECK(is_pointer_type(memcpy->dest()->type()));
266  CHECK(is_pointer_type(memcpy->source()->type()));
267  CHECK(is_integer_type(memcpy->size()->type()));
268  const auto dest = interpreter->vars_[memcpy->dest()->id()];
269  const auto source = interpreter->vars_[memcpy->source()->id()];
270  const auto size = interpreter->vars_[memcpy->size()->id()];
271  ::memcpy(dest.mutable_ptr, source.ptr, size.int_val);
272  }
std::vector< ReductionInterpreter::EvalValue > vars_
std::optional< ReductionInterpreter::EvalValue > ret_
#define CHECK(condition)
Definition: Logger.h:206
bool is_pointer_type(const Type type)
bool is_integer_type(const Type type)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ReductionInterpreterImpl::runRet ( const Instruction instruction,
ReductionInterpreterImpl interpreter 
)
inlinestatic

Definition at line 196 of file ResultSetReductionInterpreter.cpp.

References CHECK, ret(), ret_, vars_, and Void.

Referenced by Ret::run().

197  {
198  CHECK(!interpreter->ret_) << "Function has already returned";
199  const auto ret = static_cast<const Ret*>(instruction);
200  if (ret->type() == Type::Void) {
201  // Even if the returned type is void, the return value still needs to be set to
202  // something to inform the caller that it should stop evaluating.
203  interpreter->ret_ = ReductionInterpreter::EvalValue{};
204  } else {
205  interpreter->ret_ = interpreter->vars_[ret->value()->id()];
206  }
207  }
std::vector< ReductionInterpreter::EvalValue > vars_
std::optional< ReductionInterpreter::EvalValue > ret() const
std::optional< ReductionInterpreter::EvalValue > ret_
#define CHECK(condition)
Definition: Logger.h:206

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ReductionInterpreterImpl::runReturnEarly ( const Instruction instruction,
ReductionInterpreterImpl interpreter 
)
inlinestatic

Definition at line 274 of file ResultSetReductionInterpreter.cpp.

References CHECK, Int1, ReductionInterpreter::MakeEvalValue(), ret_, and vars_.

Referenced by ReturnEarly::run().

275  {
276  CHECK(!interpreter->ret_) << "Function has already returned";
277  const auto ret_early = static_cast<const ReturnEarly*>(instruction);
278  CHECK(ret_early->cond()->type() == Type::Int1);
279  const auto cond = interpreter->vars_[ret_early->cond()->id()];
280 
281  auto error_code = ret_early->error_code();
282 
283  if (cond.int_val) {
284  auto rc = interpreter->vars_[error_code->id()].int_val;
285  interpreter->ret_ = ReductionInterpreter::MakeEvalValue(rc);
286  }
287  }
std::vector< ReductionInterpreter::EvalValue > vars_
static EvalValue MakeEvalValue(const T &val)
std::optional< ReductionInterpreter::EvalValue > ret_
#define CHECK(condition)
Definition: Logger.h:206

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ReductionInterpreterImpl::setVar ( const Value var,
ReductionInterpreter::EvalValue  value 
)
inlineprivate

Definition at line 314 of file ResultSetReductionInterpreter.cpp.

References Value::id(), and vars_.

Referenced by runAlloca(), runBinaryOperator(), runCall(), runCast(), runExternalCall(), runGetElementPtr(), runICmp(), and runLoad().

314  {
315  vars_[var->id()] = value;
316  }
size_t id() const
std::vector< ReductionInterpreter::EvalValue > vars_

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

std::vector<std::vector<int8_t> > ReductionInterpreterImpl::alloca_buffers_
private

Definition at line 349 of file ResultSetReductionInterpreter.cpp.

Referenced by runAlloca(), and runFor().

std::optional<ReductionInterpreter::EvalValue> ReductionInterpreterImpl::ret_ = std::nullopt
private

The documentation for this class was generated from the following file: