================ @@ -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:
The createDummyValue he added is in the CIR codegen, and it's doing something different. These do seem like utility functions that will probably be useful elsewhere though. Or maybe a wrapper function isn't even needed. 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