[0035] Revise createMatrix to create a unique reference #750
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.
After losing all its type information to annotateMatrix, createMatrix had no purpose and would have resulted in all calls being merged as redundant, however, some means of uniquely identifying a matrix is needed that annotateMatrix can't do because it needs to be generated for parameters as well as locals and globals (assuming we allow globals).
Previous handles for resources have had global variables that are able to uniquely identify them and workgraph handles have had parameters to the entry functions. Lacking either of these, it was impossible to distinguish allocas created for the initial declaration of a matrix and one that was created for a parameter that should get merged when inlining that function. By generating a unique createMatrix call where the local variable is declared or in the entry block for global variables.
Addresses some issues in #696 though not in the way I initially proposed there