Skip to content

optimiser: transform calls to imported functions also when optimisation is disabled#206

Open
melsman wants to merge 2 commits intomasterfrom
noopt-fix
Open

optimiser: transform calls to imported functions also when optimisation is disabled#206
melsman wants to merge 2 commits intomasterfrom
noopt-fix

Conversation

@melsman
Copy link
Owner

@melsman melsman commented Feb 14, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 14, 2026 10:36
@melsman melsman added the bug label Feb 14, 2026
@melsman melsman self-assigned this Feb 14, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Lambda optimiser pipeline so that argument-transformation/flattening of calls to imported (already-transformed) functions still happens even when optimisation is disabled (-no_opt / noopt). This prevents mismatches between call sites and imported function calling conventions in “no optimisation” builds.

Changes:

  • Extend FixFlatten.flatten to also rewrite CHECK_REML nodes when a referenced lvar has a FIXphi transformation.
  • When optimise_p() is false, run a “noopt” flattening pass (FixFlatten.flattening_noopt) instead of returning the input lambda unchanged.
  • Add a regression test (stringconcat.sml) executed with noopt.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/Compiler/Lambda/OptLambda.sml Runs flattening even with optimiser disabled; updates flatten traversal for CHECK_REML.
test/all.tst Documents noopt and runs the new regression test with optimisation disabled.
test/stringconcat.sml New regression program to exercise imported-function call transformation under noopt.
test/stringconcat.sml.out.ok Expected output for the new regression test.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 9 to 11
nobasislib ; do not import basis library
nooptimiser ; disable lambda optimiser
noopt ; disable lambda optimiser
ccl ; compare compiler logs
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The token name for disabling the optimiser is updated to noopt here, but other .tst files still document nooptimiser (e.g. test/parallelism/all.tst). To avoid confusion for contributors and to keep the test-suite documentation consistent, update those headers too (or make the tester accept nooptimiser as an alias if that’s intended).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant