Loading...
Searching...
No Matches
FunctionOptions Struct Reference

Options that control how functions behave. More...

`#include <openvdb_ax/compiler/CompilerOptions.h>`

## Public Attributes

bool | mConstantFoldCBindings = true
| Enable the constant folding of C bindings. Functions may use this setting to determine whether they are allowed to be called during code generation to evaluate call sites with purely constant arguments and replace the call with the result.
bool | mPrioritiseIR = true
| When enabled, functions which have IR builder instruction definitions will prioritise those over any registered external calls.
bool | mLazyFunctions = true
| When enabled, the function registry is only populated on a function visit. At the end of code generation, only functions which have been instantiated will exist in the function map.

## Detailed Description

Options that control how functions behave.

## Member Data Documentation

## mConstantFoldCBindings

bool mConstantFoldCBindings = true

Enable the constant folding of C bindings. Functions may use this setting to determine whether they are allowed to be called during code generation to evaluate call sites with purely constant arguments and replace the call with the result.

Note
  This does not impact IR functions which we leave to LLVM's CF during IR optimization.
  We used to bind IR methods to corresponding C bindings, however it can be very easy to implement incorrectly, leading to discrepancies in the CF results. Fundamentally, LLVM's support for CF IR is far superior and our framework only supports some types of folding (see codegen/ConstantFolding.h)

## mLazyFunctions

bool mLazyFunctions = true

When enabled, the function registry is only populated on a function visit. At the end of code generation, only functions which have been instantiated will exist in the function map.

## mPrioritiseIR

bool mPrioritiseIR = true

When enabled, functions which have IR builder instruction definitions will prioritise those over any registered external calls.