[Mlir-commits] [mlir] [mlir][LLVM] Add nsw and nuw flags (PR #74508)

Tobias Gysi llvmlistbot at llvm.org
Wed Dec 6 05:44:16 PST 2023


================
@@ -69,7 +69,12 @@ static ParseResult parseLLVMOpAttrs(OpAsmParser &parser,
 
 static void printLLVMOpAttrs(OpAsmPrinter &printer, Operation *op,
                              DictionaryAttr attrs) {
-  printer.printOptionalAttrDict(processFMFAttr(attrs.getValue()));
+  if (auto iface = dyn_cast<IntegerOverflowFlagsInterface>(op))
+    printer.printOptionalAttrDict(
+        processFMFAttr(attrs.getValue()),
----------------
gysit wrote:

Note that the processFMFAttr works a bit differently. It seems to prevent that the default value of the fast math flag is not printed in the attribute dictionary while all other values are actually not elided from the attribute dictionary (At least that is my interpretation). We probably want to have nice pretty printing for the fastmath flags as well but that is definitely orthogonal to this PR. 

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


More information about the Mlir-commits mailing list