[Mlir-commits] [mlir] [MLIR][Presburger] Implement arithmetic operations (/, +, -) and printing for Fractions (PR #65310)
Arjun P
llvmlistbot at llvm.org
Tue Sep 5 08:53:14 PDT 2023
================
@@ -95,8 +99,52 @@ inline bool operator>=(const Fraction &x, const Fraction &y) {
return compare(x, y) >= 0;
}
+inline Fraction reduce(const Fraction &f) {
+ if (f == Fraction(0))
+ return f;
----------------
Superty wrote:
Can you make this return Fraction(0)? The reason is that the denominator then gets simplified to 1.
https://github.com/llvm/llvm-project/pull/65310
More information about the Mlir-commits
mailing list