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

[CIR] Relax CastOp verifier for scalar bitcasts#2086

Merged
bcardosolopes merged 2 commits intollvm:mainfrom
mahmood82:users/mahmood/scalar_to_scalar_bitcast
Jan 23, 2026
Merged

[CIR] Relax CastOp verifier for scalar bitcasts#2086
bcardosolopes merged 2 commits intollvm:mainfrom
mahmood82:users/mahmood/scalar_to_scalar_bitcast

Conversation

@mahmood82
Copy link
Copy Markdown
Collaborator

Relax CastOp verification to allow scalar-to-scalar bitcasts when the source and result types have identical DataLayout sizes. This enables builtin as_type-style conversions (e.g. float <-> int) to be represented as cir.cast bitcast operations without being rejected by the verifier.

Comment thread patch.diff Outdated
Comment thread clang/lib/CIR/Dialect/IR/CIRDialect.cpp Outdated
Relax CastOp verification to allow scalar-to-scalar bitcasts when the
source and result types have identical DataLayout sizes. This enables
builtin as_type-style conversions (e.g. float <-> int) to be represented
as cir.cast bitcast operations without being rejected by the verifier.
@mahmood82 mahmood82 force-pushed the users/mahmood/scalar_to_scalar_bitcast branch from 5aef593 to 4234363 Compare January 22, 2026 09:09
@bcardosolopes bcardosolopes merged commit 1bfea06 into llvm:main Jan 23, 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