On this page
Flatten control flow
This option will enable the Control Flow Flattener (CFF). This feature is conservative in it’s estimates of what can be flattened, if a block can’t be flattened without side effects, it will be discarded from the flattening queue. CFF is applied recursively to failed blocks, meaning if a block is discarded from the flattening queue, its children may be flattened individually.
The control flow flattener supports the following branching syntaxes:
if
statementswhile
andrepeat
loops- numeric
for
loops break
andcontinue
statementsfor-in
loops and even support for Luau’s generalized iteration
The following child options are available:
Wrap CFF blocks
: This will move some CFF blocks into their own closure in a lookup table.Hoist locals
: Will move local storage into a lookup table for CFF blocks. Useful to cut down on the number of used locals.