Repository navigation
feat(rocjitsu) Enable const iteration for IntrusiveList - #14420
Merged
Merged
Conversation
✅ All Checks Passed — Ready for Review
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🎉 All checks passed! This PR is ready for review. |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the IntrusiveList const-traversal changes.
No open issues 🎉
What changed in this PR
Enables const traversal of rocjitsu’s IntrusiveList, allowing callers to iterate instruction lists through const BasicBlock accessors and addressing #14023.
Changes:
- Uses the same underlying node type for mutable and const iterators, preserves reference constness, and supports mutable-to-const conversion.
- Adds const
begin()/end()andcbegin()/cend()accessors. - Registers a unit test covering empty lists, forward and reverse const traversal, and iterator traits.
| File | Description |
|---|---|
| emulation/rocjitsu/tests/util_intrusive_list_test.cpp | Tests const traversal, conversion, and iterator traits. |
| emulation/rocjitsu/tests/CMakeLists.txt | Adds the intrusive-list test to the test executable. |
| emulation/rocjitsu/lib/util/include/util/intrusive_list.h | Corrects iterator types and adds const traversal accessors. |
Review effort: Balanced
kuhar
approved these changes
Oct 28, 2026
Const instruction lists cannot be traversed because IntrusiveList has only mutable begin/end methods. Its ConstIterator alias also names a different intrusive node type when T becomes const. Base both iterators on the same node, preserve element constness, and add const begin/end plus cbegin/cend. Make mutable iterators yield `T &` instead of `const T &`, allow conversion to the const iterator, and expose an unqualified value_type. Remove the unused ConstPointer, ConstReference, and ConstNodeReference aliases. Register a unit test for empty, forward, and reverse const traversal and iterator traits. Verified: Release builds of rocjitsu_tests and hsa_hooks_unit_test; CTest: 1 intrusive-list test, 31 code/instrumentor tests, and 57 HSA hook unit tests passed. Signed-off-by: Tony Gutierrez <anthony.gutierrez@amd.com>
atgutier
force-pushed
the
users/agutierr/intrusive-list-const-iteration
branch
2 times, most recently
from
October 28, 2026 16:00
775b577 to
dd25c3b
Compare
Contributor
rocjitsu post-commit fuzz passedThe 32-worker multiplexer campaigns for commit
|
Contributor
TheRock Submodule Bump ActivityNewest first
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Const instruction lists cannot be traversed because IntrusiveList has only mutable begin/end methods. Its ConstIterator alias also names a different intrusive node type when T becomes const.
Base both iterators on the same node, preserve element constness, and add const begin/end plus cbegin/cend. Keep mutable iterator references writable, allow conversion to the const iterator, and expose an unqualified value_type. Register a unit test for empty, forward, and reverse const traversal and iterator traits.
Verified: Release builds of rocjitsu_tests and hsa_hooks_unit_test; CTest: 1 intrusive-list test, 31 code/instrumentor tests, and 57 HSA hook unit tests passed.
Closes #14023