Skip to content

[CIR][ThroughMLIR] remove nested memref wrapper for array types #1412

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

Merged
merged 1 commit into from
Feb 27, 2025

Conversation

PikachuHyA
Copy link
Collaborator

for example, lower
cir.alloca !cir.array<!s32i x N>, !cir.ptr<!cir.array<!s32i x N>>
to memref.alloca() : memref<Nxi32>

see #1405

for example,
`cir.alloca !cir.array<!s32i x N>, !cir.ptr<!cir.array<!s32i x N>>`
to `memref.alloca() : memref<Nxi32>`

see llvm#1405
@Lancern
Copy link
Member

Lancern commented Feb 26, 2025

Not quite related to this PR, but it seems that currently we lower !cir.array to !memref. This looks strange since !memref looks more like !cir.ptr<!cir.array> to me. Maybe we should fix this in later changes?

@bcardosolopes
Copy link
Member

@keryell what's your take here?

@keryell
Copy link
Collaborator

keryell commented Feb 26, 2025

I fixed this issue already in #1334, more precisely with 0fda938 (#1334)
There are currently a lot of issues in CIR -> MLIR lowering where a lot of things are just working by chance with ad-hoc implementation...
It is difficult to have a good separation of concerns in my experimental CR since I am experimenting around design variations. ☹️

Copy link
Collaborator

@keryell keryell 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 an improvement to the current situation.
Thanks!

@bcardosolopes bcardosolopes merged commit ab1d10b into llvm:main Feb 27, 2025
7 checks passed
@PikachuHyA PikachuHyA deleted the fix_array_alloca branch February 28, 2025 02:10
xlauko pushed a commit to xlauko/clangir that referenced this pull request Feb 28, 2025
…#1412)

for example, lower 
`cir.alloca !cir.array<!s32i x N>, !cir.ptr<!cir.array<!s32i x N>>` 
to `memref.alloca() : memref<Nxi32>`

see llvm#1405
xlauko pushed a commit to xlauko/clangir that referenced this pull request Feb 28, 2025
…#1412)

for example, lower 
`cir.alloca !cir.array<!s32i x N>, !cir.ptr<!cir.array<!s32i x N>>` 
to `memref.alloca() : memref<Nxi32>`

see llvm#1405
@PikachuHyA
Copy link
Collaborator Author

Not quite related to this PR, but it seems that currently we lower !cir.array to !memref. This looks strange since !memref looks more like !cir.ptr<!cir.array> to me. Maybe we should fix this in later changes?

hi @Lancern, I apologize for overlooking this comment. Since the PR has already been merged, let's discuss this further in the issue thread. #1405

lanza pushed a commit that referenced this pull request Mar 18, 2025
for example, lower 
`cir.alloca !cir.array<!s32i x N>, !cir.ptr<!cir.array<!s32i x N>>` 
to `memref.alloca() : memref<Nxi32>`

see #1405
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.

4 participants