[PATCH] D124750: [MLIR] Add a utility to sort the operands of commutative ops

Srishti Srivastava via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 9 16:51:03 PDT 2022


srishti-pm updated this revision to Diff 428240.
srishti-pm added a comment.

Within constant-like ops, removed the requirement for them being sorted alphabetically. Basically, all constants will be treated as equals by the sorting algorithm and it will not distinguish between, say, `arith.constant` and `tf.Const`. This is because multiple canonicalizations exist in various dialects that push the constants to the right but do not make any distinction among constants. So, since we want this utility to not clash with those canonicalizations, this is being done.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124750/new/

https://reviews.llvm.org/D124750

Files:
  clang/docs/tools/clang-formatted-files.txt
  mlir/include/mlir/Transforms/CommutativityUtils.h
  mlir/lib/Transforms/Utils/CMakeLists.txt
  mlir/lib/Transforms/Utils/CommutativityUtils.cpp
  mlir/test/Transforms/test-commutativity-utils.mlir
  mlir/test/lib/Dialect/Test/TestOps.td
  mlir/test/lib/Transforms/CMakeLists.txt
  mlir/test/lib/Transforms/TestCommutativityUtils.cpp
  mlir/tools/mlir-opt/mlir-opt.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124750.428240.patch
Type: text/x-patch
Size: 27850 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220509/2e5aa433/attachment-0001.bin>


More information about the cfe-commits mailing list