================ @@ -568,6 +568,128 @@ mlir::LogicalResult CIRToLLVMGlobalOpLowering::matchAndRewrite( return mlir::success(); } +mlir::LogicalResult CIRToLLVMUnaryOpLowering::matchAndRewrite( + cir::UnaryOp op, OpAdaptor adaptor, + mlir::ConversionPatternRewriter &rewriter) const { + assert(op.getType() == op.getInput().getType() && + "Unary operation's operand type and result type are different"); + mlir::Type type = op.getType(); + mlir::Type elementType = type; + bool isVector = false; + assert(!cir::MissingFeatures::vectorType()); + mlir::Type llvmType = getTypeConverter()->convertType(type); + mlir::Location loc = op.getLoc(); + + auto createIntConstant = [&](int64_t value) -> mlir::Value { ---------------- andykaylor wrote:
I'm working on an incubator change to do this. There are lots of opportunities to reuse a utility function there. I'll update this PR once I have a final form for the utility function. https://github.com/llvm/llvm-project/pull/131369 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits