-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IR] Init GlobalTensorElementExpression and PtrOffsetStmt #2543
Conversation
I think it should be |
/format |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work! A few code style suggestions
Co-authored-by: xumingkuan <xumingkuan0721@126.com>
/format |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can rename GlobalTensorElementStmt
to something like GlobalPtrWithOffsetStmt
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
/format |
/format |
/format |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe alias_analysis.cpp should be modified. Currently any two ShiftGlobalPtrStmt
s will result in AliasResult::uncertain
, which is too conservative. (Feel free to use value_diff_ptr_index
or same_value
to implement alias_analysis
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
/format |
I believe you are right. I will open another pull request about this after I get more familiar with CFG optimization passes. |
Related Issue = #2590
Below is the design overview and some concerns to resolve before moving on to accomplish all related components like type-check, ir-printer...
GlobalTensorElementExpression(GlobalPtrExpression, Expr)
.GlobalTensorElementStmt(GlobalPtrStmt, Stmt)
GlobalPtrStmt
has been moved into visit(GlobalTensorElementStmt*)acces_with_offset_*
) predefined in llvm/runtime.cppConcerns:
GlobalTensorElementExpression
inherited fromGlobalPtrExpression
or directly fromExpression
?visit(GlobalPtrStmt*)
?