17#ifndef FORTRAN_OPTIMIZER_TRANSFORMS_ALLOCATIONPLACEMENTPOLICY_H
18#define FORTRAN_OPTIMIZER_TRANSFORMS_ALLOCATIONPLACEMENTPOLICY_H
55 mlir::Operation *
op =
nullptr;
77 std::size_t stackBytesUsed);
Definition AbstractConverter.h:37
std::function< AllocationPlacement( const AllocationInfo &, const AllocationPlacementThresholds &, std::size_t)> AllocationPlacementHook
Definition AllocationPlacementPolicy.h:83
AllocationPlacement decideAllocationPlacement(const AllocationInfo &info, const AllocationPlacementThresholds &thresholds, std::size_t stackBytesUsed)
Definition AllocationPlacement.cpp:54
AllocationPlacement
Desired placement for an array allocation.
Definition AllocationPlacementPolicy.h:32
@ Stack
The allocation should live on the stack (fir.alloca).
Definition AllocationPlacementPolicy.h:34
@ Heap
The allocation should live on the heap (fir.allocmem).
Definition AllocationPlacementPolicy.h:36
@ Leave
The allocation should be left where it currently is.
Definition AllocationPlacementPolicy.h:38
Definition AbstractConverter.h:32
Facts about a single array allocation used to decide its placement.
Definition AllocationPlacementPolicy.h:53
std::optional< std::int64_t > byteSize
The constant size of the allocation in bytes, if it can be determined.
Definition AllocationPlacementPolicy.h:67
bool isTemporary
Definition AllocationPlacementPolicy.h:60
bool isDynamic
Definition AllocationPlacementPolicy.h:65
mlir::Operation * op
The allocation operation (fir.alloca or fir.allocmem).
Definition AllocationPlacementPolicy.h:55
bool isCurrentlyOnStack
True if the allocation currently lives on the stack (fir.alloca).
Definition AllocationPlacementPolicy.h:57
Tunable thresholds controlling where array allocations are placed.
Definition AllocationPlacementPolicy.h:42
std::size_t totalStackLimitBytes
Per-function budget (in bytes) for small arrays placed on the stack.
Definition AllocationPlacementPolicy.h:49
std::size_t smallArrayThresholdBytes
Constant-size arrays up to this many bytes are considered "small".
Definition AllocationPlacementPolicy.h:47
bool stackArrays
Definition AllocationPlacementPolicy.h:45