On this page
Flatten control flow
This option enables Control Flow Flattening (CFF), restructuring control flow and statements into a dispatch-like state machine. The flattener prioritizes correctness; if flattening a block could cause side effects, it either skips that block or only partially flattens it.
The control flow flattener supports the following branching syntaxes:
ifstatementswhileandrepeatloops- numeric
forloops breakandcontinuestatementsfor-inloops and even support for Luau’s generalized iteration
The following child options are available:
Expression Decomposition: Breaks apart expressions into CFF blocks and temporaries, can kill performance.Hoist locals: Will move local storage into a lookup table. Useful to cut down on the number of used locals.