Halide  12.0.1
Halide compiler and libraries
Halide::Internal::CodeGen_LLVM Class Referenceabstract

A code generator abstract base class. More...

#include <CodeGen_LLVM.h>

Inherits Halide::Internal::IRVisitor.

Inherited by Halide::Internal::CodeGen_Posix.

Classes

struct  Intrinsic
 Description of an intrinsic function overload. More...
 
struct  ParallelTask
 Codegen a call to do_parallel_tasks. More...
 

Public Member Functions

 ~CodeGen_LLVM () override
 
virtual std::unique_ptr< llvm::Module > compile (const Module &module)
 Takes a halide Module and compiles it to an llvm Module. More...
 
const Targetget_target () const
 The target we're generating code for. More...
 
void set_context (llvm::LLVMContext &context)
 Tell the code generator which LLVM context to use. More...
 
size_t get_requested_alloca_total () const
 
- Public Member Functions inherited from Halide::Internal::IRVisitor
 IRVisitor ()=default
 
virtual ~IRVisitor ()=default
 

Static Public Member Functions

static std::unique_ptr< CodeGen_LLVMnew_for_target (const Target &target, llvm::LLVMContext &context)
 Create an instance of CodeGen_LLVM suitable for the target. More...
 
static void initialize_llvm ()
 Initialize internal llvm state for the enabled targets. More...
 
static std::unique_ptr< llvm::Module > compile_trampolines (const Target &target, llvm::LLVMContext &context, const std::string &suffix, const std::vector< std::pair< std::string, ExternSignature >> &externs)
 

Protected Types

enum  DestructorType { Always , OnError , OnSuccess }
 Some destructors should always be called. More...
 

Protected Member Functions

 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. More...
 
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. More...
 
virtual void end_func (const std::vector< LoweredArgument > &args)
 
virtual std::string mcpu () const =0
 What should be passed as -mcpu, -mattrs, and related for compilation. More...
 
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? More...
 
virtual int native_vector_bits () const =0
 What's the natural vector bit-width to use for loads, stores, etc. More...
 
virtual Type upgrade_type_for_arithmetic (const Type &) const
 Return the type in which arithmetic should be done for the given storage type. More...
 
virtual Type upgrade_type_for_storage (const Type &) const
 Return the type that a given Halide type should be stored/loaded from memory as. More...
 
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. More...
 
virtual void init_context ()
 Grab all the context specific internal state. More...
 
virtual void init_module ()
 Initialize the CodeGen_LLVM internal state to compile a fresh module. More...
 
void add_external_code (const Module &halide_module)
 Add external_code entries to llvm module. More...
 
void optimize_module ()
 Run all of llvm's optimization passes on the module. More...
 
void sym_push (const std::string &name, llvm::Value *value)
 Add an entry to the symbol table, hiding previous entries with the same name. More...
 
void sym_pop (const std::string &name)
 Remove an entry for the symbol table, revealing any previous entries with the same name. More...
 
llvm::Value * sym_get (const std::string &name, bool must_succeed=true) const
 Fetch an entry from the symbol table. More...
 
bool sym_exists (const std::string &name) const
 Test if an item exists in the symbol table. More...
 
llvm::FunctionType * signature_to_type (const ExternSignature &signature)
 Given a Halide ExternSignature, return the equivalent llvm::FunctionType. More...
 
llvm::Value * codegen (const Expr &)
 Emit code that evaluates an expression, and return the llvm representation of the result of the expression. More...
 
void codegen (const Stmt &)
 Emit code that runs a statement. More...
 
void scalarize (const Expr &)
 Codegen a vector Expr by codegenning each lane and combining. More...
 
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. More...
 
llvm::BasicBlock * get_destructor_block ()
 Retrieves the block containing the error handling code. More...
 
void create_assertion (llvm::Value *condition, const Expr &message, llvm::Value *error_code=nullptr)
 Codegen an assertion. More...
 
void codegen_asserts (const std::vector< const AssertStmt * > &asserts)
 Codegen a block of asserts with pure conditions. More...
 
void get_parallel_tasks (const Stmt &s, std::vector< ParallelTask > &tasks, std::pair< std::string, int > prefix)
 
void do_parallel_tasks (const std::vector< ParallelTask > &tasks)
 
void do_as_parallel_task (const Stmt &s)
 
void return_with_error_code (llvm::Value *error_code)
 Return the the pipeline with the given error code. More...
 
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. More...
 
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. More...
 
llvm::Value * create_broadcast (llvm::Value *, int lanes)
 Widen an llvm scalar into an llvm vector with the given number of lanes. More...
 
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. More...
 
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)
 
llvm::Value * make_halide_type_t (const Type &)
 Turn a Halide Type into an llvm::Value representing a constant halide_type_t. More...
 
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. More...
 
virtual std::string get_allocation_name (const std::string &n)
 Get a unique name for the actual block of memory that an allocate node uses. More...
 
void visit (const IntImm *) override
 Generate code for various IR nodes. More...
 
void visit (const UIntImm *) override
 
void visit (const FloatImm *) override
 
void visit (const StringImm *) override
 
void visit (const Cast *) 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 Acquire *) override
 
void visit (const Store *) override
 
void visit (const Block *) override
 
void visit (const Fork *) 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 Allocate *) override=0
 Generate code for an allocate node. More...
 
void visit (const Free *) override=0
 Generate code for a free node. More...
 
void visit (const Provide *) override
 These IR nodes should have been removed during lowering. More...
 
void visit (const Realize *) override
 
virtual void prepare_for_early_exit ()
 If we have to bail out of a pipeline midway, this should inject the appropriate target-specific cleanup code. More...
 
virtual llvm::Type * llvm_type_of (const Type &) const
 Get the llvm type equivalent to the given halide type in the current context. More...
 
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. More...
 
llvm::Value * get_user_context () const
 The user_context argument. More...
 
virtual llvm::Value * interleave_vectors (const std::vector< llvm::Value * > &)
 Implementation of the intrinsic call to interleave_vectors. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
llvm::Value * call_intrin (const Type &t, int intrin_lanes, llvm::Function *intrin, std::vector< Expr >)
 
llvm::Value * call_intrin (llvm::Type *t, int intrin_lanes, const std::string &name, std::vector< llvm::Value * >)
 
llvm::Value * call_intrin (llvm::Type *t, int intrin_lanes, llvm::Function *intrin, std::vector< llvm::Value * >)
 
virtual llvm::Value * slice_vector (llvm::Value *vec, int start, int extent)
 Take a slice of lanes out of an llvm vector. More...
 
virtual llvm::Value * concat_vectors (const std::vector< llvm::Value * > &)
 Concatenate a bunch of llvm vectors. More...
 
virtual llvm::Value * shuffle_vectors (llvm::Value *a, llvm::Value *b, const std::vector< int > &indices)
 Create an LLVM shuffle vectors instruction. More...
 
llvm::Value * shuffle_vectors (llvm::Value *v, const std::vector< int > &indices)
 Shorthand for shuffling a vector with an undef vector. More...
 
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. More...
 
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. More...
 
virtual void visit (const IntImm *)
 
virtual void visit (const UIntImm *)
 
virtual void visit (const FloatImm *)
 
virtual void visit (const StringImm *)
 
virtual void visit (const Cast *)
 
virtual void visit (const Variable *)
 
virtual void visit (const Add *)
 
virtual void visit (const Sub *)
 
virtual void visit (const Mul *)
 
virtual void visit (const Div *)
 
virtual void visit (const Mod *)
 
virtual void visit (const Min *)
 
virtual void visit (const Max *)
 
virtual void visit (const EQ *)
 
virtual void visit (const NE *)
 
virtual void visit (const LT *)
 
virtual void visit (const LE *)
 
virtual void visit (const GT *)
 
virtual void visit (const GE *)
 
virtual void visit (const And *)
 
virtual void visit (const Or *)
 
virtual void visit (const Not *)
 
virtual void visit (const Select *)
 
virtual void visit (const Load *)
 
virtual void visit (const Ramp *)
 
virtual void visit (const Broadcast *)
 
virtual void visit (const Call *)
 
virtual void visit (const Let *)
 
virtual void visit (const LetStmt *)
 
virtual void visit (const AssertStmt *)
 
virtual void visit (const ProducerConsumer *)
 
virtual void visit (const For *)
 
virtual void visit (const Store *)
 
virtual void visit (const Provide *)
 
virtual void visit (const Allocate *)
 
virtual void visit (const Free *)
 
virtual void visit (const Realize *)
 
virtual void visit (const Block *)
 
virtual void visit (const IfThenElse *)
 
virtual void visit (const Evaluate *)
 
virtual void visit (const Shuffle *)
 
virtual void visit (const VectorReduce *)
 
virtual void visit (const Prefetch *)
 
virtual void visit (const Fork *)
 
virtual void visit (const Acquire *)
 
virtual void visit (const Atomic *)
 

Protected Attributes

std::unique_ptr< llvm::Module > module
 
llvm::Function * function
 
llvm::LLVMContext * context
 
llvm::IRBuilder< llvm::ConstantFolder, llvm::IRBuilderDefaultInserter > * builder
 
llvm::Value * value
 
llvm::MDNode * very_likely_branch
 
llvm::MDNode * default_fp_math_md
 
llvm::MDNode * strict_fp_math_md
 
std::vector< LoweredArgumentcurrent_function_args
 
Halide::Target target
 The target we're generating code for. More...
 
llvm::Type * void_t
 Some useful llvm types. More...
 
llvm::Type * i1_t
 
llvm::Type * i8_t
 
llvm::Type * i16_t
 
llvm::Type * i32_t
 
llvm::Type * i64_t
 
llvm::Type * f16_t
 
llvm::Type * f32_t
 
llvm::Type * f64_t
 
llvm::StructType * halide_buffer_t_type
 
llvm::StructType * type_t_type
 
llvm::StructType * dimension_t_type
 
llvm::StructType * metadata_t_type
 
llvm::StructType * argument_t_type
 
llvm::StructType * scalar_value_t_type
 
llvm::StructType * device_interface_t_type
 
llvm::StructType * pseudostack_slot_t_type
 
llvm::StructType * semaphore_t_type
 
llvm::StructType * semaphore_acquire_t_type
 
llvm::StructType * parallel_task_t_type
 
Expr wild_u1x_
 Some wildcard variables used for peephole optimizations in subclasses. More...
 
Expr wild_i8x_
 
Expr wild_u8x_
 
Expr wild_i16x_
 
Expr wild_u16x_
 
Expr wild_i32x_
 
Expr wild_u32x_
 
Expr wild_i64x_
 
Expr wild_u64x_
 
Expr wild_f32x_
 
Expr wild_f64x_
 
Expr wild_u1_
 
Expr wild_i8_
 
Expr wild_u8_
 
Expr wild_i16_
 
Expr wild_u16_
 
Expr wild_i32_
 
Expr wild_u32_
 
Expr wild_i64_
 
Expr wild_u64_
 
Expr wild_f32_
 
Expr wild_f64_
 
int task_depth
 
size_t requested_alloca_total = 0
 A (very) conservative guess at the size of all alloca() storage requested (including alignment padding). More...
 
std::set< std::string > external_buffer
 Which buffers came in from the outside world (and so we can't guarantee their alignment) More...
 
std::map< std::string, std::vector< Intrinsic > > intrinsics
 Mapping of intrinsic functions to the various overloads implementing it. More...
 
bool inside_atomic_mutex_node
 Are we inside an atomic node that uses mutex locks? This is used for detecting deadlocks from nested atomics & illegal vectorization. More...
 
bool emit_atomic_stores
 Emit atomic store instructions? More...
 

Detailed Description

A code generator abstract base class.

Actual code generators (e.g. CodeGen_X86) inherit from this. This class is responsible for taking a Halide Stmt and producing llvm bitcode, machine code in an object file, or machine code accessible through a function pointer.

Definition at line 57 of file CodeGen_LLVM.h.

Member Enumeration Documentation

◆ DestructorType

Some destructors should always be called.

Others should only be called if the pipeline is exiting with an error code.

Enumerator
Always 
OnError 
OnSuccess 

Definition at line 231 of file CodeGen_LLVM.h.

Constructor & Destructor Documentation

◆ ~CodeGen_LLVM()

Halide::Internal::CodeGen_LLVM::~CodeGen_LLVM ( )
override

◆ CodeGen_LLVM()

Halide::Internal::CodeGen_LLVM::CodeGen_LLVM ( const Target t)
protected

Member Function Documentation

◆ new_for_target()

static std::unique_ptr<CodeGen_LLVM> Halide::Internal::CodeGen_LLVM::new_for_target ( const Target target,
llvm::LLVMContext &  context 
)
static

Create an instance of CodeGen_LLVM suitable for the target.

◆ compile()

virtual std::unique_ptr<llvm::Module> Halide::Internal::CodeGen_LLVM::compile ( const Module module)
virtual

Takes a halide Module and compiles it to an llvm Module.

◆ get_target()

const Target& Halide::Internal::CodeGen_LLVM::get_target ( ) const
inline

The target we're generating code for.

Definition at line 68 of file CodeGen_LLVM.h.

References target.

◆ set_context()

void Halide::Internal::CodeGen_LLVM::set_context ( llvm::LLVMContext &  context)

Tell the code generator which LLVM context to use.

◆ initialize_llvm()

static void Halide::Internal::CodeGen_LLVM::initialize_llvm ( )
static

Initialize internal llvm state for the enabled targets.

◆ compile_trampolines()

static std::unique_ptr<llvm::Module> Halide::Internal::CodeGen_LLVM::compile_trampolines ( const Target target,
llvm::LLVMContext &  context,
const std::string &  suffix,
const std::vector< std::pair< std::string, ExternSignature >> &  externs 
)
static

◆ get_requested_alloca_total()

size_t Halide::Internal::CodeGen_LLVM::get_requested_alloca_total ( ) const
inline

Definition at line 84 of file CodeGen_LLVM.h.

References requested_alloca_total.

◆ compile_func()

virtual void Halide::Internal::CodeGen_LLVM::compile_func ( const LoweredFunc func,
const std::string &  simple_name,
const std::string &  extern_name 
)
protectedvirtual

Compile a specific halide declaration into the llvm Module.

◆ compile_buffer()

virtual void Halide::Internal::CodeGen_LLVM::compile_buffer ( const Buffer<> &  buffer)
protectedvirtual

◆ begin_func()

virtual void Halide::Internal::CodeGen_LLVM::begin_func ( LinkageType  linkage,
const std::string &  simple_name,
const std::string &  extern_name,
const std::vector< LoweredArgument > &  args 
)
protectedvirtual

Helper functions for compiling Halide functions to llvm functions.

begin_func performs all the work necessary to begin generating code for a function with a given argument list with the IRBuilder. A call to begin_func should be a followed by a call to end_func with the same arguments, to generate the appropriate cleanup code.

◆ end_func()

virtual void Halide::Internal::CodeGen_LLVM::end_func ( const std::vector< LoweredArgument > &  args)
protectedvirtual

◆ mcpu()

virtual std::string Halide::Internal::CodeGen_LLVM::mcpu ( ) const
protectedpure virtual

What should be passed as -mcpu, -mattrs, and related for compilation.

The architecture-specific code generator should define these.

◆ mattrs()

virtual std::string Halide::Internal::CodeGen_LLVM::mattrs ( ) const
protectedpure virtual

◆ mabi()

virtual std::string Halide::Internal::CodeGen_LLVM::mabi ( ) const
protectedvirtual

◆ use_soft_float_abi()

virtual bool Halide::Internal::CodeGen_LLVM::use_soft_float_abi ( ) const
protectedpure virtual

◆ use_pic()

virtual bool Halide::Internal::CodeGen_LLVM::use_pic ( ) const
protectedvirtual

◆ promote_indices()

virtual bool Halide::Internal::CodeGen_LLVM::promote_indices ( ) const
inlineprotectedvirtual

Should indexing math be promoted to 64-bit on platforms with 64-bit pointers?

Definition at line 122 of file CodeGen_LLVM.h.

◆ native_vector_bits()

virtual int Halide::Internal::CodeGen_LLVM::native_vector_bits ( ) const
protectedpure virtual

What's the natural vector bit-width to use for loads, stores, etc.

◆ upgrade_type_for_arithmetic()

virtual Type Halide::Internal::CodeGen_LLVM::upgrade_type_for_arithmetic ( const Type ) const
protectedvirtual

Return the type in which arithmetic should be done for the given storage type.

◆ upgrade_type_for_storage()

virtual Type Halide::Internal::CodeGen_LLVM::upgrade_type_for_storage ( const Type ) const
protectedvirtual

Return the type that a given Halide type should be stored/loaded from memory as.

◆ upgrade_type_for_argument_passing()

virtual Type Halide::Internal::CodeGen_LLVM::upgrade_type_for_argument_passing ( const Type ) const
protectedvirtual

Return the type that a Halide type should be passed in and out of functions as.

◆ init_context()

virtual void Halide::Internal::CodeGen_LLVM::init_context ( )
protectedvirtual

Grab all the context specific internal state.

◆ init_module()

virtual void Halide::Internal::CodeGen_LLVM::init_module ( )
protectedvirtual

Initialize the CodeGen_LLVM internal state to compile a fresh module.

This allows reuse of one CodeGen_LLVM object to compiled multiple related modules (e.g. multiple device kernels).

◆ add_external_code()

void Halide::Internal::CodeGen_LLVM::add_external_code ( const Module halide_module)
protected

Add external_code entries to llvm module.

◆ optimize_module()

void Halide::Internal::CodeGen_LLVM::optimize_module ( )
protected

Run all of llvm's optimization passes on the module.

◆ sym_push()

void Halide::Internal::CodeGen_LLVM::sym_push ( const std::string &  name,
llvm::Value *  value 
)
protected

Add an entry to the symbol table, hiding previous entries with the same name.

Call this when new values come into scope.

◆ sym_pop()

void Halide::Internal::CodeGen_LLVM::sym_pop ( const std::string &  name)
protected

Remove an entry for the symbol table, revealing any previous entries with the same name.

Call this when values go out of scope.

◆ sym_get()

llvm::Value* Halide::Internal::CodeGen_LLVM::sym_get ( const std::string &  name,
bool  must_succeed = true 
) const
protected

Fetch an entry from the symbol table.

If the symbol is not found, it either errors out (if the second arg is true), or returns nullptr.

◆ sym_exists()

bool Halide::Internal::CodeGen_LLVM::sym_exists ( const std::string &  name) const
protected

Test if an item exists in the symbol table.

◆ signature_to_type()

llvm::FunctionType* Halide::Internal::CodeGen_LLVM::signature_to_type ( const ExternSignature signature)
protected

Given a Halide ExternSignature, return the equivalent llvm::FunctionType.

◆ codegen() [1/2]

llvm::Value* Halide::Internal::CodeGen_LLVM::codegen ( const Expr )
protected

Emit code that evaluates an expression, and return the llvm representation of the result of the expression.

◆ codegen() [2/2]

void Halide::Internal::CodeGen_LLVM::codegen ( const Stmt )
protected

Emit code that runs a statement.

◆ scalarize()

void Halide::Internal::CodeGen_LLVM::scalarize ( const Expr )
protected

Codegen a vector Expr by codegenning each lane and combining.

◆ register_destructor()

llvm::Value* Halide::Internal::CodeGen_LLVM::register_destructor ( llvm::Function *  destructor_fn,
llvm::Value *  obj,
DestructorType  when 
)
protected

◆ trigger_destructor()

void Halide::Internal::CodeGen_LLVM::trigger_destructor ( llvm::Function *  destructor_fn,
llvm::Value *  stack_slot 
)
protected

Call a destructor early.

Pass in the value returned by register destructor.

◆ get_destructor_block()

llvm::BasicBlock* Halide::Internal::CodeGen_LLVM::get_destructor_block ( )
protected

Retrieves the block containing the error handling code.

Creates it if it doesn't already exist for this function.

◆ create_assertion()

void Halide::Internal::CodeGen_LLVM::create_assertion ( llvm::Value *  condition,
const Expr message,
llvm::Value *  error_code = nullptr 
)
protected

Codegen an assertion.

If false, returns the error code (if not null), or evaluates and returns the message, which must be an Int(32) expression.

◆ codegen_asserts()

void Halide::Internal::CodeGen_LLVM::codegen_asserts ( const std::vector< const AssertStmt * > &  asserts)
protected

Codegen a block of asserts with pure conditions.

◆ get_parallel_tasks()

void Halide::Internal::CodeGen_LLVM::get_parallel_tasks ( const Stmt s,
std::vector< ParallelTask > &  tasks,
std::pair< std::string, int >  prefix 
)
protected

◆ do_parallel_tasks()

void Halide::Internal::CodeGen_LLVM::do_parallel_tasks ( const std::vector< ParallelTask > &  tasks)
protected

◆ do_as_parallel_task()

void Halide::Internal::CodeGen_LLVM::do_as_parallel_task ( const Stmt s)
protected

◆ return_with_error_code()

void Halide::Internal::CodeGen_LLVM::return_with_error_code ( llvm::Value *  error_code)
protected

Return the the pipeline with the given error code.

Will run the destructor block.

◆ create_string_constant()

llvm::Constant* Halide::Internal::CodeGen_LLVM::create_string_constant ( const std::string &  str)
protected

Put a string constant in the module as a global variable and return a pointer to it.

◆ create_binary_blob()

llvm::Constant* Halide::Internal::CodeGen_LLVM::create_binary_blob ( const std::vector< char > &  data,
const std::string &  name,
bool  constant = true 
)
protected

Put a binary blob in the module as a global variable and return a pointer to it.

◆ create_broadcast()

llvm::Value* Halide::Internal::CodeGen_LLVM::create_broadcast ( llvm::Value *  ,
int  lanes 
)
protected

Widen an llvm scalar into an llvm vector with the given number of lanes.

◆ codegen_buffer_pointer() [1/4]

llvm::Value* Halide::Internal::CodeGen_LLVM::codegen_buffer_pointer ( const std::string &  buffer,
Type  type,
llvm::Value *  index 
)
protected

Generate a pointer into a named buffer at a given index, of a given type.

The index counts according to the scalar type of the type passed in.

◆ codegen_buffer_pointer() [2/4]

llvm::Value* Halide::Internal::CodeGen_LLVM::codegen_buffer_pointer ( const std::string &  buffer,
Type  type,
Expr  index 
)
protected

◆ codegen_buffer_pointer() [3/4]

llvm::Value* Halide::Internal::CodeGen_LLVM::codegen_buffer_pointer ( llvm::Value *  base_address,
Type  type,
Expr  index 
)
protected

◆ codegen_buffer_pointer() [4/4]

llvm::Value* Halide::Internal::CodeGen_LLVM::codegen_buffer_pointer ( llvm::Value *  base_address,
Type  type,
llvm::Value *  index 
)
protected

◆ make_halide_type_t()

llvm::Value* Halide::Internal::CodeGen_LLVM::make_halide_type_t ( const Type )
protected

Turn a Halide Type into an llvm::Value representing a constant halide_type_t.

◆ add_tbaa_metadata()

void Halide::Internal::CodeGen_LLVM::add_tbaa_metadata ( llvm::Instruction *  inst,
std::string  buffer,
const Expr index 
)
protected

Mark a load or store with type-based-alias-analysis metadata so that llvm knows it can reorder loads and stores across different buffers.

◆ get_allocation_name()

virtual std::string Halide::Internal::CodeGen_LLVM::get_allocation_name ( const std::string &  n)
inlineprotectedvirtual

Get a unique name for the actual block of memory that an allocate node uses.

Used so that alias analysis understands when multiple Allocate nodes shared the same memory.

Reimplemented in Halide::Internal::CodeGen_Posix.

Definition at line 317 of file CodeGen_LLVM.h.

◆ visit() [1/92]

void Halide::Internal::CodeGen_LLVM::visit ( const IntImm )
overrideprotectedvirtual

Generate code for various IR nodes.

These can be overridden by architecture-specific code to perform peephole optimizations. The result of each is stored in value

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [2/92]

void Halide::Internal::CodeGen_LLVM::visit ( const UIntImm )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [3/92]

void Halide::Internal::CodeGen_LLVM::visit ( const FloatImm )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [4/92]

void Halide::Internal::CodeGen_LLVM::visit ( const StringImm )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [5/92]

void Halide::Internal::CodeGen_LLVM::visit ( const Cast )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [6/92]

void Halide::Internal::CodeGen_LLVM::visit ( const Variable )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [7/92]

void Halide::Internal::CodeGen_LLVM::visit ( const Add )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [8/92]

void Halide::Internal::CodeGen_LLVM::visit ( const Sub )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [9/92]

void Halide::Internal::CodeGen_LLVM::visit ( const Mul )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [10/92]

void Halide::Internal::CodeGen_LLVM::visit ( const Div )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [11/92]

void Halide::Internal::CodeGen_LLVM::visit ( const Mod )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [12/92]

void Halide::Internal::CodeGen_LLVM::visit ( const Min )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [13/92]

void Halide::Internal::CodeGen_LLVM::visit ( const Max )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [14/92]

void Halide::Internal::CodeGen_LLVM::visit ( const EQ )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [15/92]

void Halide::Internal::CodeGen_LLVM::visit ( const NE )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [16/92]

void Halide::Internal::CodeGen_LLVM::visit ( const LT )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [17/92]

void Halide::Internal::CodeGen_LLVM::visit ( const LE )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [18/92]

void Halide::Internal::CodeGen_LLVM::visit ( const GT )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [19/92]

void Halide::Internal::CodeGen_LLVM::visit ( const GE )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [20/92]

void Halide::Internal::CodeGen_LLVM::visit ( const And )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [21/92]

void Halide::Internal::CodeGen_LLVM::visit ( const Or )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [22/92]

void Halide::Internal::CodeGen_LLVM::visit ( const Not )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [23/92]

void Halide::Internal::CodeGen_LLVM::visit ( const Select )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [24/92]

void Halide::Internal::CodeGen_LLVM::visit ( const Load )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [25/92]

void Halide::Internal::CodeGen_LLVM::visit ( const Ramp )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [26/92]

void Halide::Internal::CodeGen_LLVM::visit ( const Broadcast )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [27/92]

void Halide::Internal::CodeGen_LLVM::visit ( const Call )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [28/92]

void Halide::Internal::CodeGen_LLVM::visit ( const Let )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [29/92]

void Halide::Internal::CodeGen_LLVM::visit ( const LetStmt )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [30/92]

void Halide::Internal::CodeGen_LLVM::visit ( const AssertStmt )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [31/92]

void Halide::Internal::CodeGen_LLVM::visit ( const ProducerConsumer )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [32/92]

void Halide::Internal::CodeGen_LLVM::visit ( const For )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [33/92]

void Halide::Internal::CodeGen_LLVM::visit ( const Acquire )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [34/92]

void Halide::Internal::CodeGen_LLVM::visit ( const Store )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [35/92]

void Halide::Internal::CodeGen_LLVM::visit ( const Block )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [36/92]

void Halide::Internal::CodeGen_LLVM::visit ( const Fork )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [37/92]

void Halide::Internal::CodeGen_LLVM::visit ( const IfThenElse )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [38/92]

void Halide::Internal::CodeGen_LLVM::visit ( const Evaluate )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [39/92]

void Halide::Internal::CodeGen_LLVM::visit ( const Shuffle )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [40/92]

void Halide::Internal::CodeGen_LLVM::visit ( const VectorReduce )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [41/92]

void Halide::Internal::CodeGen_LLVM::visit ( const Prefetch )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [42/92]

void Halide::Internal::CodeGen_LLVM::visit ( const Atomic )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [43/92]

void Halide::Internal::CodeGen_LLVM::visit ( const Allocate )
overrideprotectedpure virtual

Generate code for an allocate node.

It has no default implementation - it must be handled in an architecture-specific way.

Reimplemented from Halide::Internal::IRVisitor.

Implemented in Halide::Internal::CodeGen_Posix.

◆ visit() [44/92]

void Halide::Internal::CodeGen_LLVM::visit ( const Free )
overrideprotectedpure virtual

Generate code for a free node.

It has no default implementation and must be handled in an architecture-specific way.

Reimplemented from Halide::Internal::IRVisitor.

Implemented in Halide::Internal::CodeGen_Posix.

◆ visit() [45/92]

void Halide::Internal::CodeGen_LLVM::visit ( const Provide )
overrideprotectedvirtual

These IR nodes should have been removed during lowering.

CodeGen_LLVM will error out if they are present

Reimplemented from Halide::Internal::IRVisitor.

◆ visit() [46/92]

void Halide::Internal::CodeGen_LLVM::visit ( const Realize )
overrideprotectedvirtual

Reimplemented from Halide::Internal::IRVisitor.

◆ prepare_for_early_exit()

virtual void Halide::Internal::CodeGen_LLVM::prepare_for_early_exit ( )
inlineprotectedvirtual

If we have to bail out of a pipeline midway, this should inject the appropriate target-specific cleanup code.

Definition at line 390 of file CodeGen_LLVM.h.

◆ llvm_type_of()

virtual llvm::Type* Halide::Internal::CodeGen_LLVM::llvm_type_of ( const Type ) const
protectedvirtual

Get the llvm type equivalent to the given halide type in the current context.

◆ create_alloca_at_entry()

llvm::Value* Halide::Internal::CodeGen_LLVM::create_alloca_at_entry ( llvm::Type *  type,
int  n,
bool  zero_initialize = false,
const std::string &  name = "" 
)
protected

Perform an alloca at the function entrypoint.

Will be cleaned on function exit.

◆ get_user_context()

llvm::Value* Halide::Internal::CodeGen_LLVM::get_user_context ( ) const
protected

The user_context argument.

May be a constant null if the function is being compiled without a user context.

◆ interleave_vectors()

virtual llvm::Value* Halide::Internal::CodeGen_LLVM::interleave_vectors ( const std::vector< llvm::Value * > &  )
protectedvirtual

Implementation of the intrinsic call to interleave_vectors.

This implementation allows for interleaving an arbitrary number of vectors.

◆ get_llvm_intrin() [1/2]

llvm::Function* Halide::Internal::CodeGen_LLVM::get_llvm_intrin ( const Type ret_type,
const std::string &  name,
const std::vector< Type > &  arg_types,
bool  scalars_are_vectors = false 
)
protected

Get an LLVM intrinsic declaration.

If it doesn't exist, it will be created.

◆ get_llvm_intrin() [2/2]

llvm::Function* Halide::Internal::CodeGen_LLVM::get_llvm_intrin ( llvm::Type *  ret_type,
const std::string &  name,
const std::vector< llvm::Type * > &  arg_types 
)
protected

◆ declare_intrin_overload() [1/2]

llvm::Function* Halide::Internal::CodeGen_LLVM::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 
)
protected

Declare an intrinsic function that participates in overload resolution.

◆ declare_intrin_overload() [2/2]

void Halide::Internal::CodeGen_LLVM::declare_intrin_overload ( const std::string &  name,
const Type ret_type,
llvm::Function *  impl,
std::vector< Type arg_types 
)
protected

◆ call_overloaded_intrin()

llvm::Value* Halide::Internal::CodeGen_LLVM::call_overloaded_intrin ( const Type result_type,
const std::string &  name,
const std::vector< Expr > &  args 
)
protected

Call an overloaded intrinsic function.

Returns nullptr if no suitable overload is found.

◆ call_intrin() [1/4]

llvm::Value* Halide::Internal::CodeGen_LLVM::call_intrin ( const Type t,
int  intrin_lanes,
const std::string &  name,
std::vector< Expr  
)
protected

Generate a call to a vector intrinsic or runtime inlined function.

The arguments are sliced up into vectors of the width given by 'intrin_lanes', the intrinsic is called on each piece, then the results (if any) are concatenated back together into the original type 't'. For the version that takes an llvm::Type *, the type may be void, so the vector width of the arguments must be specified explicitly as 'called_lanes'.

◆ call_intrin() [2/4]

llvm::Value* Halide::Internal::CodeGen_LLVM::call_intrin ( const Type t,
int  intrin_lanes,
llvm::Function *  intrin,
std::vector< Expr  
)
protected

◆ call_intrin() [3/4]

llvm::Value* Halide::Internal::CodeGen_LLVM::call_intrin ( llvm::Type *  t,
int  intrin_lanes,
const std::string &  name,
std::vector< llvm::Value * >   
)
protected

◆ call_intrin() [4/4]

llvm::Value* Halide::Internal::CodeGen_LLVM::call_intrin ( llvm::Type *  t,
int  intrin_lanes,
llvm::Function *  intrin,
std::vector< llvm::Value * >   
)
protected

◆ slice_vector()

virtual llvm::Value* Halide::Internal::CodeGen_LLVM::slice_vector ( llvm::Value *  vec,
int  start,
int  extent 
)
protectedvirtual

Take a slice of lanes out of an llvm vector.

Pads with undefs if you ask for more lanes than the vector has.

◆ concat_vectors()

virtual llvm::Value* Halide::Internal::CodeGen_LLVM::concat_vectors ( const std::vector< llvm::Value * > &  )
protectedvirtual

Concatenate a bunch of llvm vectors.

Must be of the same type.

◆ shuffle_vectors() [1/2]

virtual llvm::Value* Halide::Internal::CodeGen_LLVM::shuffle_vectors ( llvm::Value *  a,
llvm::Value *  b,
const std::vector< int > &  indices 
)
protectedvirtual

Create an LLVM shuffle vectors instruction.

◆ shuffle_vectors() [2/2]

llvm::Value* Halide::Internal::CodeGen_LLVM::shuffle_vectors ( llvm::Value *  v,
const std::vector< int > &  indices 
)
protected

Shorthand for shuffling a vector with an undef vector.

◆ find_vector_runtime_function()

std::pair<llvm::Function *, int> Halide::Internal::CodeGen_LLVM::find_vector_runtime_function ( const std::string &  name,
int  lanes 
)
protected

Go looking for a vector version of a runtime function.

Will return the best match. Matches in the following order:

1) The requested vector width.

2) The width which is the smallest power of two greater than or equal to the vector width.

3) All the factors of 2) greater than one, in decreasing order.

4) The smallest power of two not yet tried.

So for a 5-wide vector, it tries: 5, 8, 4, 2, 16.

If there's no match, returns (nullptr, 0).

◆ supports_atomic_add()

virtual bool Halide::Internal::CodeGen_LLVM::supports_atomic_add ( const Type t) const
protectedvirtual

◆ codegen_vector_reduce()

virtual void Halide::Internal::CodeGen_LLVM::codegen_vector_reduce ( const VectorReduce op,
const Expr init 
)
protectedvirtual

Compile a horizontal reduction that starts with an explicit initial value.

There are lots of complex ways to peephole optimize this pattern, especially with the proliferation of dot-product instructions, and they can usefully share logic across backends.

◆ visit() [47/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [48/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [49/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [50/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [51/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [52/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [53/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [54/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [55/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [56/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [57/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [58/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [59/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [60/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [61/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [62/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [63/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [64/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [65/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [66/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [67/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [68/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [69/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [70/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [71/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [72/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [73/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [74/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [75/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [76/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [77/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [78/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [79/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [80/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [81/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [82/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [83/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [84/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [85/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [86/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [87/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [88/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [89/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [90/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [91/92]

virtual void Halide::Internal::IRVisitor::visit
protected

◆ visit() [92/92]

virtual void Halide::Internal::IRVisitor::visit
protected

Member Data Documentation

◆ module

std::unique_ptr<llvm::Module> Halide::Internal::CodeGen_LLVM::module
protected

Definition at line 141 of file CodeGen_LLVM.h.

◆ function

llvm::Function* Halide::Internal::CodeGen_LLVM::function
protected

Definition at line 142 of file CodeGen_LLVM.h.

◆ context

llvm::LLVMContext* Halide::Internal::CodeGen_LLVM::context
protected

Definition at line 143 of file CodeGen_LLVM.h.

◆ builder

llvm::IRBuilder<llvm::ConstantFolder, llvm::IRBuilderDefaultInserter>* Halide::Internal::CodeGen_LLVM::builder
protected

Definition at line 144 of file CodeGen_LLVM.h.

◆ value

llvm::Value* Halide::Internal::CodeGen_LLVM::value
protected

Definition at line 145 of file CodeGen_LLVM.h.

◆ very_likely_branch

llvm::MDNode* Halide::Internal::CodeGen_LLVM::very_likely_branch
protected

Definition at line 146 of file CodeGen_LLVM.h.

◆ default_fp_math_md

llvm::MDNode* Halide::Internal::CodeGen_LLVM::default_fp_math_md
protected

Definition at line 147 of file CodeGen_LLVM.h.

◆ strict_fp_math_md

llvm::MDNode* Halide::Internal::CodeGen_LLVM::strict_fp_math_md
protected

Definition at line 148 of file CodeGen_LLVM.h.

◆ current_function_args

std::vector<LoweredArgument> Halide::Internal::CodeGen_LLVM::current_function_args
protected

Definition at line 149 of file CodeGen_LLVM.h.

◆ target

Halide::Target Halide::Internal::CodeGen_LLVM::target
protected

The target we're generating code for.

Definition at line 153 of file CodeGen_LLVM.h.

Referenced by get_target().

◆ void_t

llvm::Type* Halide::Internal::CodeGen_LLVM::void_t
protected

Some useful llvm types.

Definition at line 191 of file CodeGen_LLVM.h.

◆ i1_t

llvm::Type * Halide::Internal::CodeGen_LLVM::i1_t
protected

Definition at line 191 of file CodeGen_LLVM.h.

◆ i8_t

llvm::Type * Halide::Internal::CodeGen_LLVM::i8_t
protected

Definition at line 191 of file CodeGen_LLVM.h.

◆ i16_t

llvm::Type * Halide::Internal::CodeGen_LLVM::i16_t
protected

Definition at line 191 of file CodeGen_LLVM.h.

◆ i32_t

llvm::Type * Halide::Internal::CodeGen_LLVM::i32_t
protected

Definition at line 191 of file CodeGen_LLVM.h.

◆ i64_t

llvm::Type * Halide::Internal::CodeGen_LLVM::i64_t
protected

Definition at line 191 of file CodeGen_LLVM.h.

◆ f16_t

llvm::Type * Halide::Internal::CodeGen_LLVM::f16_t
protected

Definition at line 191 of file CodeGen_LLVM.h.

◆ f32_t

llvm::Type * Halide::Internal::CodeGen_LLVM::f32_t
protected

Definition at line 191 of file CodeGen_LLVM.h.

◆ f64_t

llvm::Type * Halide::Internal::CodeGen_LLVM::f64_t
protected

Definition at line 191 of file CodeGen_LLVM.h.

◆ halide_buffer_t_type

llvm::StructType* Halide::Internal::CodeGen_LLVM::halide_buffer_t_type
protected

Definition at line 192 of file CodeGen_LLVM.h.

◆ type_t_type

llvm::StructType * Halide::Internal::CodeGen_LLVM::type_t_type
protected

Definition at line 193 of file CodeGen_LLVM.h.

◆ dimension_t_type

llvm::StructType * Halide::Internal::CodeGen_LLVM::dimension_t_type
protected

Definition at line 194 of file CodeGen_LLVM.h.

◆ metadata_t_type

llvm::StructType * Halide::Internal::CodeGen_LLVM::metadata_t_type
protected

Definition at line 195 of file CodeGen_LLVM.h.

◆ argument_t_type

llvm::StructType * Halide::Internal::CodeGen_LLVM::argument_t_type
protected

Definition at line 196 of file CodeGen_LLVM.h.

◆ scalar_value_t_type

llvm::StructType * Halide::Internal::CodeGen_LLVM::scalar_value_t_type
protected

Definition at line 197 of file CodeGen_LLVM.h.

◆ device_interface_t_type

llvm::StructType * Halide::Internal::CodeGen_LLVM::device_interface_t_type
protected

Definition at line 198 of file CodeGen_LLVM.h.

◆ pseudostack_slot_t_type

llvm::StructType * Halide::Internal::CodeGen_LLVM::pseudostack_slot_t_type
protected

Definition at line 199 of file CodeGen_LLVM.h.

◆ semaphore_t_type

llvm::StructType * Halide::Internal::CodeGen_LLVM::semaphore_t_type
protected

Definition at line 200 of file CodeGen_LLVM.h.

◆ semaphore_acquire_t_type

llvm::StructType * Halide::Internal::CodeGen_LLVM::semaphore_acquire_t_type
protected

Definition at line 201 of file CodeGen_LLVM.h.

◆ parallel_task_t_type

llvm::StructType * Halide::Internal::CodeGen_LLVM::parallel_task_t_type
protected

Definition at line 202 of file CodeGen_LLVM.h.

◆ wild_u1x_

Expr Halide::Internal::CodeGen_LLVM::wild_u1x_
protected

Some wildcard variables used for peephole optimizations in subclasses.

Definition at line 209 of file CodeGen_LLVM.h.

◆ wild_i8x_

Expr Halide::Internal::CodeGen_LLVM::wild_i8x_
protected

Definition at line 209 of file CodeGen_LLVM.h.

◆ wild_u8x_

Expr Halide::Internal::CodeGen_LLVM::wild_u8x_
protected

Definition at line 209 of file CodeGen_LLVM.h.

◆ wild_i16x_

Expr Halide::Internal::CodeGen_LLVM::wild_i16x_
protected

Definition at line 209 of file CodeGen_LLVM.h.

◆ wild_u16x_

Expr Halide::Internal::CodeGen_LLVM::wild_u16x_
protected

Definition at line 209 of file CodeGen_LLVM.h.

◆ wild_i32x_

Expr Halide::Internal::CodeGen_LLVM::wild_i32x_
protected

Definition at line 210 of file CodeGen_LLVM.h.

◆ wild_u32x_

Expr Halide::Internal::CodeGen_LLVM::wild_u32x_
protected

Definition at line 210 of file CodeGen_LLVM.h.

◆ wild_i64x_

Expr Halide::Internal::CodeGen_LLVM::wild_i64x_
protected

Definition at line 210 of file CodeGen_LLVM.h.

◆ wild_u64x_

Expr Halide::Internal::CodeGen_LLVM::wild_u64x_
protected

Definition at line 210 of file CodeGen_LLVM.h.

◆ wild_f32x_

Expr Halide::Internal::CodeGen_LLVM::wild_f32x_
protected

Definition at line 211 of file CodeGen_LLVM.h.

◆ wild_f64x_

Expr Halide::Internal::CodeGen_LLVM::wild_f64x_
protected

Definition at line 211 of file CodeGen_LLVM.h.

◆ wild_u1_

Expr Halide::Internal::CodeGen_LLVM::wild_u1_
protected

Definition at line 214 of file CodeGen_LLVM.h.

◆ wild_i8_

Expr Halide::Internal::CodeGen_LLVM::wild_i8_
protected

Definition at line 214 of file CodeGen_LLVM.h.

◆ wild_u8_

Expr Halide::Internal::CodeGen_LLVM::wild_u8_
protected

Definition at line 214 of file CodeGen_LLVM.h.

◆ wild_i16_

Expr Halide::Internal::CodeGen_LLVM::wild_i16_
protected

Definition at line 214 of file CodeGen_LLVM.h.

◆ wild_u16_

Expr Halide::Internal::CodeGen_LLVM::wild_u16_
protected

Definition at line 214 of file CodeGen_LLVM.h.

◆ wild_i32_

Expr Halide::Internal::CodeGen_LLVM::wild_i32_
protected

Definition at line 215 of file CodeGen_LLVM.h.

◆ wild_u32_

Expr Halide::Internal::CodeGen_LLVM::wild_u32_
protected

Definition at line 215 of file CodeGen_LLVM.h.

◆ wild_i64_

Expr Halide::Internal::CodeGen_LLVM::wild_i64_
protected

Definition at line 215 of file CodeGen_LLVM.h.

◆ wild_u64_

Expr Halide::Internal::CodeGen_LLVM::wild_u64_
protected

Definition at line 215 of file CodeGen_LLVM.h.

◆ wild_f32_

Expr Halide::Internal::CodeGen_LLVM::wild_f32_
protected

Definition at line 216 of file CodeGen_LLVM.h.

◆ wild_f64_

Expr Halide::Internal::CodeGen_LLVM::wild_f64_
protected

Definition at line 216 of file CodeGen_LLVM.h.

◆ task_depth

int Halide::Internal::CodeGen_LLVM::task_depth
protected

Definition at line 278 of file CodeGen_LLVM.h.

◆ requested_alloca_total

size_t Halide::Internal::CodeGen_LLVM::requested_alloca_total = 0
protected

A (very) conservative guess at the size of all alloca() storage requested (including alignment padding).

It's currently meant only to be used as a very coarse way to ensure there is enough stack space when testing on the WebAssembly backend.

It is not meant to be a useful proxy for "stack space needed", for a number of reasons:

  • allocas with non-overlapping lifetimes will share space
  • on some backends, LLVM may promote register-sized allocas into registers
  • while this accounts for alloca() calls we know about, it doesn't attempt to account for stack spills, function call overhead, etc.

Definition at line 415 of file CodeGen_LLVM.h.

Referenced by get_requested_alloca_total().

◆ external_buffer

std::set<std::string> Halide::Internal::CodeGen_LLVM::external_buffer
protected

Which buffers came in from the outside world (and so we can't guarantee their alignment)

Definition at line 419 of file CodeGen_LLVM.h.

◆ intrinsics

std::map<std::string, std::vector<Intrinsic> > Halide::Internal::CodeGen_LLVM::intrinsics
protected

Mapping of intrinsic functions to the various overloads implementing it.

Definition at line 443 of file CodeGen_LLVM.h.

◆ inside_atomic_mutex_node

bool Halide::Internal::CodeGen_LLVM::inside_atomic_mutex_node
protected

Are we inside an atomic node that uses mutex locks? This is used for detecting deadlocks from nested atomics & illegal vectorization.

Definition at line 515 of file CodeGen_LLVM.h.

◆ emit_atomic_stores

bool Halide::Internal::CodeGen_LLVM::emit_atomic_stores
protected

Emit atomic store instructions?

Definition at line 518 of file CodeGen_LLVM.h.


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