Skip to content

Conversation

@stevenfontanella
Copy link
Member

@stevenfontanella stevenfontanella commented Jan 9, 2026

Part of #8165. Add flag for --enable-relaxed atomics and enable it for the existing SafeHeap tests that previously implicitly depended on it. The next PR #8193 disables generation of AcqRel SafeHeap functions when the feature is disabled and adds new tests to cover that case.

Also validate that the feature is enabled when a module includes an AcqRel load operation (currently the only one we support).

@stevenfontanella stevenfontanella force-pushed the feature-flag branch 3 times, most recently from 07df315 to 2f0fc13 Compare January 9, 2026 23:19
@stevenfontanella stevenfontanella marked this pull request as ready for review January 10, 2026 00:03
;; NOTE: This test was ported using port_passes_tests_to_lit.py and could be cleaned up.

;; RUN: foreach %s %t wasm-opt --safe-heap --enable-threads --enable-simd --enable-memory64 -S -o - | filecheck %s
;; RUN: foreach %s %t wasm-opt --safe-heap --enable-threads --enable-simd --enable-memory64 --enable-relaxed-atomics -S -o - | filecheck %s
Copy link
Member

Choose a reason for hiding this comment

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

Rather than adding relaxed-atomics to each of these files, let's make a new file that enables just relaxed atomics.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't understand, this test wouldn't pass without --enabled-relaxed-atomics because --safe-heap combined with --enable-threads will cause us to generate safe heap methods that use acqrel ordering (which the next PR fixes but we need this PR first). In the next PR #8193 I add an equivalent test without --enable-relaxed-atomics to show that the acqrel methods aren't added. Also we anyway need a test that enables both relaxed atomics and safe heap to show that the safe acqrel methods are added.

Copy link
Member

Choose a reason for hiding this comment

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

I see. LGTM to land this as-is because of the dependencies between PRs. I think ultimately we don't need to have more than one SafeHeap test that enables relaxed-atomics, though. (Also we can make the test file names much shorter now that they are lit tests.)

Copy link
Member

@tlively tlively left a comment

Choose a reason for hiding this comment

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

LGTM % those comments.

@stevenfontanella stevenfontanella merged commit 653c164 into main Jan 11, 2026
17 checks passed
@stevenfontanella stevenfontanella deleted the feature-flag branch January 11, 2026 06:10
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.

4 participants