[Mlir-commits] [mlir] [mlir][arith] Support bitcast with index type (PR #121455)

Longsheng Mou llvmlistbot at llvm.org
Thu Jan 2 01:07:16 PST 2025


================
@@ -1723,7 +1723,18 @@ bool arith::BitcastOp::areCastCompatible(TypeRange inputs, TypeRange outputs) {
   if (!srcType || !dstType)
     return false;
 
-  return srcType.getIntOrFloatBitWidth() == dstType.getIntOrFloatBitWidth();
+  unsigned srcWidth, dstWidth;
+  if (auto indexTy = dyn_cast<IndexType>(srcType))
+    srcWidth = IndexType::kInternalStorageBitWidth;
----------------
CoTinker wrote:

Okay, I see.

https://github.com/llvm/llvm-project/pull/121455


More information about the Mlir-commits mailing list