Skip to content

cranelift: restore explicit no-region for alias analysis - #14373

Open
agourakis82 wants to merge 4 commits into
bytecodealliance:mainfrom
agourakis82:users/agourakis/cranelift-regionless-load-alias-fence
Open

agourakis82 wants to merge 4 commits into
bytecodealliance:mainfrom
agourakis82:users/agourakis/cranelift-regionless-load-alias-fence

Conversation

@agourakis82

@agourakis82 agourakis82 commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Regionless stores were being treated as fences over every named region. That was a behavior change from the older alias analysis, where no-region was its own disjoint bucket for both loads and stores.

This restores that older shape:

  • regionless store → other only
  • regionless load → other only
  • true fences still touch every bucket

Also updates the docs/memflags wording and the alias tests that had encoded the fence-for-stores behavior (issue-13508, no-region, etc.).

For #14323: under explicit no-region, mixing a regionless access and a named-region access on the same address is outside the frontend invariant. Happy to close that issue once this lands, or rework again if the meeting picks the other rule.

Fixes #14323

Assisted-by: Claude

@agourakis82
agourakis82 requested a review from a team as a code owner September 22, 2026 02:32
@agourakis82
agourakis82 requested review from fitzgen and removed request for a team September 22, 2026 02:32
@github-actions github-actions Bot added the cranelift Issues related to the Cranelift code generator label Sep 22, 2026
@agourakis82

agourakis82 commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks. Parking this on the meeting.

#14373 follows the issue report’s reading (no-region load can see a named-region store). If the call is explicit no-region, I’ll rework/close it.

@agourakis82

agourakis82 commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Wrote up the store/load asymmetry on the issue.

@agourakis82

agourakis82 commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Better summary of the two options is here: #14323 (comment)

@agourakis82
agourakis82 force-pushed the users/agourakis/cranelift-regionless-load-alias-fence branch from a482899 to db762f6 Compare September 22, 2026 15:22
@agourakis82

agourakis82 commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Rebased on main.

Tried the explicit-no-region store change locally; notes on the issue.

@agourakis82

agourakis82 commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor Author

#14323 (comment)

@agourakis82

agourakis82 commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Parking on the meeting: explicit no-region vs no-region as fence. Fine either way.

Regionless stores had been treated as fences over every named region.
That disagreed with the older alias-analysis behavior, where no-region
was its own disjoint bucket for both loads and stores, and it disagreed
with how regionless loads already worked.

Put regionless stores back in the "other" bucket, keep loads on that
same bucket, and leave true fences as the only thing that touches every
region. Docs and alias tests updated to match.

Assisted-by: Claude
@agourakis82
agourakis82 force-pushed the users/agourakis/cranelift-regionless-load-alias-fence branch from db762f6 to 962fcf8 Compare September 22, 2026 17:11
@agourakis82 agourakis82 changed the title cranelift: treat regionless loads as aliasing all regions cranelift: restore explicit no-region for alias analysis Sep 22, 2026
Preserve the existing PR commits and integrate the pinned upstream changes
without rewriting the branch history.

Validate merged tree c76532a on Linux x86-64
with Rust 1.98.0: locked clif-util build, cargo fmt, the 50 alias filetests,
and the six backend filetests added or changed since the previous base.
Additional private regionless join and loop probes also passed; these are
not part of the upstream test suite. This is scoped validation, not full
cross-platform CI or maintainer approval.

Assisted-by: OpenAI Codex
Preserve volatile accesses as fences while integrating upstream alias-region extent handling. Align the issue-13508 initializer with its named-region contract and correct regionless-slot comments.

Native validation: 52 alias fixtures, three focused regionless join/loop/DSE fixtures, selected volatile and readonly cases, and 235 codegen unit tests. A volatile-guard mutant is rejected; restoring the source reproduces the original compiler artifact.

Assisted-by: Codex:GPT-6.1-Sol

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cranelift Issues related to the Cranelift code generator

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regionless-loads can return stale results

1 participant