Fixed the Extended Diamond Problem #108
Merged
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.
The change fixes the annoying and previously known Extended Diamond Problem (we had tried to fix it earlier with #60 but that fix was hacky and caused issues with arrays.
The new change is better since it tries to solve the root of the problem - Different code can be generated after tags have merged due to different variables being live. We now solve this problem by extending static tags to also capture the set of live dyn_vars. Thus two tags will compare equal only if the set of live variables is same too.
To avoid the recursive tag matching complexity, tags are passed through a tag_factory to deduplicate tags into a tag_id before storing in the set. In the future we can also convert all tags into tag_id.
Sample 54 has been slightly modified to test this. Sample 23 had to be modified to avoid unnecessary code blowup.