-
Notifications
You must be signed in to change notification settings - Fork 145
[CIR] Track size_t and int size with module attributes #1389
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
Conversation
A small question here: would it be better to provide all these type-layout related information within a single attribute, instead of spreading them into separate attributes? For example, would it be better if we update this PR to instead provide a single attribute like this: module attributes {
cir.type_sizes = #cir.type_sizes<
int = 32,
size_t = 64,
>,
} {} |
That makes sense! Now I just changed it to be exactly like this. |
@AdUhTkJm thanks for working on this - really good point @Lancern. My suggestion is that we do this for all types in
|
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.
Comment above
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, one more round of review
To give LoweringPrepare type information from `CIRGenTypeCache`, this PR adds two attributes to ModuleOp: ```mlir module attributes { cir.int_size = #cir.int_size<32>, cir.size_type_size = #cir.size_type_size<64>, ... } {} ``` The `CIRDataLayout` class is also extended to have `getPtrDiffTy` and so on. Some tests that only expects `cir.lang` and `cir.sob` are also changed to take this into account.
To give LoweringPrepare type information from `CIRGenTypeCache`, this PR adds two attributes to ModuleOp: ```mlir module attributes { cir.int_size = #cir.int_size<32>, cir.size_type_size = #cir.size_type_size<64>, ... } {} ``` The `CIRDataLayout` class is also extended to have `getPtrDiffTy` and so on. Some tests that only expects `cir.lang` and `cir.sob` are also changed to take this into account.
To give LoweringPrepare type information from `CIRGenTypeCache`, this PR adds two attributes to ModuleOp: ```mlir module attributes { cir.int_size = #cir.int_size<32>, cir.size_type_size = #cir.size_type_size<64>, ... } {} ``` The `CIRDataLayout` class is also extended to have `getPtrDiffTy` and so on. Some tests that only expects `cir.lang` and `cir.sob` are also changed to take this into account.
To give LoweringPrepare type information from
CIRGenTypeCache
, this PR adds two attributes to ModuleOp:The
CIRDataLayout
class is also extended to havegetPtrDiffTy
and so on.Some tests that only expects
cir.lang
andcir.sob
are also changed to take this into account.