1 #ifndef HALIDE_CODEGEN_INTERNAL_H 2 #define HALIDE_CODEGEN_INTERNAL_H 22 class IRBuilderDefaultInserter;
30 template<
typename,
typename>
110 void embed_bitcode(llvm::Module *M,
const std::string &halide_command);
llvm::Type * get_vector_element_type(llvm::Type *)
Get the scalar type of an llvm vector type.
Expr lower_int_uint_mod(const Expr &a, const Expr &b)
Given a Halide Euclidean division/mod operation, do constant optimizations and possibly call lower_eu...
Expr lower_signed_shift_right(const Expr &a, const Expr &b)
Given a Halide shift operation with a signed shift amount (may be negative), define an equivalent exp...
bool can_allocation_fit_on_stack(int64_t size)
Given a size (in bytes), return True if the allocation size can fit on the stack; otherwise...
Expr lower_concat_bits(const Call *c)
Reduce bit extraction and concatenation to bit ops.
std::unique_ptr< llvm::TargetMachine > make_target_machine(const llvm::Module &module)
Given an llvm::Module, get or create an llvm:TargetMachine.
This file defines the class FunctionDAG, which is our representation of a Halide pipeline, and contains methods to using Halide's bounds tools to query properties of it.
void set_function_attributes_from_halide_target_options(llvm::Function &)
Set the appropriate llvm Function attributes given the Halide Target.
void embed_bitcode(llvm::Module *M, const std::string &halide_command)
Save a copy of the llvm IR currently represented by the module as data in the __LLVM,__bitcode section.
Base classes for Halide expressions (Halide::Expr) and statements (Halide::Internal::Stmt) ...
Expr mux(const Expr &id, const std::initializer_list< Expr > &values)
Oftentimes we want to pack a list of expressions with the same type into a channel dimension...
Expr lower_signed_shift_left(const Expr &a, const Expr &b)
Given a Halide shift operation with a signed shift amount (may be negative), define an equivalent exp...
void get_target_options(const llvm::Module &module, llvm::TargetOptions &options)
Given an llvm::Module, set llvm:TargetOptions information.
Expr lower_round_to_nearest_ties_to_even(const Expr &)
An vectorizable implementation of Halide::round that doesn't depend on any standard library being pre...
signed __INT64_TYPE__ int64_t
Defines the Scope class, which is used for keeping track of names in a scope while traversing IR...
Expr lower_mux(const Call *mux)
Reduce a mux intrinsic to a select tree.
Expr lower_euclidean_mod(Expr a, Expr b)
Given a Halide Euclidean division/mod operation, define it in terms of div_round_to_zero or mod_round...
Expr lower_int_uint_div(const Expr &a, const Expr &b, bool round_to_zero=false)
Given a Halide Euclidean division/mod operation, do constant optimizations and possibly call lower_eu...
bool function_takes_user_context(const std::string &name)
Which built-in functions require a user-context first argument?
void clone_target_options(const llvm::Module &from, llvm::Module &to)
Given two llvm::Modules, clone target options from one to the other.
Expr lower_extract_bits(const Call *c)
Reduce bit extraction and concatenation to bit ops.
std::pair< Expr, Expr > long_div_mod_round_to_zero(const Expr &a, const Expr &b, const uint64_t *max_abs=nullptr)
Does a {div/mod}_round_to_zero using binary long division for int/uint.
Expr lower_euclidean_div(Expr a, Expr b)
Given a Halide Euclidean division/mod operation, define it in terms of div_round_to_zero or mod_round...
unsigned __INT64_TYPE__ uint64_t