[all-commits] [llvm/llvm-project] 6d6f6c: [MLIR][Presburger] use arbitrary-precision arithme...

Arjun P via All-commits all-commits at lists.llvm.org
Wed Sep 14 07:47:38 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6d6f6c4d3f40b2d0220fca73b27b8e74e64ba55a
      https://github.com/llvm/llvm-project/commit/6d6f6c4d3f40b2d0220fca73b27b8e74e64ba55a
  Author: Arjun P <arjunpitchanathan at gmail.com>
  Date:   2022-09-14 (Wed, 14 Sep 2022)

  Changed paths:
    M mlir/include/mlir/Analysis/Presburger/Fraction.h
    M mlir/include/mlir/Analysis/Presburger/IntegerRelation.h
    M mlir/include/mlir/Analysis/Presburger/LinearTransform.h
    M mlir/include/mlir/Analysis/Presburger/Matrix.h
    M mlir/include/mlir/Analysis/Presburger/PWMAFunction.h
    M mlir/include/mlir/Analysis/Presburger/PresburgerRelation.h
    M mlir/include/mlir/Analysis/Presburger/Simplex.h
    M mlir/include/mlir/Analysis/Presburger/Utils.h
    M mlir/include/mlir/Dialect/Affine/Analysis/Utils.h
    M mlir/lib/Analysis/Presburger/IntegerRelation.cpp
    M mlir/lib/Analysis/Presburger/LinearTransform.cpp
    M mlir/lib/Analysis/Presburger/Matrix.cpp
    M mlir/lib/Analysis/Presburger/PWMAFunction.cpp
    M mlir/lib/Analysis/Presburger/PresburgerRelation.cpp
    M mlir/lib/Analysis/Presburger/Simplex.cpp
    M mlir/lib/Analysis/Presburger/Utils.cpp
    M mlir/lib/Dialect/Affine/Analysis/AffineAnalysis.cpp
    M mlir/lib/Dialect/Affine/Analysis/AffineStructures.cpp
    M mlir/lib/Dialect/Affine/Analysis/Utils.cpp
    M mlir/lib/Dialect/Affine/Utils/Utils.cpp
    M mlir/lib/Dialect/Linalg/Utils/Utils.cpp
    M mlir/lib/Dialect/SCF/Utils/AffineCanonicalizationUtils.cpp
    M mlir/unittests/Analysis/Presburger/IntegerPolyhedronTest.cpp
    M mlir/unittests/Analysis/Presburger/LinearTransformTest.cpp
    M mlir/unittests/Analysis/Presburger/PresburgerSetTest.cpp
    M mlir/unittests/Analysis/Presburger/SimplexTest.cpp
    M mlir/unittests/Analysis/Presburger/Utils.h

  Log Message:
  -----------
  [MLIR][Presburger] use arbitrary-precision arithmetic with MPInt instead of int64_t

Only the main Presburger library under the Presburger directory has been switched to use arbitrary precision. Users have been changed to just cast returned values back to int64_t or to use newly added convenience functions that perform the same cast internally.

The performance impact of this has been tested by checking test runtimes after copy-pasting 100 copies of each function. Affine/simplify-structures.mlir goes from 0.76s to 0.80s after this patch. Its performance sees no regression compared to its original performance at commit 18a06d4f3a7474d062d1fe7d405813ed2e40b4fc before a series of patches that I landed to offset the performance overhead of switching to arbitrary precision.

Affine/canonicalize.mlir and SCF/canonicalize.mlir show no noticable difference, staying at 2.02s and about 2.35s respectively.

Also, for Affine and SCF tests as a whole (no copy-pasting), the runtime remains about 0.09s on average before and after.

Reviewed By: bondhugula

Differential Revision: https://reviews.llvm.org/D129510




More information about the All-commits mailing list