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
[CIR][CIRGen] Pass field index to cir.struct_element_addr #148
Conversation
A `member_index` index attribute in `cir.struct_element_addr` now holds the index for the member being accessed. A APInt is used as the storage type for the index, alongside a custom builder to abstract the APInt object creation. Before, we only passed the name of the field to cir.struct_element_addr, which was not very useful since it couldn't be used to recover the index of the member being accessed. This index is essential for lowering CIR to LLVM, as LLVM needs to know which element is being accessed in the struct data aggregate. [ghstack-poisoned]
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.
This is great, glad you beat me to it, we needed this to happen sooner or later.
Brain dump: keeping the name at the "callsite" is a bit silly, we should probably store these names into the cir.struct
themselves and when we create a pretty printer for struct_element_addr
we could print the names for convenience, by just looking at the type.
Agreed! I'll track this with an issue. |
A `member_index` index attribute in `cir.struct_element_addr` now holds the index for the member being accessed. A APInt is used as the storage type for the index, alongside a custom builder to abstract the APInt object creation. Before, we only passed the name of the field to cir.struct_element_addr, which was not very useful since it couldn't be used to recover the index of the member being accessed. This index is essential for lowering CIR to LLVM, as LLVM needs to know which element is being accessed in the struct data aggregate. ghstack-source-id: fa68727f9bd65016647d7ae3acbbf1b109fa79ec Pull Request resolved: #148
A `member_index` index attribute in `cir.struct_element_addr` now holds the index for the member being accessed. A APInt is used as the storage type for the index, alongside a custom builder to abstract the APInt object creation. Before, we only passed the name of the field to cir.struct_element_addr, which was not very useful since it couldn't be used to recover the index of the member being accessed. This index is essential for lowering CIR to LLVM, as LLVM needs to know which element is being accessed in the struct data aggregate. ghstack-source-id: fa68727f9bd65016647d7ae3acbbf1b109fa79ec Pull Request resolved: #148
A `member_index` index attribute in `cir.struct_element_addr` now holds the index for the member being accessed. A APInt is used as the storage type for the index, alongside a custom builder to abstract the APInt object creation. Before, we only passed the name of the field to cir.struct_element_addr, which was not very useful since it couldn't be used to recover the index of the member being accessed. This index is essential for lowering CIR to LLVM, as LLVM needs to know which element is being accessed in the struct data aggregate. ghstack-source-id: fa68727f9bd65016647d7ae3acbbf1b109fa79ec Pull Request resolved: #148
A `member_index` index attribute in `cir.struct_element_addr` now holds the index for the member being accessed. A APInt is used as the storage type for the index, alongside a custom builder to abstract the APInt object creation. Before, we only passed the name of the field to cir.struct_element_addr, which was not very useful since it couldn't be used to recover the index of the member being accessed. This index is essential for lowering CIR to LLVM, as LLVM needs to know which element is being accessed in the struct data aggregate. ghstack-source-id: fa68727f9bd65016647d7ae3acbbf1b109fa79ec Pull Request resolved: #148
A `member_index` index attribute in `cir.struct_element_addr` now holds the index for the member being accessed. A APInt is used as the storage type for the index, alongside a custom builder to abstract the APInt object creation. Before, we only passed the name of the field to cir.struct_element_addr, which was not very useful since it couldn't be used to recover the index of the member being accessed. This index is essential for lowering CIR to LLVM, as LLVM needs to know which element is being accessed in the struct data aggregate. ghstack-source-id: fa68727f9bd65016647d7ae3acbbf1b109fa79ec Pull Request resolved: #148
A `member_index` index attribute in `cir.struct_element_addr` now holds the index for the member being accessed. A APInt is used as the storage type for the index, alongside a custom builder to abstract the APInt object creation. Before, we only passed the name of the field to cir.struct_element_addr, which was not very useful since it couldn't be used to recover the index of the member being accessed. This index is essential for lowering CIR to LLVM, as LLVM needs to know which element is being accessed in the struct data aggregate. ghstack-source-id: fa68727f9bd65016647d7ae3acbbf1b109fa79ec Pull Request resolved: llvm/clangir#148
A `member_index` index attribute in `cir.struct_element_addr` now holds the index for the member being accessed. A APInt is used as the storage type for the index, alongside a custom builder to abstract the APInt object creation. Before, we only passed the name of the field to cir.struct_element_addr, which was not very useful since it couldn't be used to recover the index of the member being accessed. This index is essential for lowering CIR to LLVM, as LLVM needs to know which element is being accessed in the struct data aggregate. ghstack-source-id: fa68727f9bd65016647d7ae3acbbf1b109fa79ec Pull Request resolved: #148
A `member_index` index attribute in `cir.struct_element_addr` now holds the index for the member being accessed. A APInt is used as the storage type for the index, alongside a custom builder to abstract the APInt object creation. Before, we only passed the name of the field to cir.struct_element_addr, which was not very useful since it couldn't be used to recover the index of the member being accessed. This index is essential for lowering CIR to LLVM, as LLVM needs to know which element is being accessed in the struct data aggregate. ghstack-source-id: fa68727f9bd65016647d7ae3acbbf1b109fa79ec Pull Request resolved: llvm#148
A `member_index` index attribute in `cir.struct_element_addr` now holds the index for the member being accessed. A APInt is used as the storage type for the index, alongside a custom builder to abstract the APInt object creation. Before, we only passed the name of the field to cir.struct_element_addr, which was not very useful since it couldn't be used to recover the index of the member being accessed. This index is essential for lowering CIR to LLVM, as LLVM needs to know which element is being accessed in the struct data aggregate. ghstack-source-id: fa68727f9bd65016647d7ae3acbbf1b109fa79ec Pull Request resolved: #148
A `member_index` index attribute in `cir.struct_element_addr` now holds the index for the member being accessed. A APInt is used as the storage type for the index, alongside a custom builder to abstract the APInt object creation. Before, we only passed the name of the field to cir.struct_element_addr, which was not very useful since it couldn't be used to recover the index of the member being accessed. This index is essential for lowering CIR to LLVM, as LLVM needs to know which element is being accessed in the struct data aggregate. ghstack-source-id: fa68727f9bd65016647d7ae3acbbf1b109fa79ec Pull Request resolved: #148
A `member_index` index attribute in `cir.struct_element_addr` now holds the index for the member being accessed. A APInt is used as the storage type for the index, alongside a custom builder to abstract the APInt object creation. Before, we only passed the name of the field to cir.struct_element_addr, which was not very useful since it couldn't be used to recover the index of the member being accessed. This index is essential for lowering CIR to LLVM, as LLVM needs to know which element is being accessed in the struct data aggregate. ghstack-source-id: fa68727f9bd65016647d7ae3acbbf1b109fa79ec Pull Request resolved: llvm#148
A `member_index` index attribute in `cir.struct_element_addr` now holds the index for the member being accessed. A APInt is used as the storage type for the index, alongside a custom builder to abstract the APInt object creation. Before, we only passed the name of the field to cir.struct_element_addr, which was not very useful since it couldn't be used to recover the index of the member being accessed. This index is essential for lowering CIR to LLVM, as LLVM needs to know which element is being accessed in the struct data aggregate. ghstack-source-id: fa68727f9bd65016647d7ae3acbbf1b109fa79ec Pull Request resolved: #148
Stack from ghstack (oldest at bottom):
A
member_index
index attribute incir.struct_element_addr
now holdsthe index for the member being accessed. A APInt is used as the storage
type for the index, alongside a custom builder to abstract the APInt
object creation.
Before, we only passed the name of the field to cir.struct_element_addr,
which was not very useful since it couldn't be used to recover the index
of the member being accessed. This index is essential for lowering CIR
to LLVM, as LLVM needs to know which element is being accessed in the
struct data aggregate.