Skip to content

Propagate module dialect before compilation#515

Draft
aqk wants to merge 1 commit into
20260515-cse-dominance-trickfrom
aqk/fix-module-dialect-cse-dominance
Draft

Propagate module dialect before compilation#515
aqk wants to merge 1 commit into
20260515-cse-dominance-trickfrom
aqk/fix-module-dialect-cse-dominance

Conversation

@aqk

@aqk aqk commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Apply the detected module dialect before frontend, cache lookup, and module compilation.
  • Enable module-only CSE dominance semantics even when callers enter module compilation with default options.

Test plan

  • cargo test test_unlabeled_module_file
  • cargo test test_cse_tricky_2

Note

Medium Risk
Touches core compile entry and optimizer dialect flags; wrong detection or dialect propagation could change codegen or cache behavior for module inputs.

Overview
compile_pre_forms now runs detect_chialisp_module on raw pre-forms and updates opts with the module dialect and stdenv (from dialect.strict) before frontend, so module files get the right language settings even when compilation starts with default options (affects parsing, disk cache keys, and the module path).

In compile_module, cse_dominance is always turned on for modules instead of only when stepping < 26, so module CSE dominance semantics apply consistently regardless of stepping on the incoming dialect.

Reviewed by Cursor Bugbot for commit 25beafc. Bugbot is set up for automated code reviews on this repo. Configure here.

Ensure module-style sources use the detected module dialect before frontend, cache, and module compilation so module-only CSE fixes are consistently enabled.
@aqk
aqk marked this pull request as draft July 7, 2026 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant