From 032f13c732d0d209a7cd7abecf0cd854605bfee1 Mon Sep 17 00:00:00 2001 From: Quinn Dawkins Date: Sun, 27 Aug 2023 10:38:50 -0400 Subject: [PATCH] rename helper --- .../compiler/Dialect/Flow/Transforms/RaiseSpecialOps.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/compiler/src/iree/compiler/Dialect/Flow/Transforms/RaiseSpecialOps.cpp b/compiler/src/iree/compiler/Dialect/Flow/Transforms/RaiseSpecialOps.cpp index 74075082beab..03fa3f8e6b67 100644 --- a/compiler/src/iree/compiler/Dialect/Flow/Transforms/RaiseSpecialOps.cpp +++ b/compiler/src/iree/compiler/Dialect/Flow/Transforms/RaiseSpecialOps.cpp @@ -28,8 +28,9 @@ namespace Flow { namespace { -// Method to match a transpose operation. -static bool matchNDTranspose(linalg::LinalgOp genericOp, unsigned rank) { +// Method to match a transpose operation on the two most minor dimensions of the +// specified rank. +static bool matchInner2DTranspose(linalg::LinalgOp genericOp, unsigned rank) { // Only makes sense for minimum rank 2. if (rank < 2) { return false; @@ -76,7 +77,7 @@ std::optional matchATransposeBMatmul(linalg::LinalgOp matmulOp) { } auto rhs = matmulOp.getDpsInputOperand(1); auto genericOp = rhs->get().getDefiningOp(); - if (genericOp && matchNDTranspose(genericOp, 2)) { + if (genericOp && matchInner2DTranspose(genericOp, 2)) { return genericOp.getDpsInputOperand(0)->get(); } return std::nullopt; @@ -90,7 +91,7 @@ std::optional matchATransposeBBatchMatmul(linalg::LinalgOp bmmOp) { } auto rhs = bmmOp.getDpsInputOperand(1); auto genericOp = rhs->get().getDefiningOp(); - if (genericOp && matchNDTranspose(genericOp, 3)) { + if (genericOp && matchInner2DTranspose(genericOp, 3)) { return genericOp.getDpsInputOperand(0)->get(); } return std::nullopt;