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

Handle constant sized array allocations using no extension #2713

Merged
merged 5 commits into from
Sep 10, 2024

Conversation

victor-eds
Copy link
Contributor

In LLVM, array allocations might have constant size:

%array = alloca i32, i64 4, align 4

Represent this kind of allocations using OpVariable + OpBitcast.

Before this patch, the SPV_INTEL_variable_length_array extension was used.

In LLVM, array allocations might have constant size:

```llvm
%array = alloca i32, i64 4, align 4
```

Represent this kind of allocations using `OpVariable + OpBitcast`.

Before this patch, the `SPV_INTEL_variable_length_array` extension was
used.

Signed-off-by: Victor Perez <victor.perez@codeplay.com>
test/simple.ll Outdated Show resolved Hide resolved
@victor-eds
Copy link
Contributor Author

MLIR-based compilers will probably generate this kind of allocations for constant size array allocations as that's what MLIR memory allocation operations lower to.

@victor-eds
Copy link
Contributor Author

@MrSidims can I get a review here?

Copy link
Contributor

@MrSidims MrSidims left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this! Please consider a test change

test/simple.ll Outdated Show resolved Hide resolved
@victor-eds
Copy link
Contributor Author

Failing tests not because of lines I've even touched.

@MrSidims
Copy link
Contributor

Restarting CI

@MrSidims MrSidims closed this Sep 10, 2024
@MrSidims MrSidims reopened this Sep 10, 2024
@MrSidims MrSidims merged commit ea2fcc1 into KhronosGroup:main Sep 10, 2024
16 of 17 checks passed
@victor-eds victor-eds deleted the constant-alloca branch September 10, 2024 12:02
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