Skip to content

Conversation

@mahmood82
Copy link
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.

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.
return success();
}

+ // Allow scalar-to-scalar bitcasts if they have the same size
Copy link
Member

Choose a reason for hiding this comment

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

This is probably not intentional?

}

// Allow scalar-to-scalar bitcasts if they have the same size
if (!mlir::isa<cir::VectorType>(srcType) &&
Copy link
Member

Choose a reason for hiding this comment

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

Please use cir::isScalarType, should be available via CIRTypes.h

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