Skip to content

Conversation

@lanza
Copy link
Member

@lanza lanza commented Nov 22, 2025

Stack from ghstack (oldest at bottom):

Implements support for ext_vector_type with bool elements. Bool vectors
are represented as integers in CIR (e.g., bool4 uses !cir.int<u, 8>),
matching traditional CodeGen's approach.

Key changes:

  • CIRGenTypes: Convert ExtVectorBoolType to integer storage (iN where N = max(num_elements, 8))
  • CIRGenExprConst: Pack bool elements into integer bits during constant initialization
  • CIRGenExprScalar: Handle subscript access by extracting bits from integer
  • CIRGenExpr: Skip vector optimizations for ExtVectorBoolType in load/store paths

Tests added for basic initialization, subscript access, and bitwise operations.

[ghstack-poisoned]
lanza added a commit that referenced this pull request Nov 22, 2025
Implements support for ext_vector_type with bool elements. Bool vectors
are represented as integers in CIR (e.g., bool4 uses !cir.int<u, 8>),
matching traditional CodeGen's approach.

Key changes:
- CIRGenTypes: Convert ExtVectorBoolType to integer storage (iN where N = max(num_elements, 8))
- CIRGenExprConst: Pack bool elements into integer bits during constant initialization
- CIRGenExprScalar: Handle subscript access by extracting bits from integer
- CIRGenExpr: Skip vector optimizations for ExtVectorBoolType in load/store paths

Tests added for basic initialization, subscript access, and bitwise operations.


ghstack-source-id: 29c37cf
Pull-Request: #1998
[ghstack-poisoned]
lanza added a commit that referenced this pull request Nov 22, 2025
Implements support for ext_vector_type with bool elements. Bool vectors
are represented as integers in CIR (e.g., bool4 uses !cir.int<u, 8>),
matching traditional CodeGen's approach.

Key changes:
- CIRGenTypes: Convert ExtVectorBoolType to integer storage (iN where N = max(num_elements, 8))
- CIRGenExprConst: Pack bool elements into integer bits during constant initialization
- CIRGenExprScalar: Handle subscript access by extracting bits from integer
- CIRGenExpr: Skip vector optimizations for ExtVectorBoolType in load/store paths

Tests added for basic initialization, subscript access, and bitwise operations.

ghstack-source-id: b8879c0
Pull-Request: #1998
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@lanza lanza closed this Nov 23, 2025
lanza added a commit that referenced this pull request Nov 24, 2025
Implements support for ext_vector_type with bool elements. Bool vectors
are represented as integers in CIR (e.g., bool4 uses !cir.int<u, 8>),
matching traditional CodeGen's approach.

Key changes:
- CIRGenTypes: Convert ExtVectorBoolType to integer storage (iN where N = max(num_elements, 8))
- CIRGenExprConst: Pack bool elements into integer bits during constant initialization
- CIRGenExprScalar: Handle subscript access by extracting bits from integer
- CIRGenExpr: Skip vector optimizations for ExtVectorBoolType in load/store paths

Tests added for basic initialization, subscript access, and bitwise operations.

ghstack-source-id: 677025c
Pull-Request: #1998
@lanza lanza reopened this Nov 24, 2025
[ghstack-poisoned]
@bcardosolopes
Copy link
Member

In ClangIR, ExtVectorBoolType is always represented as an integer type (!cir.int<u, N>) throughout the IR, including both in registers and in memory. This differs from traditional CodeGen where it may exist as a vector type that needs conversion to integer for storage

I'm not convinced this is how we want to proceed, what are the tradeoffs here?

@lanza lanza marked this pull request as draft November 24, 2025 18:39
lanza added a commit that referenced this pull request Nov 25, 2025
Implements support for ext_vector_type with bool elements. Bool vectors
are represented as integers in CIR (e.g., bool4 uses !cir.int<u, 8>),
matching traditional CodeGen's approach.

Key changes:
- CIRGenTypes: Convert ExtVectorBoolType to integer storage (iN where N = max(num_elements, 8))
- CIRGenExprConst: Pack bool elements into integer bits during constant initialization
- CIRGenExprScalar: Handle subscript access by extracting bits from integer
- CIRGenExpr: Skip vector optimizations for ExtVectorBoolType in load/store paths

Tests added for basic initialization, subscript access, and bitwise operations.

ghstack-source-id: 677025c
Pull-Request: #1998
lanza added a commit that referenced this pull request Nov 25, 2025
Implements support for ext_vector_type with bool elements. Bool vectors
are represented as integers in CIR (e.g., bool4 uses !cir.int<u, 8>),
matching traditional CodeGen's approach.

Key changes:
- CIRGenTypes: Convert ExtVectorBoolType to integer storage (iN where N = max(num_elements, 8))
- CIRGenExprConst: Pack bool elements into integer bits during constant initialization
- CIRGenExprScalar: Handle subscript access by extracting bits from integer
- CIRGenExpr: Skip vector optimizations for ExtVectorBoolType in load/store paths

Tests added for basic initialization, subscript access, and bitwise operations.

ghstack-source-id: 677025c
Pull-Request: #1998
lanza added a commit that referenced this pull request Nov 26, 2025
Implements support for ext_vector_type with bool elements. Bool vectors
are represented as integers in CIR (e.g., bool4 uses !cir.int<u, 8>),
matching traditional CodeGen's approach.

Key changes:
- CIRGenTypes: Convert ExtVectorBoolType to integer storage (iN where N = max(num_elements, 8))
- CIRGenExprConst: Pack bool elements into integer bits during constant initialization
- CIRGenExprScalar: Handle subscript access by extracting bits from integer
- CIRGenExpr: Skip vector optimizations for ExtVectorBoolType in load/store paths

Tests added for basic initialization, subscript access, and bitwise operations.

ghstack-source-id: 677025c
Pull-Request: #1998
lanza added a commit that referenced this pull request Nov 26, 2025
Implements support for ext_vector_type with bool elements. Bool vectors
are represented as integers in CIR (e.g., bool4 uses !cir.int<u, 8>),
matching traditional CodeGen's approach.

Key changes:
- CIRGenTypes: Convert ExtVectorBoolType to integer storage (iN where N = max(num_elements, 8))
- CIRGenExprConst: Pack bool elements into integer bits during constant initialization
- CIRGenExprScalar: Handle subscript access by extracting bits from integer
- CIRGenExpr: Skip vector optimizations for ExtVectorBoolType in load/store paths

Tests added for basic initialization, subscript access, and bitwise operations.

ghstack-source-id: 677025c
Pull-Request: #1998
lanza added a commit that referenced this pull request Nov 26, 2025
Implements support for ext_vector_type with bool elements. Bool vectors
are represented as integers in CIR (e.g., bool4 uses !cir.int<u, 8>),
matching traditional CodeGen's approach.

Key changes:
- CIRGenTypes: Convert ExtVectorBoolType to integer storage (iN where N = max(num_elements, 8))
- CIRGenExprConst: Pack bool elements into integer bits during constant initialization
- CIRGenExprScalar: Handle subscript access by extracting bits from integer
- CIRGenExpr: Skip vector optimizations for ExtVectorBoolType in load/store paths

Tests added for basic initialization, subscript access, and bitwise operations.

ghstack-source-id: 677025c
Pull-Request: #1998
lanza added a commit that referenced this pull request Nov 27, 2025
Implements support for ext_vector_type with bool elements. Bool vectors
are represented as integers in CIR (e.g., bool4 uses !cir.int<u, 8>),
matching traditional CodeGen's approach.

Key changes:
- CIRGenTypes: Convert ExtVectorBoolType to integer storage (iN where N = max(num_elements, 8))
- CIRGenExprConst: Pack bool elements into integer bits during constant initialization
- CIRGenExprScalar: Handle subscript access by extracting bits from integer
- CIRGenExpr: Skip vector optimizations for ExtVectorBoolType in load/store paths

Tests added for basic initialization, subscript access, and bitwise operations.

ghstack-source-id: 677025c
Pull-Request: #1998
lanza added a commit to lanza/llvm-project that referenced this pull request Dec 4, 2025
Implements support for ext_vector_type with bool elements. Bool vectors
are represented as integers in CIR (e.g., bool4 uses !cir.int<u, 8>),
matching traditional CodeGen's approach.

Key changes:
- CIRGenTypes: Convert ExtVectorBoolType to integer storage (iN where N = max(num_elements, 8))
- CIRGenExprConst: Pack bool elements into integer bits during constant initialization
- CIRGenExprScalar: Handle subscript access by extracting bits from integer
- CIRGenExpr: Skip vector optimizations for ExtVectorBoolType in load/store paths

Tests added for basic initialization, subscript access, and bitwise operations.

ghstack-source-id: 677025c94e759ae71cebcba8fa7bccaebe5c4163
Pull-Request: llvm/clangir#1998
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.

3 participants