FLANG
fir::AllocationPolicy Struct Reference

#include <flang/Optimizer/Support/AllocationPolicy.h>

Public Attributes

bool stackArrays = stackArraysDefault
std::uint64_t smallArrayThresholdBytes = smallArrayThresholdBytesDefault
 Constant-size arrays up to this many bytes are considered "small".
std::uint64_t totalStackLimitBytes = totalStackLimitBytesDefault
 Per-function budget (in bytes) for small arrays placed on the stack.

Static Public Attributes

static constexpr bool stackArraysDefault = false
static constexpr std::uint64_t smallArrayThresholdBytesDefault = 1024
static constexpr std::uint64_t totalStackLimitBytesDefault

Detailed Description

Tunables controlling where array allocations are placed. The static constants below are the only definition of the defaults. Helpers that build the fir.allocation_policy attribute and pass options derive their defaults from them.

Member Data Documentation

◆ stackArrays

bool fir::AllocationPolicy::stackArrays = stackArraysDefault

Place all array allocations on the stack when possible (-fstack-arrays). When false, use the size-based policy described by the fields below.

◆ totalStackLimitBytesDefault

std::uint64_t fir::AllocationPolicy::totalStackLimitBytesDefault
staticconstexpr
Initial value:
=
4ull * 1024 * 1024

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