[Mlir-commits] [mlir] [mlir][LLVM] Add nneg flag (PR #115498)

Tobias Gysi llvmlistbot at llvm.org
Sat Nov 9 03:24:39 PST 2024


================
@@ -508,6 +508,23 @@ class LLVM_CastOp<string mnemonic, string instName, Type type,
       $_location, $_resultType, $arg);
   }];
 }
+class LLVM_CastOpWithNNegFlag<string mnemonic, string instName, Type type,
+                  Type resultType, list<Trait> traits = []> :
+    LLVM_Op<mnemonic, !listconcat([Pure], [DeclareOpInterfaceMethods<NonNegFlagInterface>], traits)>,
+    LLVM_Builder<"$res = builder.Create" # instName # "($arg, $_resultType, /*Name=*/\"\", op.getNonNeg());"> {
+  let arguments = (ins type:$arg,  UnitAttr:$nonNeg);
----------------
gysit wrote:

```suggestion
  let arguments = (ins type:$arg, UnitAttr:$nonNeg);
```
ultra nit: 

https://github.com/llvm/llvm-project/pull/115498


More information about the Mlir-commits mailing list