[PATCH] D124750: [MLIR] Add a utility to sort the operands of commutative ops
Mehdi AMINI via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 15 14:51:00 PDT 2022
mehdi_amini added a comment.
Right now I'm not yet understanding all of the algorithm (haven't spent enough time on it), but I'm mostly concerned by the runtime cost of this normalization.
================
Comment at: mlir/lib/Transforms/Utils/CommutativityUtils.cpp:371
+ // assigned a sorted position yet.
+ SmallVector<OperandBFS *, 2> bfsOfOperands;
+
----------------
================
Comment at: mlir/lib/Transforms/Utils/CommutativityUtils.cpp:377-379
+ OperandBFS *bfsOfOperand = new OperandBFS();
+ bfsOfOperand->pushAncestor(operand.getDefiningOp());
+ bfsOfOperands.push_back(bfsOfOperand);
----------------
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124750/new/
https://reviews.llvm.org/D124750
More information about the cfe-commits
mailing list