-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[TIR] Enforce buffer pointer var type to be consistent with dtype. #6317
Conversation
Now that we have type_annotation in tir::Var. We should make sure that the type annotation to be consistent with the dtype in Buffer declaration and Allocation. This change allows future passes to directly use the content type information via type_annotation. This PR turns on the enforcement on Buffer and also fixed a few cases for Allocate. A follow up PR need to fix a few more cases in the hybrid script parsing before everything can be made consistent.
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
@@ -263,6 +263,9 @@ TVM_STATIC_IR_FUNCTOR(ReprPrinter, vtable) | |||
// Allocate | |||
Allocate::Allocate(Var buffer_var, DataType dtype, Array<PrimExpr> extents, PrimExpr condition, | |||
Stmt body) { | |||
// TODO(tvm-team): Add invariant check to make sure | |||
// IsPointerPType(buffer_var->type_annotation, dtype) | |||
// once we fix the allocate hybrid script printing. |
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.
Will it be addressed soon in a follow-up PR for hybrid script?
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.
yes, i believe we can send another PR once the hybrid script printing part is fixed.
…pache#6317) Now that we have type_annotation in tir::Var. We should make sure that the type annotation to be consistent with the dtype in Buffer declaration and Allocation. This change allows future passes to directly use the content type information via type_annotation. This PR turns on the enforcement on Buffer and also fixed a few cases for Allocate. A follow up PR need to fix a few more cases in the hybrid script parsing before everything can be made consistent.
…pache#6317) Now that we have type_annotation in tir::Var. We should make sure that the type annotation to be consistent with the dtype in Buffer declaration and Allocation. This change allows future passes to directly use the content type information via type_annotation. This PR turns on the enforcement on Buffer and also fixed a few cases for Allocate. A follow up PR need to fix a few more cases in the hybrid script parsing before everything can be made consistent.
…pache#6317) Now that we have type_annotation in tir::Var. We should make sure that the type annotation to be consistent with the dtype in Buffer declaration and Allocation. This change allows future passes to directly use the content type information via type_annotation. This PR turns on the enforcement on Buffer and also fixed a few cases for Allocate. A follow up PR need to fix a few more cases in the hybrid script parsing before everything can be made consistent.
…pache#6317) Now that we have type_annotation in tir::Var. We should make sure that the type annotation to be consistent with the dtype in Buffer declaration and Allocation. This change allows future passes to directly use the content type information via type_annotation. This PR turns on the enforcement on Buffer and also fixed a few cases for Allocate. A follow up PR need to fix a few more cases in the hybrid script parsing before everything can be made consistent.
…pache#6317) Now that we have type_annotation in tir::Var. We should make sure that the type annotation to be consistent with the dtype in Buffer declaration and Allocation. This change allows future passes to directly use the content type information via type_annotation. This PR turns on the enforcement on Buffer and also fixed a few cases for Allocate. A follow up PR need to fix a few more cases in the hybrid script parsing before everything can be made consistent.
Now that we have type_annotation in
tir::Var
.We should make sure that the type annotation to be consistent with the dtype in Buffer declaration and Allocation.
This change allows future passes to directly use the content type information via type_annotation.
This PR turns on the enforcement on Buffer and also fixed a few cases for Allocate.
A follow up PR need to fix a few more cases in the hybrid script parsing
before everything can be made consistent.