[Mlir-commits] [mlir] 31a949f - [mlir][linalg] Remove unused method (NFC).

Tobias Gysi llvmlistbot at llvm.org
Thu Oct 28 11:12:53 PDT 2021


Author: Tobias Gysi
Date: 2021-10-28T18:12:38Z
New Revision: 31a949fada877c5fe27d7d333d2a44e02f9239a5

URL: https://github.com/llvm/llvm-project/commit/31a949fada877c5fe27d7d333d2a44e02f9239a5
DIFF: https://github.com/llvm/llvm-project/commit/31a949fada877c5fe27d7d333d2a44e02f9239a5.diff

LOG: [mlir][linalg] Remove unused method (NFC).

Remove an unused method in hoist padding and format comment.

Reviewed By: nicolasvasilache

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

Added: 
    

Modified: 
    mlir/lib/Dialect/Linalg/Transforms/HoistPadding.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Linalg/Transforms/HoistPadding.cpp b/mlir/lib/Dialect/Linalg/Transforms/HoistPadding.cpp
index 2cb34fb554a4..a08ac26b43ce 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/HoistPadding.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/HoistPadding.cpp
@@ -45,10 +45,9 @@ using namespace mlir::linalg;
 ///   1. Pad op has a use that is not an input of a LinalgOp.
 ///   2. There is no immediately enclosing scf::ForOp.
 ///   3. The backward slice from the pad op to the scf::ForOp to hoist above
-///   contains
-///      an unknown op with a region.
+///      contains an unknown op with a region.
 ///   4. The backward slice from the pad op to the scf::ForOp to hoist above is
-///   empty.
+///      empty.
 /// Other cases succeed and will trigger hoisting of the pad op.
 struct HoistingAnalysis {
   HoistingAnalysis(PadTensorOp padTensorOp, int nLevels);
@@ -336,26 +335,6 @@ HoistingAnalysis::getPackedTensorSizes(ImplicitLocOpBuilder &b) {
   return dynamicTensorSizes;
 }
 
-/// Return success if `v` is a value that is only transitively defined by ops of
-/// type in `OpTypeList`.
-template <typename... OpTypeList>
-static bool backwardsSliceOnlyHasOpsOfType(scf::ForOp outerLimit, Value v) {
-  // Compute a backward slice up to, but not including, `outerLimit`.
-  SetVector<Operation *> backwardSlice;
-  getBackwardSlice(v, &backwardSlice, [&](Operation *op) {
-    return outerLimit->isProperAncestor(op);
-  });
-  // Traverse the backward slice and ensure we can perform the computation to
-  // hoist.
-  for (Operation *op : backwardSlice) {
-    if (isa<OpTypeList...>(op))
-      continue;
-    LLVM_DEBUG(DBGS() << "Abort: unadmissible op in slice " << *op << "\n");
-    return false;
-  }
-  return true;
-}
-
 /// Return the current iteration number in the loop (iv - lb).ceilDiv(step).
 /// The returned Value is guaranteed not to depend on any loop comprised in
 /// [`outer`, `forOp`].


        


More information about the Mlir-commits mailing list