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

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Nov 11 01:51:01 PST 2024


=?utf-8?q?Léon?= Frenot <leon.frenot at ens-lyon.fr>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/115498 at github.com>


================
@@ -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);
----------------
lfrenot wrote:

Done!

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


More information about the Mlir-commits mailing list