|
void | visit (const Allocate *) override |
| Posix implementation of Allocate.
|
|
void | visit (const Free *) override |
| Generate code for a free node.
|
|
std::string | get_allocation_name (const std::string &n) override |
| Get a unique name for the actual block of memory that an allocate node uses.
|
|
void | visit (const IntImm *) override |
| Generate code for various IR nodes.
|
|
void | visit (const UIntImm *) override |
|
void | visit (const FloatImm *) override |
|
void | visit (const StringImm *) override |
|
void | visit (const Cast *) override |
|
void | visit (const Reinterpret *) override |
|
void | visit (const Variable *) override |
|
void | visit (const Add *) override |
|
void | visit (const Sub *) override |
|
void | visit (const Mul *) override |
|
void | visit (const Div *) override |
|
void | visit (const Mod *) override |
|
void | visit (const Min *) override |
|
void | visit (const Max *) override |
|
void | visit (const EQ *) override |
|
void | visit (const NE *) override |
|
void | visit (const LT *) override |
|
void | visit (const LE *) override |
|
void | visit (const GT *) override |
|
void | visit (const GE *) override |
|
void | visit (const And *) override |
|
void | visit (const Or *) override |
|
void | visit (const Not *) override |
|
void | visit (const Select *) override |
|
void | visit (const Load *) override |
|
void | visit (const Ramp *) override |
|
void | visit (const Broadcast *) override |
|
void | visit (const Call *) override |
|
void | visit (const Let *) override |
|
void | visit (const LetStmt *) override |
|
void | visit (const AssertStmt *) override |
|
void | visit (const ProducerConsumer *) override |
|
void | visit (const For *) override |
|
void | visit (const Store *) override |
|
void | visit (const Block *) override |
|
void | visit (const IfThenElse *) override |
|
void | visit (const Evaluate *) override |
|
void | visit (const Shuffle *) override |
|
void | visit (const VectorReduce *) override |
|
void | visit (const Prefetch *) override |
|
void | visit (const Atomic *) override |
|
void | visit (const Provide *) override |
| These IR nodes should have been removed during lowering.
|
|
void | visit (const Realize *) override |
|
virtual void | visit (const Fork *) |
|
virtual void | visit (const Acquire *) |
|
virtual void | visit (const HoistedStorage *) |
|
| CodeGen_LLVM (const Target &t) |
|
virtual void | compile_func (const LoweredFunc &func, const std::string &simple_name, const std::string &extern_name) |
| Compile a specific halide declaration into the llvm Module.
|
|
virtual void | compile_buffer (const Buffer<> &buffer) |
|
virtual void | begin_func (LinkageType linkage, const std::string &simple_name, const std::string &extern_name, const std::vector< LoweredArgument > &args) |
| Helper functions for compiling Halide functions to llvm functions.
|
|
virtual void | end_func (const std::vector< LoweredArgument > &args) |
|
virtual std::string | mcpu_target () const =0 |
| What should be passed as -mcpu (warning: implies attrs!), -mattrs, and related for compilation.
|
|
virtual std::string | mcpu_tune () const =0 |
|
virtual std::string | mattrs () const =0 |
|
virtual std::string | mabi () const |
|
virtual bool | use_soft_float_abi () const =0 |
|
virtual bool | use_pic () const |
|
virtual bool | promote_indices () const |
| Should indexing math be promoted to 64-bit on platforms with 64-bit pointers?
|
|
virtual int | native_vector_bits () const =0 |
| What's the natural vector bit-width to use for loads, stores, etc.
|
|
virtual int | maximum_vector_bits () const |
| Used to decide whether to break a vector up into multiple smaller operations.
|
|
virtual int | target_vscale () const |
| For architectures that have vscale vectors, return the constant vscale to use.
|
|
virtual Type | upgrade_type_for_arithmetic (const Type &) const |
| Return the type in which arithmetic should be done for the given storage type.
|
|
virtual Type | upgrade_type_for_storage (const Type &) const |
| Return the type that a given Halide type should be stored/loaded from memory as.
|
|
virtual Type | upgrade_type_for_argument_passing (const Type &) const |
| Return the type that a Halide type should be passed in and out of functions as.
|
|
virtual void | init_context () |
| Grab all the context specific internal state.
|
|
virtual void | init_module () |
| Initialize the CodeGen_LLVM internal state to compile a fresh module.
|
|
void | optimize_module () |
| Run all of llvm's optimization passes on the module.
|
|
void | sym_push (const std::string &name, llvm::Value *value) |
| Add an entry to the symbol table, hiding previous entries with the same name.
|
|
void | sym_pop (const std::string &name) |
| Remove an entry for the symbol table, revealing any previous entries with the same name.
|
|
llvm::Value * | sym_get (const std::string &name, bool must_succeed=true) const |
| Fetch an entry from the symbol table.
|
|
bool | sym_exists (const std::string &name) const |
| Test if an item exists in the symbol table.
|
|
llvm::FunctionType * | signature_to_type (const ExternSignature &signature) |
| Given a Halide ExternSignature, return the equivalent llvm::FunctionType.
|
|
llvm::Value * | codegen (const Expr &) |
| Emit code that evaluates an expression, and return the llvm representation of the result of the expression.
|
|
void | codegen (const Stmt &) |
| Emit code that runs a statement.
|
|
void | scalarize (const Expr &) |
| Codegen a vector Expr by codegenning each lane and combining.
|
|
llvm::Value * | register_destructor (llvm::Function *destructor_fn, llvm::Value *obj, DestructorType when) |
|
void | trigger_destructor (llvm::Function *destructor_fn, llvm::Value *stack_slot) |
| Call a destructor early.
|
|
llvm::BasicBlock * | get_destructor_block () |
| Retrieves the block containing the error handling code.
|
|
void | create_assertion (llvm::Value *condition, const Expr &message, llvm::Value *error_code=nullptr) |
| Codegen an assertion.
|
|
void | codegen_asserts (const std::vector< const AssertStmt * > &asserts) |
| Codegen a block of asserts with pure conditions.
|
|
void | return_with_error_code (llvm::Value *error_code) |
| Return the the pipeline with the given error code.
|
|
llvm::Constant * | create_string_constant (const std::string &str) |
| Put a string constant in the module as a global variable and return a pointer to it.
|
|
llvm::Constant * | create_binary_blob (const std::vector< char > &data, const std::string &name, bool constant=true) |
| Put a binary blob in the module as a global variable and return a pointer to it.
|
|
llvm::Value * | create_broadcast (llvm::Value *, int lanes) |
| Widen an llvm scalar into an llvm vector with the given number of lanes.
|
|
llvm::Value * | codegen_buffer_pointer (const std::string &buffer, Type type, llvm::Value *index) |
| Generate a pointer into a named buffer at a given index, of a given type.
|
|
llvm::Value * | codegen_buffer_pointer (const std::string &buffer, Type type, Expr index) |
|
llvm::Value * | codegen_buffer_pointer (llvm::Value *base_address, Type type, Expr index) |
|
llvm::Value * | codegen_buffer_pointer (llvm::Value *base_address, Type type, llvm::Value *index) |
|
std::string | mangle_llvm_type (llvm::Type *type) |
| Return type string for LLVM type using LLVM IR intrinsic type mangling.
|
|
llvm::Value * | make_halide_type_t (const Type &) |
| Turn a Halide Type into an llvm::Value representing a constant halide_type_t.
|
|
void | add_tbaa_metadata (llvm::Instruction *inst, std::string buffer, const Expr &index) |
| Mark a load or store with type-based-alias-analysis metadata so that llvm knows it can reorder loads and stores across different buffers.
|
|
void | function_does_not_access_memory (llvm::Function *fn) |
| Add the appropriate function attribute to tell LLVM that the function doesn't access memory.
|
|
virtual llvm::Type * | llvm_type_of (const Type &) const |
| Get the llvm type equivalent to the given halide type in the current context.
|
|
llvm::Type * | llvm_type_of (llvm::LLVMContext *context, Halide::Type t, int effective_vscale) const |
| Get the llvm type equivalent to a given halide type.
|
|
llvm::Value * | create_alloca_at_entry (llvm::Type *type, int n, bool zero_initialize=false, const std::string &name="") |
| Perform an alloca at the function entrypoint.
|
|
llvm::Value * | get_user_context () const |
| The user_context argument.
|
|
virtual llvm::Value * | interleave_vectors (const std::vector< llvm::Value * > &) |
| Implementation of the intrinsic call to interleave_vectors.
|
|
llvm::Function * | get_llvm_intrin (const Type &ret_type, const std::string &name, const std::vector< Type > &arg_types, bool scalars_are_vectors=false) |
| Get an LLVM intrinsic declaration.
|
|
llvm::Function * | get_llvm_intrin (llvm::Type *ret_type, const std::string &name, const std::vector< llvm::Type * > &arg_types) |
|
llvm::Function * | declare_intrin_overload (const std::string &name, const Type &ret_type, const std::string &impl_name, std::vector< Type > arg_types, bool scalars_are_vectors=false) |
| Declare an intrinsic function that participates in overload resolution.
|
|
void | declare_intrin_overload (const std::string &name, const Type &ret_type, llvm::Function *impl, std::vector< Type > arg_types) |
|
llvm::Value * | call_overloaded_intrin (const Type &result_type, const std::string &name, const std::vector< Expr > &args) |
| Call an overloaded intrinsic function.
|
|
llvm::Value * | call_intrin (const Type &t, int intrin_lanes, const std::string &name, std::vector< Expr >) |
| Generate a call to a vector intrinsic or runtime inlined function.
|
|
llvm::Value * | call_intrin (const Type &t, int intrin_lanes, llvm::Function *intrin, std::vector< Expr >) |
|
llvm::Value * | call_intrin (const llvm::Type *t, int intrin_lanes, const std::string &name, std::vector< llvm::Value * >, bool scalable_vector_result=false, bool is_reduction=false) |
|
llvm::Value * | call_intrin (const llvm::Type *t, int intrin_lanes, llvm::Function *intrin, std::vector< llvm::Value * >, bool is_reduction=false) |
|
virtual llvm::Value * | slice_vector (llvm::Value *vec, int start, int extent) |
| Take a slice of lanes out of an llvm vector.
|
|
virtual llvm::Value * | concat_vectors (const std::vector< llvm::Value * > &) |
| Concatenate a bunch of llvm vectors.
|
|
virtual llvm::Value * | shuffle_vectors (llvm::Value *a, llvm::Value *b, const std::vector< int > &indices) |
| Create an LLVM shuffle vectors instruction.
|
|
llvm::Value * | shuffle_vectors (llvm::Value *v, const std::vector< int > &indices) |
| Shorthand for shuffling a single vector.
|
|
std::pair< llvm::Function *, int > | find_vector_runtime_function (const std::string &name, int lanes) |
| Go looking for a vector version of a runtime function.
|
|
virtual bool | supports_atomic_add (const Type &t) const |
|
virtual void | codegen_vector_reduce (const VectorReduce *op, const Expr &init) |
| Compile a horizontal reduction that starts with an explicit initial value.
|
|
virtual bool | supports_call_as_float16 (const Call *op) const |
| Can we call this operation with float16 type? This is used to avoid "emulated" equivalent code-gen in case target has FP16 feature.
|
|
llvm::Value * | simple_call_intrin (const std::string &intrin, const std::vector< llvm::Value * > &args, llvm::Type *result_type) |
| call_intrin does far too much to be useful and generally breaks things when one has carefully set things up for a specific architecture.
|
|
llvm::Value * | normalize_fixed_scalable_vector_type (llvm::Type *desired_type, llvm::Value *result) |
| Ensure that a vector value is either fixed or vscale depending to match desired_type.
|
|
llvm::Value * | convert_fixed_or_scalable_vector_type (llvm::Value *arg, llvm::Type *desired_type) |
| Convert between two LLVM vectors of potentially different scalable/fixed and size.
|
|
llvm::Value * | fixed_to_scalable_vector_type (llvm::Value *fixed) |
| Convert an LLVM fixed vector value to the corresponding vscale vector value.
|
|
llvm::Value * | scalable_to_fixed_vector_type (llvm::Value *scalable) |
| Convert an LLVM vscale vector value to the corresponding fixed vector value.
|
|
int | get_vector_num_elements (const llvm::Type *t) |
| Get number of vector elements, taking into account scalable vectors.
|
|
llvm::Type * | get_vector_type (llvm::Type *, int n, VectorTypeConstraint type_constraint=VectorTypeConstraint::None) const |
|
llvm::Constant * | get_splat (int lanes, llvm::Constant *value, VectorTypeConstraint type_constraint=VectorTypeConstraint::None) const |
|
llvm::Value * | match_vector_type_scalable (llvm::Value *value, VectorTypeConstraint constraint) |
| Make sure a value type has the same scalable/fixed vector type as a guide.
|
|
llvm::Value * | match_vector_type_scalable (llvm::Value *value, llvm::Type *guide) |
|
llvm::Value * | match_vector_type_scalable (llvm::Value *value, llvm::Value *guide) |
|
bool | try_vector_predication_comparison (const std::string &name, const Type &result_type, MaskVariant mask, llvm::Value *a, llvm::Value *b, const char *cmp_op) |
| Generate a vector predicated comparison intrinsic call if use_llvm_vp_intrinsics is true and result_type is a vector type.
|
|
bool | try_vector_predication_intrinsic (const std::string &name, VPResultType result_type, int32_t length, MaskVariant mask, std::vector< VPArg > args) |
| Generate an intrisic call if use_llvm_vp_intrinsics is true and length is greater than 1.
|
|
llvm::Value * | codegen_dense_vector_load (const Load *load, llvm::Value *vpred=nullptr, bool slice_to_native=true) |
| Generate a basic dense vector load, with an optional predicate and control over whether or not we should slice the load into native vectors.
|
|