Skip to content

[CIR][ThroughMLIR] Support array type GlobalOp lowering with initial values #753

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
Aug 2, 2024

Conversation

ShivaChen
Copy link
Contributor

@ShivaChen ShivaChen commented Jul 24, 2024

This commit makes the changes as following.

  1. Enable array type GlobalOp lowering with initial values

  2. Add error message when array size is not equal to initial string value size
    E.g. char big_string[10] = "abc";

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.

Awesome, way to go!

Can you please do the refactoring first on a NFC PR and then follow up with the actual change in this PR (or however you want to present these two PRs)? The change kinda sneaks in the refactoring. Since you are changing a function that gets used by both, it'd be nice to add one CIR->LLVM testcase as well (no need to add as much as you add for MLIR, one should be good enough)

@ShivaChen
Copy link
Contributor Author

Awesome, way to go!

Can you please do the refactoring first on a NFC PR and then follow up with the actual change in this PR (or however you want to present these two PRs)? The change kinda sneaks in the refactoring. Since you are changing a function that gets used by both, it'd be nice to add one CIR->LLVM testcase as well (no need to add as much as you add for MLIR, one should be good enough)

Sure, will do.

@ShivaChen
Copy link
Contributor Author

I have created a refactoring PR #754.
I can't be sure the best way to stack two PR. So still push two commits in this PR.
I could force push to remove the first commit once the refactoring PR landing.

It turns out the way to fix "array size greater than initial string value" only works for MLIR lowering path.
LLVM lowering path still has issue. So I change to introduce error message and perhaps fix in other PR.

…values

This commit makes the changes as following.

1. Enable array type GlobalOp lowering with initial values

2. Add error message when array size is not equal to initial string value
   E.g. char big_string[10] = "abc";
@ShivaChen ShivaChen force-pushed the global-array-init branch from 4ad09ff to 124d8cf Compare July 25, 2024 09:09
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.

LGTM

@bcardosolopes bcardosolopes merged commit e136285 into llvm:main Aug 2, 2024
6 checks passed
Hugobros3 pushed a commit to shady-gang/clangir that referenced this pull request Oct 2, 2024
…values (llvm#753)

This commit makes the changes as following.

1. Enable array type GlobalOp lowering with initial values

2. Add error message when array size is not equal to initial string
value size
       E.g. char big_string[10] = "abc";
smeenai pushed a commit to smeenai/clangir that referenced this pull request Oct 9, 2024
…values (llvm#753)

This commit makes the changes as following.

1. Enable array type GlobalOp lowering with initial values

2. Add error message when array size is not equal to initial string
value size
       E.g. char big_string[10] = "abc";
smeenai pushed a commit to smeenai/clangir that referenced this pull request Oct 9, 2024
…values (llvm#753)

This commit makes the changes as following.

1. Enable array type GlobalOp lowering with initial values

2. Add error message when array size is not equal to initial string
value size
       E.g. char big_string[10] = "abc";
keryell pushed a commit to keryell/clangir that referenced this pull request Oct 19, 2024
…values (llvm#753)

This commit makes the changes as following.

1. Enable array type GlobalOp lowering with initial values

2. Add error message when array size is not equal to initial string
value size
       E.g. char big_string[10] = "abc";
lanza pushed a commit that referenced this pull request Nov 5, 2024
…values (#753)

This commit makes the changes as following.

1. Enable array type GlobalOp lowering with initial values

2. Add error message when array size is not equal to initial string
value size
       E.g. char big_string[10] = "abc";
lanza pushed a commit that referenced this pull request Mar 18, 2025
…values (#753)

This commit makes the changes as following.

1. Enable array type GlobalOp lowering with initial values

2. Add error message when array size is not equal to initial string
value size
       E.g. char big_string[10] = "abc";
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.

2 participants