Skip to content
This repository was archived by the owner on Feb 21, 2026. It is now read-only.

[CIR] Support mixed scalar/vector init-list vector construction#2095

Merged
bcardosolopes merged 2 commits intollvm:mainfrom
mahmood82:users/mahmood/vec_initializer
Jan 28, 2026
Merged

[CIR] Support mixed scalar/vector init-list vector construction#2095
bcardosolopes merged 2 commits intollvm:mainfrom
mahmood82:users/mahmood/vec_initializer

Conversation

@mahmood82
Copy link
Copy Markdown
Collaborator

Extend vector init-list emission to accept a mix of scalar and vector-valued initializers by flattening sub-vectors elementwise.

This enables nested vector construction patterns such as (int3)(int2, scalar) and aligns CIR behavior with Clang vector semantics.

@mahmood82
Copy link
Copy Markdown
Collaborator Author

This PR depends on #2080

@bcardosolopes
Copy link
Copy Markdown
Member

I'll take a look once #2080 lands, to get stacks reviewed you need to use things like https://llvm.org/docs/GitHub.html#stacked-pull-requests

Extend vector init-list emission to accept a mix of scalar and
vector-valued initializers by flattening sub-vectors elementwise.

This enables nested vector construction patterns such as
(int3)(int2, scalar) and aligns CIR behavior with Clang vector semantics.
@mahmood82 mahmood82 force-pushed the users/mahmood/vec_initializer branch from 466b19e to 910dd70 Compare January 23, 2026 13:46
@mahmood82
Copy link
Copy Markdown
Collaborator Author

I'll take a look once #2080 lands, to get stacks reviewed you need to use things like https://llvm.org/docs/GitHub.html#stacked-pull-requests

The review is ready now. Thanks!

Comment thread clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp
Copy link
Copy Markdown
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 deecf66 into llvm:main Jan 28, 2026
6 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants