diff --git a/mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp b/mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp --- a/mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp +++ b/mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp @@ -1746,19 +1746,18 @@ using ConvertOpToLLVMPattern::ConvertOpToLLVMPattern; LogicalResult - matchAndRewrite(CreateComplexOp op, ArrayRef operands, + matchAndRewrite(CreateComplexOp complexOp, ArrayRef operands, ConversionPatternRewriter &rewriter) const override { - auto complexOp = cast(op); CreateComplexOp::Adaptor transformed(operands); // Pack real and imaginary part in a complex number struct. - auto loc = op.getLoc(); + auto loc = complexOp.getLoc(); auto structType = typeConverter->convertType(complexOp.getType()); auto complexStruct = ComplexStructBuilder::undef(rewriter, loc, structType); complexStruct.setReal(rewriter, loc, transformed.real()); complexStruct.setImaginary(rewriter, loc, transformed.imaginary()); - rewriter.replaceOp(op, {complexStruct}); + rewriter.replaceOp(complexOp, {complexStruct}); return success(); } }; @@ -1805,8 +1804,7 @@ BinaryComplexOperands unpackBinaryComplexOperands(OpTy op, ArrayRef operands, ConversionPatternRewriter &rewriter) { - auto bop = cast(op); - auto loc = bop.getLoc(); + auto loc = op.getLoc(); typename OpTy::Adaptor transformed(operands); // Extract real and imaginary values from operands.