[ir] MatrixField refactor 1/n: Make a GlobalVariableExpression solely represent a field #5980
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.
Related issue = #5959
Previously, a
GlobalVariableExpression
serves two purposes:FrontendForStmt
is actually a struct for on a SNode or an external tensor, it can always be constructed by passing anExpr
.However, the second purpose doesn't make sense - a struct for on a SNode and a struct for on an external tensor are handled differently everywhere (
lower_ast
,ir_printer
, ...), so it's natural to split the constructors as well.This PR clearly and consistently distinguishes different types of
FrontendForStmt
:snode != nullptr
);external_tensor != nullptr
);mesh != nullptr
);As a result, the second purpose is eliminated and a
GlobalVariableExpression
serves solely for a field.