[Mlir-commits] [mlir] [mlir][arith] Add overflow flags support to arith ops (PR #77211)

Jakub Kuderski llvmlistbot at llvm.org
Mon Jan 8 13:52:45 PST 2024


================
@@ -403,7 +405,7 @@ def TruncIShrSIToTrunciShrUI :
 def TruncIShrUIMulIToMulSIExtended :
     Pat<(Arith_TruncIOp:$tr (Arith_ShRUIOp
                               (Arith_MulIOp:$mul
-                                (Arith_ExtSIOp $x), (Arith_ExtSIOp $y)),
+                                (Arith_ExtSIOp $x), (Arith_ExtSIOp $y), $ovf1),
----------------
kuhar wrote:

If we known that the multiplication doesn't overflow we should be able to replace the overflow result bit with 0.

Could you add a top-level TODO comment to audit these canon patterns with overflow flags in mind? I think this would make a nice self-contained issue we could mark as 'good first issue'

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


More information about the Mlir-commits mailing list