From: Adrian Kuegel Date: Fri, 8 Jan 2021 14:37:06 +0000 (+0100) Subject: Remove redundant casts. X-Git-Tag: llvmorg-13-init~1571 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=af339f89a142622b6fc56c5f79d19e568af5287a;p=platform%2Fupstream%2Fllvm.git Remove redundant casts. Differential Revision: https://reviews.llvm.org/D94305 --- diff --git a/mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp b/mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp index 8023a80..53ebd67 100644 --- a/mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp +++ b/mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp @@ -1735,19 +1735,18 @@ struct CreateComplexOpLowering 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(); } }; @@ -1794,8 +1793,7 @@ template 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.