1#ifndef HALIDE_CODEGEN_POSIX_H
2#define HALIDE_CODEGEN_POSIX_H
34 llvm::Value *
ptr =
nullptr;
73 std::vector<Allocation> free_stack_allocs;
77 size_t cur_stack_alloc_total{0};
83 llvm::Value *codegen_allocation_size(
const std::string &name,
Type type,
const std::vector<Expr> &extents,
const Expr &condition);
98 Allocation create_allocation(
const std::string &name,
Type type,
MemoryType memory_type,
99 const std::vector<Expr> &extents,
const Expr &condition,
100 const Expr &new_expr, std::string free_function,
int padding);
104 void free_allocation(
const std::string &name);
Defines the base-class for all architecture-specific code generators that use llvm.
A code generator abstract base class.
void visit(const IntImm *) override
Generate code for various IR nodes.
A code generator that emits posix code from a given Halide stmt.
CodeGen_Posix(const Target &t)
Create an posix code generator.
void visit(const Allocate *) override
Posix implementation of Allocate.
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 Free *) override
Generate code for a free node.
Scope< Allocation > allocations
The allocations currently in scope.
A common pattern when traversing Halide IR is that you need to keep track of stuff when you find a Le...
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
@ Internal
Not visible externally, similar to 'static' linkage in C.
MemoryType
An enum describing different address spaces to be used with Func::store_in.
A fragment of Halide syntax.
Allocate a scratch area called with the given name, type, and size.
A struct describing heap or stack allocations.
Type type
The (Halide) type of the allocation.
int constant_bytes
How many bytes this allocation is, or 0 if not constant.
llvm::Value * ptr
The memory.
std::string name
A unique name for this allocation.
llvm::Value * destructor
Destructor stack slot for this allocation.
llvm::Value * pseudostack_slot
Pseudostack slot for this allocation.
int stack_bytes
How many bytes of stack space used.
llvm::Function * destructor_function
Function to accomplish the destruction.
Free the resources associated with the given buffer.
A struct representing a target machine and os to generate code for.
Types in the halide type system.