Repository navigation
Type descriptors, ownership routines and object vtables are named from the type's text - #820
Merged
Merged
Conversation
…m the type's text td_, tsrel_, tsret_, tsshr_, tsshrbox_, tsrelrec_ and the other ownership routines, and an object's interface vtable, were named from hash_value(type): the type's storage address, weakly mixed. The names changed from run to run, and two types could share one name and so one descriptor or release routine. MLIRHelper::hashOfType hashes the type as MLIR prints it (xxh3), as the constant arrays' names now are. A program now compiles to the same IR every time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Follows #819, which did this for constant arrays. Every symbol that was named from a type's address is now named from the type's printed text.
The bug
These names came from
hash_value(type), which hashes the type's storage address with a weak mix:td_);tsrel_,tsret_,tsshr_,tsshrbox_,tsrelrec_, and those built from a prefix;Shape.136163259..vtbl).So the names changed from run to run. Two different types could also land on the same name, and then share one type descriptor or one release routine.
The fix
MLIRHelper::hashOfTypehashes the type as MLIR prints it, withxxh3_64bits, as #819 does for constant arrays. Every one of those sites now uses it. A file name was already hashed by its text, soAssertLogic'sf_name is unchanged.Checks
🤖 Generated with Claude Code