Organisationsahrefsocannl9fb1c8

Cross-statement CSE with hoisting to common ancestor scope Add `Declare_local of scope_id` IR node that emits a local variable declaration and zero-initialization. Implement `hoist_cross_statement_cse` pass that scans flattened Seq siblings for alpha-equivalent Local_scope nodes across different Set statements, hoists them as Declare_local + body before the first user, and replaces all occurrences with Get_local. The pass runs after intra-statement CSE in the optimization pipeline, includes a conservative safety check that rejects hoisting when intervening statements write to tensors read by the Local_scope body. Includes regression test exercising to_doc, to_doc_cstyle, and c_syntax pp_ll paths with cross-statement deduplication. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Apr 22 14:08 +00:00
ludics/task-2d20f48e-s2/rootBuild History
3m07s
*Variants labelled (experimental) are still undergoing testing; if they have failed it may be a bug in OCaml-CI.