[Mlir-commits] [mlir] [mlir] ArithToLLVM: fix memref bitcast lowering (PR #125148)

Ivan Butygin llvmlistbot at llvm.org
Fri Jan 31 07:04:50 PST 2025


================
@@ -54,6 +54,23 @@ struct ConstrainedVectorConvertToLLVMPattern
   }
 };
 
+/// No-op bitcast.
+struct IdentityBitcastLowering final
+    : public OpConversionPattern<arith::BitcastOp> {
+  using OpConversionPattern::OpConversionPattern;
+
+  LogicalResult
+  matchAndRewrite(arith::BitcastOp op, OpAdaptor adaptor,
+                  ConversionPatternRewriter &rewriter) const final {
+    Value src = adaptor.getIn();
+    if (src.getType() != getTypeConverter()->convertType(op.getType()))
----------------
Hardcode84 wrote:

Not sure if we need any memref-specific logic here, just handling same input/output converted types should be enough.

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


More information about the Mlir-commits mailing list