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.
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
[flang][debug] Support derived type components with box types. #109424
[flang][debug] Support derived type components with box types. #109424
Changes from 3 commits
d362dea
01739a9
4f81e4d
2e726b3
9f162b3
a45bef3
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
So far I was rather against handling fir.box<> into
getTypeSizeAndAlignment
because to me it is meant to be an abstract type as much possible (could be implemented as a CFI descriptor, or some descriptor compatible with existing compilers if we wanted). Instead, I was more in favor of translating type to LLVM and usinggetTypeSizeAndAlignment
at that level. That way, the codegen of abstract FIR types is centralized in the type codegen and needs not to be spilled in other places.Now I understand this is inconvenient given there are several places that needs to know about the size at different stage of the compilation.
But as far as debugging is concerned, I would still be in favor of calling translating types to LLVM and calling
getTypeSizeAndAlignment
with that.Otherwise, we at least need to centralize all low level descriptor related tools in some flang/Optimizer/Dialect/Support/DescriptorModel.h file. The Dialect library should not depend upon Codegen.
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.
Thanks for your comments. I have updated the PR and it does not use
getTypeSizeAndAlignment
to get the size for any type. We use LLVMTypeConverter to convert fieldTy into LLVM type and then use DataLayout to get the size. It all seems to works ok. My concern was whether it is safe to callDataLayout::getTypeSize
on any type that is returned byLLVMTypeConverter::convertType
. I did not see any problem with my testing but would be happy to add any type specific check.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.
What about assumed-ranks, the descriptor size is not a compile time constant? They cannot be used as derived type components, but this generic helper would need to handle them or bail correctly.