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

ZIR-343: Allow arrays in externs #188

Merged
merged 1 commit into from
Feb 19, 2025
Merged

Conversation

jacobdweightman
Copy link
Contributor

This PR simplifies the bigint implementation in the v2 circuit, and resolves an open TODO in the v2 circuit code.

@github-actions github-actions bot changed the title Allow arrays in externs ZIR-343: Allow arrays in externs Feb 18, 2025
@@ -633,6 +638,13 @@ void LoweringImpl::gen(ExternOp ext, ComponentBuilder& cb) {
}
return builder.create<ZStruct::PackOp>(ext.getLoc(), ty, fields);
})
.Case<ArrayType>([&](ArrayType ty) {
llvm::SmallVector<Value> elements;
Copy link
Contributor

Choose a reason for hiding this comment

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

You already know how many elements you're going to need, so why not allocate them up front instead of pushing and resizing?

@jacobdweightman jacobdweightman merged commit 2307898 into main Feb 19, 2025
10 checks passed
@jacobdweightman jacobdweightman deleted the jacob/arrays-in-externs branch February 19, 2025 19:23
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