[Mlir-commits] [mlir] [mlir][LLVM] Add the `byte` type to the LLVM dialect (PR #203795)
Fabian Mora
llvmlistbot at llvm.org
Mon Jun 15 04:39:03 PDT 2026
Markus =?utf-8?q?Böck?= <markus.boeck02 at gmail.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/203795 at github.com>
================
@@ -3868,10 +3867,15 @@ OpFoldResult LLVM::BitcastOp::fold(FoldAdaptor adaptor) {
}
LogicalResult LLVM::BitcastOp::verify() {
- auto resultType = llvm::dyn_cast<LLVMPointerType>(
- extractVectorElementType(getResult().getType()));
- auto sourceType = llvm::dyn_cast<LLVMPointerType>(
- extractVectorElementType(getArg().getType()));
+ Type srcElemType = extractVectorElementType(getArg().getType());
+ Type dstElemType = extractVectorElementType(getResult().getType());
+
+ // Byte types may be cast from/to any type pointer constraints.
+ if (isa<LLVMByteType>(srcElemType) || isa<LLVMByteType>(dstElemType))
+ return success();
----------------
fabianmcg wrote:
I don't know if there's another td constraint checking this, but per the lang ref
> [The bit sizes of value and the destination type, ty2, must be identical.](https://llvm.org/docs/LangRef.html#id305)
https://github.com/llvm/llvm-project/pull/203795
More information about the Mlir-commits
mailing list