[mlir][linalg] Remove unused method (NFC).
authorTobias Gysi <gysit@google.com>
Thu, 28 Oct 2021 17:46:35 +0000 (17:46 +0000)
committerTobias Gysi <gysit@google.com>
Thu, 28 Oct 2021 18:12:38 +0000 (18:12 +0000)
Remove an unused method in hoist padding and format comment.

Reviewed By: nicolasvasilache

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

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

index 2cb34fb..a08ac26 100644 (file)
@@ -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`].