From: Tobias Gysi Date: Thu, 28 Oct 2021 17:46:35 +0000 (+0000) Subject: [mlir][linalg] Remove unused method (NFC). X-Git-Tag: upstream/15.0.7~27320 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=31a949fada877c5fe27d7d333d2a44e02f9239a5;p=platform%2Fupstream%2Fllvm.git [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 --- diff --git a/mlir/lib/Dialect/Linalg/Transforms/HoistPadding.cpp b/mlir/lib/Dialect/Linalg/Transforms/HoistPadding.cpp index 2cb34fb..a08ac26 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 -static bool backwardsSliceOnlyHasOpsOfType(scf::ForOp outerLimit, Value v) { - // Compute a backward slice up to, but not including, `outerLimit`. - SetVector 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(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`].