-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Summary
Add Forth-style local variables to make complex algorithms readable and writable.
Motivation
Matmul tiling involves many named quantities (row, col, tile index, accumulator, etc.) that are impractical to manage on a raw stack. Local variables let you name values instead of juggling stack positions.
Design considerations
Standard Forth locals syntax options:
\ ANS Forth locals
: foo { a b c -- } a b + c * ;
\ VALUE/TO style
0 VALUE acc
10 TO accImplementation notes
- Locals can be lowered to
memref.allocaslots or MLIR SSA values - Parser needs to handle
{ ... -- }orVALUE/TOsyntax - Scope is per-word (locals are valid until
;) - On GPU, locals should map to registers (scalar allocas that LLVM promotes to registers)
Priority
Important — significantly improves ergonomics for any non-trivial kernel.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request