Skip to content
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

Merged
merged 1 commit into from Jul 3, 2023

Conversation

sitio-couto
Copy link
Collaborator

@sitio-couto sitio-couto commented Jul 3, 2023

Stack from ghstack (oldest at bottom):

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.

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]
Copy link
Member

@bcardosolopes bcardosolopes left a 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.

@sitio-couto
Copy link
Collaborator Author

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.

@sitio-couto sitio-couto merged commit 0cfd8d9 into gh/sitio-couto/42/base Jul 3, 2023
1 check passed
sitio-couto added a commit that referenced this pull request Jul 3, 2023
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
@sitio-couto sitio-couto deleted the gh/sitio-couto/42/head branch July 3, 2023 20:38
lanza pushed a commit that referenced this pull request Jul 6, 2023
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
lanza pushed a commit that referenced this pull request Oct 27, 2023
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
lanza pushed a commit that referenced this pull request Dec 20, 2023
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
lanza pushed a commit that referenced this pull request Jan 29, 2024
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
lanza pushed a commit to lanza/llvm-project that referenced this pull request Feb 8, 2024
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
lanza pushed a commit that referenced this pull request Mar 23, 2024
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
eZWALT pushed a commit to eZWALT/clangir that referenced this pull request Mar 24, 2024
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
lanza pushed a commit that referenced this pull request Apr 29, 2024
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
lanza pushed a commit that referenced this pull request Apr 29, 2024
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
eZWALT pushed a commit to eZWALT/clangir that referenced this pull request Apr 29, 2024
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
lanza pushed a commit that referenced this pull request Apr 29, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants