[Mlir-commits] [mlir] f4bcddc - [mlir] Add convenience builder for arith.addui_carry

Jakub Kuderski llvmlistbot at llvm.org
Thu Aug 25 14:02:51 PDT 2022


Author: Jakub Kuderski
Date: 2022-08-25T17:00:22-04:00
New Revision: f4bcddc6a1b18bf50ba039cb4e0993a7e3596dde

URL: https://github.com/llvm/llvm-project/commit/f4bcddc6a1b18bf50ba039cb4e0993a7e3596dde
DIFF: https://github.com/llvm/llvm-project/commit/f4bcddc6a1b18bf50ba039cb4e0993a7e3596dde.diff

LOG: [mlir] Add convenience builder for arith.addui_carry

This is so that future conversions do not have to figure out how to
create matching boolean types for the second result.

Reviewed By: Mogball

Differential Revision: https://reviews.llvm.org/D132630

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/Arithmetic/IR/ArithmeticOps.td

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/Arithmetic/IR/ArithmeticOps.td b/mlir/include/mlir/Dialect/Arithmetic/IR/ArithmeticOps.td
index f6e8a9af02b44..7df5e774bc145 100644
--- a/mlir/include/mlir/Dialect/Arithmetic/IR/ArithmeticOps.td
+++ b/mlir/include/mlir/Dialect/Arithmetic/IR/ArithmeticOps.td
@@ -232,6 +232,13 @@ def Arith_AddUICarryOp : Arith_Op<"addui_carry", [Commutative,
     $lhs `,` $rhs attr-dict `:` type($sum) `,` type($carry)
   }];
 
+  let builders = [
+    OpBuilder<(ins "Value":$lhs, "Value":$rhs), [{
+      build($_builder, $_state, lhs.getType(), ::getI1SameShape(lhs.getType()),
+            lhs, rhs);
+    }]>
+  ];
+
   let hasFolder = 1;
 
   let extraClassDeclaration = [{


        


More information about the Mlir-commits mailing list