[Mlir-commits] [mlir] [mlir][arith] Add nneg to extui and uitofp. (PR #183165)

Jakub Kuderski llvmlistbot at llvm.org
Wed Feb 25 06:38:17 PST 2026


================
@@ -111,6 +111,29 @@ class AttrConvertOverflowToLLVM {
   DictionaryAttr propertiesAttr;
 };
 
+// Attribute converter that populates a NamedAttrList by removing the nonNeg
+// attribute from the source operation attributes, and setting it as a property
+// on the target LLVM operation.
+template <typename SourceOp, typename TargetOp>
+class AttrConvertNonNegToLLVM {
+public:
+  AttrConvertNonNegToLLVM(SourceOp srcOp) {
+    convertedAttr = NamedAttrList{srcOp->getAttrs()};
+    if (convertedAttr.erase("nonNeg")) {
----------------
kuhar wrote:

nit: invert this and exit early instead

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


More information about the Mlir-commits mailing list